File: arithmetic.t

package info (click to toggle)
posh 0.14.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,108 kB
  • sloc: ansic: 14,639; xml: 1,604; perl: 964; sh: 110; makefile: 36
file content (62 lines) | stat: -rw-r--r-- 855 bytes parent folder | download | duplicates (11)
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
name: arithmetic-1
description:
	Addition
category: debian,posix
stdin:
	echo $(( 100 + 200 ))
expected-stdout:
	300
---
name: arithmetic-2
description:
	Subtraction
category: debian,posix
stdin:
	echo $(( 100 - 200 ))
expected-stdout:
	-100
---
name: arithmetic-3
description:
	Multiplication
category: debian,posix
stdin:
	echo $(( 100 * 200 ))
expected-stdout:
	20000
---
name: arithmetic-4
description:
	Division
category: debian,posix
stdin:
	echo $(( 200 / 100 ))
expected-stdout:
	2
---
name: arithmetic-bases-1
description:
	Check input bases
category: debian,posix
stdin:
	echo $(( 50 ))
	echo $(( 050 ))
	echo $(( 0x50 ))
expected-stdout:
	50
	40
	80
---
name: arithmetic-bases-2
description:
	Check mixed bases
category: debian,posix
stdin:
	echo $(( 50 - 050 ))
	echo $(( 050 * 0xa ))
	echo $(( 0x50 / 010 ))
expected-stdout:
	10
	400
	10
---