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

/tutorial/triangle/version3/example4.e

http://github.com/tybor/Liberty
Specman e | 28 lines | 23 code | 3 blank | 2 comment | 0 complexity | c5f17d0b07bb392a28efd33df30d4b05 MD5 | raw file
 1class EXAMPLE4
 2
 3create {ANY}
 4   main
 5
 6feature {ANY}
 7   main
 8      local
 9         x, y, z: POINT; t1, t2: TRIANGLE
10      do
11         create x.make(1.0, 2.0)
12         create y.make(1.0, 2.0)
13         create z.make(3.0, 4.0)
14         check
15            x /= y
16            x.is_equal(y)
17         end
18         create t1.make(x, y, z)
19         create t2.make(x.twin, y.twin, z.twin)
20         check
21            t1 /= t2
22            t1.is_equal(t2) -- Normal crash here ...
23         end
24         -- To know how to customize the TRIANGLE.is_equal feature,
25         -- just have a look in the version4 directory.
26      end
27
28end -- class EXAMPLE4