/test/lib/string/test_string17.e

http://github.com/tybor/Liberty · Specman e · 28 lines · 22 code · 3 blank · 3 comment · 0 complexity · d84e1b896d81f950c639f23c838b42fd MD5 · raw file

  1. class TEST_STRING17
  2. -- Test append after removing a charater at beginning and at the end of the string
  3. insert EIFFELTEST_TOOLS
  4. create {}
  5. make
  6. feature {}
  7. make
  8. do
  9. foo("-123456-","78")
  10. end
  11. foo (a,b: ABSTRACT_STRING)
  12. local x: STRING; l,m: INTEGER_32
  13. do
  14. l := a.count; m:= b.count
  15. create x.make_from_string(a)
  16. assert(x.count=l)
  17. x.remove_first
  18. assert(x.count=l-1)
  19. --x.remove_last
  20. --assert(x.count=l-1)
  21. x.append(b)
  22. print("'"+x+"' is "+x.count.to_string+" characters long%N")
  23. assert(x.count = l-1+m)
  24. end
  25. end