/test/language/agent/test_agent68.e

http://github.com/tybor/Liberty · Specman e · 40 lines · 34 code · 6 blank · 0 comment · 0 complexity · ecd65a59ad509abddf2d73afbc3f7301 MD5 · raw file

  1. class TEST_AGENT68
  2. insert
  3. EIFFELTEST_TOOLS
  4. create {}
  5. make
  6. feature {}
  7. output: NULL_OUTPUT_STREAM
  8. once
  9. create Result
  10. end
  11. make
  12. local
  13. actions: FAST_ARRAY[TUPLE[STRING, PROCEDURE[TUPLE]]]
  14. i: INTEGER
  15. do
  16. create actions.make(0)
  17. actions.add_last(["one", agent say("hello")])
  18. actions.add_last(["two", agent say("world")])
  19. from
  20. i := actions.lower
  21. until
  22. i > actions.upper
  23. loop
  24. output.put_string(actions.item(i).first)
  25. output.put_character('%T')
  26. actions.item(i).second.call([])
  27. i := i + 1
  28. end
  29. end
  30. say (something: STRING)
  31. do
  32. output.put_line(something)
  33. end
  34. end