PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/tutorial/triangle/version4/example3.e

http://github.com/tybor/Liberty
Specman e | 47 lines | 37 code | 9 blank | 1 comment | 7 complexity | 2595a973c8b8c8d4d238a308883402f9 MD5 | raw file
 1class EXAMPLE3
 2   -- Test of the customized is_equal/copy of class TRIANGLE.
 3
 4create {ANY}
 5   main
 6
 7feature {ANY}
 8   main
 9      local
10         x, y, z: POINT
11      do
12         create x.make(1.0, 2.0)
13         create y.make(1.0, 2.0)
14         create z.make(3.0, 4.0)
15         if x = y then
16            io.put_string("x = y%N")
17         end
18
19         if x /= y then
20            io.put_string("x /= y%N")
21         end
22
23         if x.is_equal(y) then
24            io.put_string("x.is_equal(y)%N")
25         end
26
27         if y.is_equal(z) then
28            io.put_string("x.is_equal(y)%N")
29         end
30
31         y := x
32         if x = y then
33            io.put_string("x = y%N")
34         end
35
36         if x.is_equal(y) then
37            io.put_string("x.is_equal(y)%N")
38         end
39
40         io.put_string("To get a clone of x:%N")
41         y := x.twin
42         if x /= y and then x.is_equal(y) then
43            io.put_string("x /= y and then x.is_equal(y)%N")
44         end
45      end
46
47end -- class EXAMPLE3