/test/language/unclassified/position/test_position4.e

http://github.com/tybor/Liberty · Specman e · 71 lines · 41 code · 9 blank · 21 comment · 1 complexity · 5086d55743afae53781c3eeec4c265d3 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_POSITION4
  5. create {}
  6. make
  7. feature {ANY}
  8. p1: AUX_POSITION
  9. current_class_id: INTEGER
  10. aux: AUX_POSITION4
  11. pos (l, c: INTEGER): AUX_POSITION
  12. require
  13. l >= 1
  14. c >= 1
  15. do
  16. Result.set(l, c, current_class_id.to_integer_16)
  17. end
  18. make
  19. local
  20. str: STRING
  21. do
  22. str := "...."
  23. current_class_id := 3
  24. p1 := pos(1, 2)
  25. assert(p1.line = 1)
  26. assert(p1.column = 2)
  27. assert(p1.id = 3)
  28. create aux.make(pos(4, 5))
  29. assert(aux.position.line = 4)
  30. assert(aux.position.column = 5)
  31. assert(aux.position.id = 3)
  32. end
  33. assert (b: BOOLEAN)
  34. do
  35. cpt := cpt + 1
  36. if not b then
  37. std_output.put_string("TEST_POSITION4: ERROR Test # ")
  38. std_output.put_integer(cpt)
  39. std_output.put_string("%N")
  40. crash
  41. end
  42. end
  43. cpt: INTEGER
  44. end -- class TEST_POSITION4
  45. --
  46. -- ------------------------------------------------------------------------------------------------------------------------------
  47. -- Copyright notice below. Please read.
  48. --
  49. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  50. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  51. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  52. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  53. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  54. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  55. --
  56. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  57. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  58. --
  59. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  60. --
  61. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  62. -- ------------------------------------------------------------------------------------------------------------------------------