/test/language/instruction/misc/test_like2.e

http://github.com/tybor/Liberty · Specman e · 70 lines · 37 code · 5 blank · 28 comment · 1 complexity · aa0411ceb83292ffb36d10d255929d30 MD5 · raw file

  1. -- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
  2. -- See the Copyright notice at the end of this file.
  3. --
  4. class TEST_LIKE2
  5. create {}
  6. make
  7. feature {ANY}
  8. make
  9. local
  10. a: AUX_LIKE2A; b: AUX_LIKE2B; c: AUX_LIKE2C
  11. do
  12. create a
  13. create b
  14. create c
  15. assert(a.f(a) = 'A')
  16. assert(a.f(b) = 'B')
  17. assert(a.f(c) = 'C')
  18. -- assert(b.f(a) = 'A');
  19. assert(b.f(b) = 'B')
  20. assert(b.f(c) = 'C')
  21. -- assert(c.f(a) = 'A');
  22. -- assert(c.f(b) = 'B');
  23. assert(c.f(c) = 'C')
  24. assert(a.is_equal(a))
  25. assert(not a.is_equal(b))
  26. assert(not a.is_equal(c))
  27. -- assert( b.is_equal(a));
  28. assert(b.is_equal(b))
  29. assert(not b.is_equal(c))
  30. -- assert( c.is_equal(a));
  31. -- assert( c.is_equal(b));
  32. assert(c.is_equal(c))
  33. end
  34. feature {}
  35. assert (b: BOOLEAN)
  36. do
  37. cpt := cpt + 1
  38. if not b then
  39. std_output.put_string("TEST_LIKE2: ERROR Test # ")
  40. std_output.put_integer(cpt)
  41. std_output.put_string("%N")
  42. else
  43. --std_output.put_string("Yes%N");
  44. end
  45. end
  46. cpt: INTEGER
  47. end -- class TEST_LIKE2
  48. --
  49. -- ------------------------------------------------------------------------------------------------------------------------------
  50. -- Copyright notice below. Please read.
  51. --
  52. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  53. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  54. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  55. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  56. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  57. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  58. --
  59. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  60. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  61. --
  62. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  63. --
  64. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  65. -- ------------------------------------------------------------------------------------------------------------------------------