/[eiffelstudio]/trunk/eweasel/tests/attach128/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/attach128/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 102531 - (show annotations)
Sat Nov 24 09:45:05 2018 UTC (9 months, 3 weeks ago) by alexk
File size: 3435 byte(s)
Added test cases with bracket expressions.
1 class TEST
2
3 create
4 make,
5 make_with,
6 make_arguments_with,
7 make_arguments_bracket_with,
8 make_safe_this,
9 make_arguments_safe_this,
10 make_arguments_bracket_safe_this,
11 make_safe_with,
12 make_arguments_safe_with,
13 make_arguments_bracket_safe_with
14
15 feature {NONE} -- Creation
16
17 make
18 -- Run test.
19 do
20 -- Initialize Current.
21 item := Current
22 -- Pass Current to update it with a new reference.
23 ;(create {TEST}.make_with (Current)).do_nothing
24 ;(create {TEST}.make_arguments_with (Current)).do_nothing
25 ;(create {TEST}.make_arguments_bracket_with (Current)).do_nothing
26 ;(create {TEST}.make_safe_this).do_nothing
27 ;(create {TEST}.make_arguments_safe_this).do_nothing
28 ;(create {TEST}.make_arguments_bracket_safe_this).do_nothing
29 ;(create {TEST}.make_safe_with (Current)).do_nothing
30 ;(create {TEST}.make_arguments_safe_with (Current)).do_nothing
31 ;(create {TEST}.make_arguments_bracket_safe_with (Current)).do_nothing
32 end
33
34 make_with (other: TEST)
35 -- Record Current object in other and then complete the initialization.
36 do
37 -- Call an assigner command passing an incompletely initialized Current.
38 other.item := Current -- Error: VEVI
39 -- Complete initialization.
40 item := Current
41 end
42
43 make_arguments_with (other: TEST)
44 -- Record Current object in other and then complete the initialization.
45 do
46 -- Call an assigner command passing an incompletely initialized Current.
47 other.data (Current) := Current -- Error: VEVI
48 end
49
50 make_arguments_bracket_with (other: TEST)
51 -- Record Current object in other and then complete the initialization.
52 do
53 -- Call an assigner command passing an incompletely initialized Current.
54 other [Current] := Current -- Error: VEVI
55 end
56
57 make_safe_this
58 -- Indirectly complete initialization.
59 do
60 -- Call an assigner command on a query that initializes Current.
61 this.item := Current
62 end
63
64 make_arguments_safe_this
65 -- Indirectly complete initialization.
66 do
67 -- Call an assigner command on a query that initializes Current.
68 this.data (Current) := Current
69 end
70
71 make_arguments_bracket_safe_this
72 -- Indirectly complete initialization.
73 do
74 -- Call an assigner command on a query that initializes Current.
75 this [Current] := Current
76 end
77
78 make_safe_with (other: TEST)
79 -- Record Current object in other indirectly completing the initialization earlier.
80 do
81 -- Call an assigner command with an expression that initializes Current.
82 other.item := this
83 end
84
85 make_arguments_safe_with (other: TEST)
86 -- Record Current object in other indirectly completing the initialization earlier.
87 do
88 -- Call an assigner command with an expression that initializes Current.
89 other.data (Current) := this
90 end
91
92 make_arguments_bracket_safe_with (other: TEST)
93 -- Record Current object in other indirectly completing the initialization earlier.
94 do
95 -- Call an assigner command with an expression that initializes Current.
96 other [Current] := this
97 end
98
99 feature -- Access
100
101 item: TEST assign put
102 -- An attribute to be initialized at creation.
103
104 this: TEST
105 -- Initialized Current object.
106 do
107 item := Current
108 Result := Current
109 end
110
111 put (value: TEST)
112 -- Set `item` to `value`.
113 do
114 item := value
115 end
116
117 data alias "[]" (value: TEST): TEST assign set
118 -- `value`.
119 do
120 Result := value
121 end
122
123 set (source: TEST; value: TEST)
124 -- An assigner for `data`.
125 do
126 end
127
128 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23