0
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
1 # Include bricolage library
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
2 . ./b.sh
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
3
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
4 # Simple test
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
5 mytest() {
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
6 ok 1 -eq 1
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
7 ok foo = foo
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
8 foo="Foo bar"
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
9 ok "$foo" = "Foo bar"
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
10 }
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
11
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
12 myspytest() {
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
13 spy date
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
14 date
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
15 ok "$(cat $T/spy.date.stdout)" != "foo"
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
16 echo foo > $T/spy.date
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
17 date
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
18 ok "$(tail -n 1 $T/spy.date.stdout)" = "foo"
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
19 }
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
20
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
21 # Run tests
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
22 bricolage mytest
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
23 bricolage myspytest
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
24
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
25 # Remove test data
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
26 rm -r "$T"
|
Serge A. Zaitsev <zaitsev.serge@gmail.com>
parents:
diff
changeset
|
27
|