/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
- class EXAMPLE3
- -- Test of the customized is_equal/copy of class TRIANGLE.
- create {ANY}
- main
- feature {ANY}
- main
- local
- x, y, z: POINT
- do
- create x.make(1.0, 2.0)
- create y.make(1.0, 2.0)
- create z.make(3.0, 4.0)
- if x = y then
- io.put_string("x = y%N")
- end
- if x /= y then
- io.put_string("x /= y%N")
- end
- if x.is_equal(y) then
- io.put_string("x.is_equal(y)%N")
- end
- if y.is_equal(z) then
- io.put_string("x.is_equal(y)%N")
- end
- y := x
- if x = y then
- io.put_string("x = y%N")
- end
- if x.is_equal(y) then
- io.put_string("x.is_equal(y)%N")
- end
- io.put_string("To get a clone of x:%N")
- y := x.twin
- if x /= y and then x.is_equal(y) then
- io.put_string("x /= y and then x.is_equal(y)%N")
- end
- end
- end -- class EXAMPLE3