/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

  1. class EXAMPLE4
  2. create {ANY}
  3. main
  4. feature {ANY}
  5. main
  6. local
  7. x, y, z: POINT; t1, t2: TRIANGLE
  8. do
  9. create x.make(1.0, 2.0)
  10. create y.make(1.0, 2.0)
  11. create z.make(3.0, 4.0)
  12. check
  13. x /= y
  14. x.is_equal(y)
  15. end
  16. create t1.make(x, y, z)
  17. create t2.make(x.twin, y.twin, z.twin)
  18. check
  19. t1 /= t2
  20. t1.is_equal(t2) -- Normal crash here ...
  21. end
  22. -- To know how to customize the TRIANGLE.is_equal feature,
  23. -- just have a look in the version4 directory.
  24. end
  25. end -- class EXAMPLE4