-
Notifications
You must be signed in to change notification settings - Fork 0
/
test00.sh
92 lines (56 loc) · 1.57 KB
/
test00.sh
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/dash
# testing subset 0 - command q
# TEST 0.1 #
reference=$(seq 20 43 | 2041 speed '5q')
program=$(seq 20 43 | ./speed.pl '5q')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 0.1 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 0.1 FAILED\033[0m\n"
fi
# TEST 0.2 #
reference=$(seq 1 100 | 2041 speed '200q')
program=$(seq 1 100 | ./speed.pl '200q')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 0.2 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 0.2 FAILED\033[0m\n"
fi
# TEST 0.3 #
reference=$(seq 1 100 | 2041 speed '/0/q')
program=$(seq 1 100 | ./speed.pl '/0/q')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 0.3 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 0.3 FAILED\033[0m\n"
fi
# TEST 0.4 #
reference=$(seq 1 100 | 2041 speed '/5{2}/q')
program=$(seq 1 100 | ./speed.pl '/5{2}/q')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 0.4 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 0.4 FAILED\033[0m\n"
fi
# TEST 0.5 #
reference=$(seq 400 500 | 2041 speed '/^.4.$/q')
program=$(seq 400 500 | ./speed.pl '/^.4.$/q')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 0.5 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 0.5 FAILED\033[0m\n"
fi
# TEST 0.6 #
reference=$(seq 400 500 | 2041 speed 'q')
program=$(seq 400 500 | ./speed.pl 'q')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 0.6 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 0.6 FAILED\033[0m\n"
fi