/tutorial/triangle/version4/example2.e

http://github.com/tybor/Liberty · Specman e · 34 lines · 25 code · 6 blank · 3 comment · 0 complexity · 21bb4b2a9a0c92060b6c9aab8aecb3c1 MD5 · raw file

  1. class EXAMPLE2
  2. create {ANY}
  3. main
  4. feature {ANY}
  5. main
  6. local
  7. t1, t2: TRIANGLE
  8. do
  9. sedb_breakpoint
  10. -- Under sedb, try the 'G' command now.
  11. create t1.make(create {POINT}.make(1.0, 2.0), create {POINT}.make(3.0, 4.0), create {POINT}.make(5.0, 6.0))
  12. sedb_breakpoint
  13. -- Under sedb, try the 'G' again and check for the number of
  14. -- created TRIANGLEs and created POINTs.
  15. t2 := t1.twin
  16. check
  17. t1 /= t2
  18. t1.is_equal(t2)
  19. end
  20. t2.copy(t1)
  21. io.put_string("[
  22. It is a good exercice to run this example with the
  23. garbage collector information enabled:
  24. Type:
  25. compile -gc_info -sedb example2
  26. ]")
  27. end
  28. end -- class EXAMPLE2