git-subtree-dir: vendor/git.knownelement.com/reachableceo/MarkdownResume-Pipeline git-subtree-split: 5f86add57cfb3deaac2e97ceb8c5d64cb9208046
		
			
				
	
	
		
			36 lines
		
	
	
		
			612 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			612 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| cd "${0%/*}" || exit 1
 | |
| . ../run-tests
 | |
| 
 | |
| export name=Willy
 | |
| MO_ALLOW_FUNCTION_ARGUMENTS=true
 | |
| 
 | |
| pipeTo() {
 | |
|     cat | "$1"
 | |
| }
 | |
| 
 | |
| testArgs() {
 | |
|     printf "%d" "$#"
 | |
| 
 | |
|     # Display all arguments
 | |
|     printf " %q" ${@+"$@"}
 | |
| }
 | |
| template() {
 | |
|     cat <<EOF
 | |
| No args: {{testArgs}} - done
 | |
| One arg: {{testArgs 'one'}} - done
 | |
| Getting name in a string: {{testArgs {"The name is " name}}} - done
 | |
| Reverse this: {{#pipeTo "rev"}}abcde{{/pipeTo "rev"}}
 | |
| EOF
 | |
| }
 | |
| expected() {
 | |
|     cat <<EOF
 | |
| No args: 0 '' - done
 | |
| One arg: 1 one - done
 | |
| Getting name in a string: 1 The\ name\ is\ Willy - done
 | |
| Reverse this: edcba
 | |
| EOF
 | |
| }
 | |
| 
 | |
| runTest
 |