Skip to content
Snippets Groups Projects
Commit 864a23a0 authored by Dirk Zimoch's avatar Dirk Zimoch
Browse files

test script for expressions added

parent ad85a1eb
No related branches found
No related tags found
No related merge requests found
#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+1
# $(x) should be: 0X5F5B
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment