/test/language/unclassified/test_rename2.e

http://github.com/tybor/Liberty · Specman e · 98 lines · 62 code · 14 blank · 22 comment · 1 complexity · 9ce1360f17abceac18200ad2a7a8a99f 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_RENAME2
  5. create {}
  6. make
  7. feature {ANY}
  8. foo (x: like Current): like Current
  9. require
  10. super_req_foo
  11. do
  12. Result := Current
  13. ensure
  14. super_ens_foo
  15. end
  16. make
  17. local
  18. aux: AUX_RENAME2
  19. do
  20. create aux
  21. assert(aux.foo(aux) = aux)
  22. ensure
  23. req_foo_mem.count = 1
  24. ens_foo_mem.count = 1
  25. super_req_foo_mem.count = 1
  26. super_ens_foo_mem.count = 1
  27. end
  28. feature {ANY}
  29. super_req_foo_mem: STRING ""
  30. super_ens_foo_mem: STRING ""
  31. req_foo_mem: STRING ""
  32. ens_foo_mem: STRING ""
  33. super_req_foo: BOOLEAN
  34. do
  35. super_req_foo_mem.extend(' ')
  36. Result := Current = Current
  37. end
  38. super_ens_foo: BOOLEAN
  39. do
  40. super_ens_foo_mem.extend(' ')
  41. Result := Current = Current
  42. end
  43. req_foo: BOOLEAN
  44. do
  45. req_foo_mem.extend(' ')
  46. Result := Current = Current
  47. end
  48. ens_foo: BOOLEAN
  49. do
  50. ens_foo_mem.extend(' ')
  51. Result := Current = Current
  52. end
  53. feature {ANY}
  54. assert (b: BOOLEAN)
  55. do
  56. cpt := cpt + 1
  57. if not b then
  58. std_output.put_string("TEST_RENAME2: ERROR Test # ")
  59. std_output.put_integer(cpt)
  60. std_output.put_string("%N")
  61. else
  62. -- std_output.put_string("Yes%N");
  63. end
  64. end
  65. cpt: INTEGER
  66. end -- class TEST_RENAME2
  67. --
  68. -- ------------------------------------------------------------------------------------------------------------------------------
  69. -- Copyright notice below. Please read.
  70. --
  71. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  72. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  73. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  74. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  75. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  76. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  77. --
  78. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  79. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  80. --
  81. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  82. --
  83. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  84. -- ------------------------------------------------------------------------------------------------------------------------------