-
Notifications
You must be signed in to change notification settings - Fork 0
/
test01.sh
72 lines (47 loc) · 1.3 KB
/
test01.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
#!/bin/dash
# testing subset 0 - command p
# TEST 1.1 #
reference=$(seq 20 70 | 2041 speed '43p')
program=$(seq 20 70 | ./speed.pl '43p')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 1.1 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 1.1 FAILED\033[0m\n"
fi
# TEST 1.2 #
reference=$(seq 20 70 | 2041 speed '80p')
program=$(seq 20 70 | ./speed.pl '80p')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 1.2 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 1.2 FAILED\033[0m\n"
fi
# TEST 1.3 #
reference=$(seq 20 70 | 2041 speed 'p')
program=$(seq 20 70 | ./speed.pl 'p')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 1.3 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 1.3 FAILED\033[0m\n"
fi
# TEST 1.4 #
reference=$(seq 20 70 | 2041 speed '/5{2}/p')
program=$(seq 20 70 | ./speed.pl '/5{2}/p')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 1.4 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 1.4 FAILED\033[0m\n"
fi
# TEST 1.5 #
reference=$(seq 20 70 | 2041 speed '/.8$/p')
program=$(seq 20 70 | ./speed.pl '/.8$/p')
if test "$reference" = "$program"
then
printf '%b' "\033[32;1mTEST 1.5 PASSED\033[0m\n"
else
printf '%b' "\033[31;1mTEST 1.5 FAILED\033[0m\n"
fi