forked from paulscherrerinstitute/require
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testscript
93 lines (62 loc) · 1.66 KB
/
testscript
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
#var exprDebug 1
x=3, !3, -3, ~3, 3?
# $(x) should be: 3, 0, -3, -4, 1
x=10+3, 10-3, 10*3, 10/3, 10%3, 10**3
# $(x) should be: 13, 7, 30, 3, 1, 1000
x=%x -10<<2, %x -10>>2, %x -10>>>2
# $(x) should be: ffffffffffffffd8, fffffffffffffffd, 3ffffffffffffffd
x=%x 0xaa & 0x0f, %x 0xaa | 0x0f, %x 0xaa ^ 0x0f
# $(x) should be: a, af, a5
x=10<20 10<=20 10==20 10>=20 10>20 10<=>20
# $(x) should be: 1 1 0 0 0 -1
x=20<20 20<=20 20==20 20>=20 20>20 20<=>20
# $(x) should be: 0 1 1 1 0 0
x=20<10 20<=10 20==10 20>=10 20>10 20<=>10
# $(x) should be: 0 0 0 1 1 1
x= (0|0)(0|1)(1|0)(1|1) (0&0)(0&1)(1&0)(1&1)
# $(x) should be: 0111 0001
x=1*2*3+4*5*6-7-8
# $(x) should be: 111
x=1*2*3+4*5*6-7*8
# $(x) should be: 70
x=-3**2+1, -(3**2)+1, (-3)**2+1, -3**-2+1, (1+2), (1+2, 1+2)
# $(x) should be: 10, -8, 10, 1, 3, (1+2, 3)
x=%#X 0x5555&0xfff0|0xaf<<8^0xa00a0>>4
# $(x) should be: 0X5F5A
x=7+4*2|32
# $(x) should be: 47
x=3<5 ? 7+4*2|32 : 9 & 10
# $(x) should be: 47
x=3>5 ? 7+4*2|32 : 9 & 10
# $(x) should be: 8
x=7 ?: -1
# $(x) should be: 7
x=0 ?: -1
# $(x) should be: -1
x=7 ? -1
# $(x) should be: -1
x=0 ? -1
# $(x) should be: 0
x=1+0?0?1:2:3?4:5
# $(x) should be: 2
x=1+0?7?1:2:3?4:5
# $(x) should be: 1
x=1+1?0?1:2:3-3?4:5
# $(x) should be: 2
x=1-1?0?1:2:3?4:5
# $(x) should be: 4
x=1-1?0?1:2:3-3?4:5
# $(x) should be: 5
x=0?; 1?; 2?; -4?
# $(x) should be: 0; 1; 1; 1
x=a030b a(030)b a( 030 )b "a"030"b" a(%x 030)b
# $(x) should be: a030b a24b a24b a24b a18b
x=030b (030)b ( 030 )b 030"b" %x 030'b'
# $(x) should be: 030b 24b 24b 24b 18b
x=-0bla -0.1
# $(x) should be: -0bla -0.1
x=-2**2 0-2**2 0+-2**2 0--2**2
# $(x) should be: 4 -4 4 -4
x=
y=$(x)
# <$(x)><$(y)> should be: <><>