repo.or.cz
/
posh.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Change debconf text to claim that the default /bin/sh is dash instead of bash. close...
[posh.git]
/
tests
/
arithmetic.t
blob
291f79ef5208a668ed562359f4047c0c15ee7fdb
1
name: arithmetic-1
2
description:
3
Addition
4
category: debian,posix
5
stdin:
6
echo $(( 100 + 200 ))
7
expected-stdout:
8
300
9
---
10
name: arithmetic-2
11
description:
12
Subtraction
13
category: debian,posix
14
stdin:
15
echo $(( 100 - 200 ))
16
expected-stdout:
17
-100
18
---
19
name: arithmetic-3
20
description:
21
Multiplication
22
category: debian,posix
23
stdin:
24
echo $(( 100 * 200 ))
25
expected-stdout:
26
20000
27
---
28
name: arithmetic-4
29
description:
30
Division
31
category: debian,posix
32
stdin:
33
echo $(( 200 / 100 ))
34
expected-stdout:
35
2
36
---
37
name: arithmetic-bases-1
38
description:
39
Check input bases
40
category: debian,posix
41
stdin:
42
echo $(( 50 ))
43
echo $(( 050 ))
44
echo $(( 0x50 ))
45
expected-stdout:
46
50
47
40
48
80
49
---
50
name: arithmetic-bases-2
51
description:
52
Check mixed bases
53
category: debian,posix
54
stdin:
55
echo $(( 50 - 050 ))
56
echo $(( 050 * 0xa ))
57
echo $(( 0x50 / 010 ))
58
expected-stdout:
59
10
60
400
61
10
62
---