/test/language/unclassified/test_infix_equal.e

http://github.com/tybor/Liberty · Specman e · 97 lines · 40 code · 5 blank · 52 comment · 1 complexity · edbb30a8fb3177db0e5edfdb51a78ae4 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_INFIX_EQUAL
  5. create {}
  6. make
  7. feature {ANY}
  8. make
  9. local
  10. c: CHARACTER; d, d2: REAL_64; r: REAL_32; animal: ANIMAL; dog: DOG
  11. do
  12. -- a: ANY
  13. c := 'a'
  14. assert('a' = c)
  15. -- *** CHARACTER does not conform to ANY (Vincent Croizier, 03/11/2004) ***
  16. -- a := c
  17. -- *** assert(not(a = 'a'))
  18. -- Yes, it was a really bad idea to accept such code !
  19. -- *** (Dom. july 12th 2004) ***
  20. -- *** assert(not('a' = a))
  21. -- Yes, it was a really bad idea to accept such code !
  22. -- *** (Dom. july 12th 2004) ***
  23. assert(88 = 88)
  24. -- *** INTEGER_8 does not conform to ANY (Vincent Croizier, 03/11/2004) ***
  25. -- a := 88
  26. -- *** assert(not(a = 88))
  27. -- Yes, it was a really bad idea to accept such code !
  28. -- *** (Dom. july 12th 2004) ***
  29. -- *** assert(not(88 = a))
  30. -- Yes, it was a really bad idea to accept such code !
  31. -- *** (Dom. july 12th 2004) ***
  32. assert(88.to_real_64 = 88.0)
  33. -- *** INTEGER_8 does not conform to ANY (Vincent Croizier, 03/11/2004) ***
  34. -- a := 88
  35. -- assert(equal(a,88))
  36. -- *** assert(not(a = 88))
  37. -- Yes, it was a really bad idea to accept such code !
  38. -- *** (Dom. july 12th 2004) ***
  39. -- *** assert(not(88 = a))
  40. -- Yes, it was a really bad idea to accept such code !
  41. -- *** (Dom. july 12th 2004) ***
  42. r := {REAL_32 88.0}
  43. assert(r = 88.000)
  44. -- *** REAL does not conform to ANY (Vincent Croizier, 03/11/2004) ***
  45. -- a := 88.0
  46. assert(r = 88)
  47. assert(88 = r)
  48. d := 88.0
  49. assert(d = 88.0)
  50. assert(88.0 = d)
  51. d2 := d
  52. assert(d2 = 88.0)
  53. assert(88.0 = d2)
  54. -- *** REAL does not conform to ANY (Vincent Croizier, 03/11/2004) ***
  55. -- a := d2
  56. assert(d2 = 88.to_real_64)
  57. assert(88.to_real_64 = d2)
  58. assert(animal = dog)
  59. assert(dog = animal)
  60. end
  61. assert (b: BOOLEAN)
  62. do
  63. cpt := cpt + 1
  64. if not b then
  65. sedb_breakpoint
  66. std_output.put_string("TEST_INFIX_EQUAL: ERROR Test # ")
  67. std_output.put_integer(cpt)
  68. std_output.put_string("%N")
  69. else
  70. -- std_output.put_string("Yes%N")
  71. end
  72. end
  73. cpt: INTEGER
  74. end -- class TEST_INFIX_EQUAL
  75. --
  76. -- ------------------------------------------------------------------------------------------------------------------------------
  77. -- Copyright notice below. Please read.
  78. --
  79. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  80. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  81. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  82. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  83. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  84. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  85. --
  86. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  87. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  88. --
  89. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  90. --
  91. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  92. -- ------------------------------------------------------------------------------------------------------------------------------