Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: documenting/testing framework ?



On Fri, Jan 30, 2009 at 02:04:03PM +0100, Richard Hartmann wrote:
> Well, to test, you either need to write wrapper scripts which set up a
> certain test environment and then call whatever you defined.
> To comment, I suggest
> 
> # foo: This function prints foo
> foo() {
>     echo foo
> }

searching of ideas ... what about: 


^ \s* (function \s+)?
	<valid_function_name> 
	( \s+ <valid_function_name> )* 
	\(\)

can match a function declaration line. I have to find in zsh source/doc
what's the exact regex for <valid_function_name>.

foo () {
	# If i write doc here 
	# 1) it would be easier to parse
	# 2) i can use vim syntax indent folding
	#
	# embedded tests can be TAP one? 
	#ok "foo prints foo" [[ `foo` == foo ]]

	# after an empty line, it's just a normal comment
}

Regards



Messages sorted by: Reverse Date, Date, Thread, Author