~vcs-imports/gawk/master

« back to all changes in this revision

Viewing changes to test/assignconst.awk

  • Committer: Arnold D. Robbins
  • Date: 2012-11-25 19:54:48 UTC
  • mfrom: (319.1.122)
  • Revision ID: git-v1:9a9ff61bbd952c1263b55f82a269da5b09289a6b
Merge branch 'master' into array-iface

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@load "testext"
 
2
 
 
3
BEGIN {
 
4
        print ""
 
5
        print "test:", ARGV[1]
 
6
        switch (ARGV[1] + 0) {
 
7
        case 1:
 
8
                answer_num = 43
 
9
                break
 
10
        case 2:
 
11
                ++answer_num
 
12
                break
 
13
        case 3:
 
14
                --answer_num
 
15
                break
 
16
        case 4:
 
17
                answer_num++
 
18
                break
 
19
        case 5:
 
20
                answer_num--
 
21
                break
 
22
        case 6:
 
23
                answer_num += 1
 
24
                break
 
25
        case 7:
 
26
                answer_num -= 1
 
27
                break
 
28
        case 8:
 
29
                answer_num *= 1
 
30
                break
 
31
        case 9:
 
32
                answer_num /= 1
 
33
                break
 
34
        case 10:
 
35
                answer_num ^= 1
 
36
                break
 
37
        case 11:
 
38
                answer_num = answer_num "foo"
 
39
                break
 
40
        case 12:
 
41
                sub(/2/, "3", answer_num)
 
42
                break
 
43
        case 13:
 
44
                a[1] = 1
 
45
                for (answer_num in a)
 
46
                        print answer_num, a[answer_num]
 
47
                break
 
48
        case 14:
 
49
                test_func(answer_num)
 
50
                break
 
51
        }
 
52
}
 
53
 
 
54
function test_func(val)
 
55
{
 
56
        val++
 
57
        print "in test_func, val now =", val
 
58
}