Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. package stringiter
  2.  
  3. import (
  4. "testing";
  5. )
  6.  
  7. var strings = []string {
  8. "", "ABCDEFG", "日本語",
  9. }
  10.  
  11. func TestIter(t * testing.T) {
  12. for _, str := range strings {
  13. it := Iter(str);
  14.  
  15. for _, char := range str {
  16. c := <-it;
  17. if c != char {
  18. t.Errorf("Expected 'U+%04X', but was 'U+%04X'", char, c);
  19. }
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment