/test/language/gc/test_bysl1.e

http://github.com/tybor/Liberty · Specman e · 74 lines · 47 code · 5 blank · 22 comment · 1 complexity · de2da73cd31cc43f1d674286f7cbbb9e 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_BYSL1
  5. -- From: Benjamin Yin-Sun Lynn <blynn@Stanford.EDU>
  6. create {}
  7. make
  8. feature {ANY}
  9. array: ARRAY[STRING]
  10. once
  11. Result := {ARRAY[STRING] 1, << "one", once "two", "three", "four" >> }
  12. end
  13. show
  14. local
  15. i: INTEGER
  16. do
  17. from
  18. i := array.lower
  19. until
  20. i > array.upper
  21. loop
  22. io.put_string("%"" + array.item(i) + "%"%N")
  23. i := i + 1
  24. end
  25. end
  26. make
  27. local
  28. i, j: INTEGER; s: STRING
  29. do
  30. from
  31. j := 1
  32. until
  33. j > 3
  34. loop
  35. from
  36. i := 1
  37. until
  38. i > 100000
  39. loop
  40. create s.make(5)
  41. i := i + 1
  42. end
  43. if not array.item(1).is_equal("one") then
  44. io.put_string("BUG!%N")
  45. show
  46. die_with_code(1)
  47. end
  48. j := j + 1
  49. end
  50. end
  51. end -- class TEST_BYSL1
  52. --
  53. -- ------------------------------------------------------------------------------------------------------------------------------
  54. -- Copyright notice below. Please read.
  55. --
  56. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  57. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  58. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  59. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  60. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  61. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  62. --
  63. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  64. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  65. --
  66. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  67. --
  68. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  69. -- ------------------------------------------------------------------------------------------------------------------------------