/test/language/assertion/aux_require1_d.e

http://github.com/tybor/Liberty · Specman e · 109 lines · 69 code · 19 blank · 21 comment · 0 complexity · e776ac4f337e4891f2bf945185e8e75f 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 AUX_REQUIRE1_D
  5. inherit
  6. AUX_REQUIRE1_A
  7. AUX_REQUIRE1_C
  8. create {ANY}
  9. default_create
  10. feature {}
  11. d_only
  12. require
  13. counting_require
  14. do
  15. end
  16. d_or_a_and_c
  17. require else
  18. bad_counting_require
  19. do
  20. end
  21. d_or_a_and_b
  22. require else
  23. bad_counting_require
  24. do
  25. end
  26. everywhere
  27. require else
  28. bad_counting_require
  29. do
  30. end
  31. partial
  32. require else
  33. counting_require
  34. bad_counting_require
  35. counting_require
  36. do
  37. end
  38. feature {ANY}
  39. foo
  40. do
  41. counter.reset
  42. a_only
  43. assert(counter.item = 1)
  44. counter.reset
  45. b_only
  46. assert(counter.item = 1)
  47. counter.reset
  48. c_only
  49. assert(counter.item = 1)
  50. counter.reset
  51. d_only
  52. assert(counter.item = 1)
  53. counter.reset
  54. a_and_c
  55. assert(counter.item = 2)
  56. counter.reset
  57. d_or_a_and_c
  58. assert(counter.item = 3)
  59. counter.reset
  60. a_and_b
  61. assert(counter.item = 3)
  62. counter.reset
  63. d_or_a_and_b
  64. assert(counter.item = 4)
  65. counter.reset
  66. everywhere
  67. assert(counter.item = 5)
  68. counter.reset
  69. partial
  70. assert(counter.item = 7)
  71. end
  72. end -- class AUX_REQUIRE1_D
  73. --
  74. -- ------------------------------------------------------------------------------------------------------------------------------
  75. -- Copyright notice below. Please read.
  76. --
  77. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  78. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  79. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  80. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  81. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  82. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  83. --
  84. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  85. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  86. --
  87. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  88. --
  89. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  90. -- ------------------------------------------------------------------------------------------------------------------------------