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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 92354 - (show annotations)
Tue Mar 26 18:03:32 2013 UTC (6 years, 9 months ago) by alexk
File size: 2406 byte(s)
Extended test to cover non-conforming types.
1 class TEST
2
3 create
4 default_create,
5 make
6
7 feature {NONE} -- Creation
8
9 make
10 local
11 s: detachable separate TEST
12 t: detachable TEST
13 ts: A [TEST, separate TEST]
14 st: A [separate TEST, TEST]
15 ss: A [separate TEST, separate TEST]
16 do
17 t := Current
18 s := t
19 -- Object test.
20 -- Non-separate source type.
21 assert (attached t, 1)
22 assert (attached {TEST} t, 2)
23 assert (attached {separate TEST} t, 3)
24 assert (attached t as x, 4)
25 assert (attached {TEST} t as x, 5)
26 assert (attached {separate TEST} t as x, 6)
27 -- Separate source type, non-separate object.
28 assert (attached s, 7)
29 assert (attached {TEST} s, 8)
30 assert (attached {separate TEST} s, 9)
31 assert (attached s as x, 10)
32 assert (attached {TEST} s as x, 11)
33 assert (attached {separate TEST} s as x, 12)
34 -- Separate source type, separate object.
35 create s.default_create
36 assert (attached s, 13)
37 assert (not attached {TEST} s, 14)
38 assert (attached {separate TEST} s, 15)
39 assert (attached s as x, 16)
40 assert (not attached {TEST} s as x, 17)
41 assert (attached {separate TEST} s as x, 18)
42 -- Reverse assignment.
43 -- Non-separate source type.
44 t ?= t; assert (attached t, 19)
45 s ?= t; assert (attached s, 20)
46 -- Separate source type, non-separate object.
47 t ?= s; assert (attached t, 21)
48 s ?= s; assert (attached s, 22)
49 -- Separate source type, separate object.
50 create s.default_create
51 t ?= s; assert (not attached t, 23)
52 s ?= s; assert (attached s, 24)
53 -- Generic types.
54 create s.default_create
55 create ts.make (Current, True, 25)
56 create st.make (Current, True, 33)
57 create st.make (s, False, 41)
58 create ss.make (Current, True, 49)
59 create ss.make (s, True, 57)
60 -- Separate source type, non-conforming object.
61 assert (not attached {A [TEST, TEST]} s, 65)
62 assert (not attached {separate A [TEST, TEST]} s, 66)
63 assert (not attached {A [TEST, TEST]} s as x, 67)
64 assert (not attached {separate A [TEST, TEST]} s as x, 68)
65 end
66
67 feature {NONE} -- Output
68
69 assert (b: BOOLEAN; i: INTEGER)
70 -- Report whether test `i' is successful according to `b'.
71 do
72 io.put_string ("Test #")
73 io.put_integer (i)
74 io.put_string (": ")
75 if b then
76 io.put_string ("OK")
77 else
78 io.put_string ("FAILED")
79 end
80 io.put_character ('.')
81 io.put_new_line
82 end
83
84 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23