~sircmpwn/ctools

ref: cc69324393fda9bcbc73d30d1bda022263f012a8 ctools/test/echo -rw-r--r-- 635 bytes
cc693243 — Gabor Koszegi Correct tee SIGINT test 1 year, 11 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