~sircmpwn/ctools

ref: 3eec5b9b3b8bf2f66072143c14eed7134b5261a2 ctools/test/echo -rw-r--r-- 663 bytes
3eec5b9bChris Vittal env: fix potential NULL pointer dereference 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="$(../build/echo "this is a test string")"
	[ "$ct" = "this is a test string" ]
)

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

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

should_handle_c_escape_char() (
	ct="$(../build/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