blob: 53215348859936fd5c1efce88281752940ab35d2 [file] [log] [blame]
Chet Rameyac50fba2014-02-26 09:36:43 -05001one
2two
3three
4declare -n fee="flip"
5declare -n foo="bar"
6turning off nameref attribute on foo
7bar
8after +n foo bar = other
9one
10two
11one
12expect <one>
13argv[1] = <one>
14expect <two>
15argv[1] = <two>
16expect <one>
17one
18expect <one>
19one
20expect <one>
21argv[1] = <one>
22changevar: expect <two>
23argv[1] = <two>
24expect <two>
25argv[1] = <two>
26changevar: expect <three four five>
27argv[1] = <three four five>
28expect <three four five>
29argv[1] = <three four five>
30./nameref.tests: line 93: bar: readonly variable
31./nameref.tests: line 94: foo: readonly variable
32one
33one
34./nameref.tests: line 106: foo: readonly variable
35./nameref.tests: line 103: foo: readonly variable
36one
37one
38bar
39
40./nameref2.sub: line 5: foo: readonly variable
41
42expect <unset>
43argv[1] = <unset>
44expect <unset>
45argv[1] = <unset>
46expect <bar>
47argv[1] = <bar>
48expect <unset>
49argv[1] = <unset>
50./nameref3.sub: line 21: unset: bar: cannot unset: readonly variable
51expect <two>
52two
53expect <two>
54two
55three
56unset
57four
580
59expect <a b>
60a b
61expect <foo>
62foo
631 3 5 7 9
649
651 3 42 7 9
661 3 42 7 9
679
681 3 44 7 9
69unset
70expect <a b c d e>
71argv[1] = <a b c d e>
72expect <zero> <one> <seven> <three> <four>
73argv[1] = <zero>
74argv[2] = <one>
75argv[3] = <seven>
76argv[4] = <three>
77argv[5] = <four>
7816
79expect <4>
804
81expect <4>
824
83expect <4>
844
85expect <one>
86one
87expect <one>
88one
89expect <one>
90one
91expect <four>
92four
93errors = 0
941
952
96v1: 1
97v2: 2
98ref -> first, value: I am first
99ref -> second, value: I am in the middle
100ref -> third, value: I am last
101final state: ref -> third, value: I am last
102ref -> one, value: 1
103ref -> two, value: 2
104ref -> three, value: 3
105final state: ref -> three, value: 3
106./nameref5.sub: line 43: unset: three: cannot unset: readonly variable
107ref -> one, value: 1
108ref -> two, value: 2
109ref -> three, value: 3
110final state: ref -> three, value: 3
111./nameref6.sub: line 2: typeset: x: nameref variable self references not allowed
112./nameref6.sub: line 12: typeset: x: reference variable cannot be an array
113the -- 1
11442 -- 0
115y -- 0
1162 -- 0
1172 -- 0
118y -- 0
119bar
120unset
121inside
122inside: two
123outside:
124foo
125local
126./nameref8.sub: line 47: typeset: v: nameref variable self references not allowed
127./nameref8.sub: line 54: warning: x: circular name reference
128./nameref8.sub: line 55: warning: x: circular name reference
129x =