~sircmpwn/ctools

ref: b2368727537ffebffe81e3d74031871e1cc1db98 ctools/test/echo -rw-r--r-- 635 bytes
b2368727Chris Vittal tests: make echo tests robust to build directory 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
tool="echo"
. "$HARNESS"

should_handle_one_string() (
	ct="$(./echo "this is a test string")"
	[ "$ct" = "this is a test string" ]
)

should_handle_two_string() (
	ct="$(./echo "this is a test string" "this second string")"
	[ "$ct" = "this is a test string this second string" ]
)

should_handle_tab_char() (
	ct="$(./echo -n "\tthis is a test string")"
	[ "$ct" = '	this is a test string' ]
)

should_handle_c_escape_char() (
	ct="$(./echo -n "this is a \ctest string")"
	[ "$ct" = "this is a " ]
)

runtests \
	should_handle_one_string \
	should_handle_two_string \
	should_handle_tab_char \
	should_handle_c_escape_char