-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.bash
executable file
·76 lines (55 loc) · 1.21 KB
/
test.bash
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
source ./testify.bash
source ./furious.bash
seqLoop() {
for i in `seq 1 1000`;do
echo $i;
done
}
cstyleLoop() {
for ((i=0;i<=1000;i=i+1)) {
echo $i;
}
}
builtinLoop() {
for i in {1..1000};do
echo $i
done
}
cc() {
for i ;do
echo $i
done
}
builtinList() {
for i in *;do
echo $i
done
}
lsStyle() {
for i in $(ls);do
echo $i
done
}
furious add seqLoop "seq"
furious add cstyleLoop "cstyle"
furious add builtinLoop "builtin"
furious run
# furious complete cc
printf "slowest "
furious pluck slowest
printf "fastest "
furious pluck fastest
assert expect "$(furious pluck 'fastest')" "builtin" "Test for Fastest Runner" "This test should pass"
assert expect "$(furious pluck 'slowest')" "cstyle" "Test for Slowest Runner" "This test should pass"
furious unset
furious add builtinList "builtin"
furious add lsStyle "lsstyle"
furious run
# furious complete cc
printf "slowest "
furious pluck slowest
printf "fastest "
furious pluck fastest
assert expect "$(furious pluck 'fastest')" "builtin" "Test for Fastest Runner" "This should pass"
assert expect "$(furious pluck 'slowest')" "lsstyle" "Test for Slowest Runner" "This should pass"
assert done