diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-05 00:27:50 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-03-05 00:27:50 +0000 |
commit | 1c660b4bd2c303fcb829bc93143fc454693afab4 (patch) | |
tree | 5b2f2c8676d13bc132fdac4506049facd3475235 /shell/ash_test/ash-arith/arith1.sub | |
parent | 3af3e5b4b0d12dffbe7bd144092f8cb140ff74a4 (diff) | |
download | busybox-w32-1c660b4bd2c303fcb829bc93143fc454693afab4.tar.gz busybox-w32-1c660b4bd2c303fcb829bc93143fc454693afab4.tar.bz2 busybox-w32-1c660b4bd2c303fcb829bc93143fc454693afab4.zip |
small ash testsuite, adapted from bash
(only a small part of it, actually)
Diffstat (limited to 'shell/ash_test/ash-arith/arith1.sub')
-rwxr-xr-x | shell/ash_test/ash-arith/arith1.sub | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/shell/ash_test/ash-arith/arith1.sub b/shell/ash_test/ash-arith/arith1.sub new file mode 100755 index 000000000..80aa99922 --- /dev/null +++ b/shell/ash_test/ash-arith/arith1.sub | |||
@@ -0,0 +1,40 @@ | |||
1 | # test of redone post-increment and post-decrement code | ||
2 | ( echo $(( 4-- )) ) | ||
3 | ( echo $(( 4++ )) ) | ||
4 | ( echo $(( 4 -- )) ) | ||
5 | ( echo $(( 4 ++ )) ) | ||
6 | |||
7 | #ash# (( array[0]++ )) | ||
8 | #ash# echo ${array} | ||
9 | |||
10 | #ash# (( array[0] ++ )) | ||
11 | #ash# echo ${array} | ||
12 | |||
13 | #ash# (( a++ )) | ||
14 | #ash# echo $a | ||
15 | #ash# (( a ++ )) | ||
16 | #ash# echo $a | ||
17 | a=2 | ||
18 | |||
19 | echo 6 $(( a ++ + 4 )) | ||
20 | echo 3 $a | ||
21 | |||
22 | echo 7 $(( a+++4 )) | ||
23 | echo 4 $a | ||
24 | |||
25 | echo 0 $(( a---4 )) | ||
26 | echo 3 $a | ||
27 | |||
28 | echo 7 $(( a -- + 4 )) | ||
29 | echo 2 $a | ||
30 | |||
31 | echo -2 $(( a -- - 4 )) | ||
32 | echo 1 $a | ||
33 | |||
34 | #ash# (( ++ + 7 )) | ||
35 | |||
36 | #ash# (( ++ )) | ||
37 | ( echo $(( +++7 )) ) | ||
38 | # bash 3.2 apparently thinks that ++ +7 is 7 | ||
39 | #ash# echo $(( ++ + 7 )) | ||
40 | #ash# (( -- )) | ||