Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. // testing find
  2. void testFind(Tester t) {
  3. this.initDeque();
  4. t.checkExpect(deque2.find(new StrLengthOver3), sentinel1);
  5. t.checkExpect(deque2.find(new StrLengthOver2), node1);
  6. t.checkExpect(deque3.find(new StrLengthOver3), node5);
  7. }
  8.  
  9. // testing findSentHelp
  10. void testFindSentHelp(Tester t) {
  11. this.initDeque();
  12. t.checkExpect(sentinel1.findSentHelp(new StrLengthOver3), sentinel1);
  13. t.checkExpect(sentinel1.findSentHelp(new StrLengthOver2), node1);
  14. t.checkExpect(sentinel2.findSentHelp(new StrLengthOver3), node5);
  15. }
  16.  
  17. // testing findHelp
  18. void testFindHelp(Tester t) {
  19. this.initDeque();
  20. t.checkExpect(sentinel1.findHelp(new StrLengthOver3), sentinel1);
  21. t.checkExpect(node1.findHelp(new StrLengthOver3), sentinel1);
  22. t.checkExpect(node1.findHelp(new StrLengthOver2), node1);
  23. t.checkExpect(node3.findHelp(new StrLengthOver3), sentinel1);
  24. t.checkExpect(node3.findHelp(new StrLengthOver2), node3);
  25. }
  26.  
  27. // testing apply
  28. void testApply(Tester t) {
  29. t.checkExpect(new StrLengthOver3.apply("kitty"), true);
  30. t.checkExpect(new StrLengthOver3.apply("cat"), false);
  31. t.checkExpect(new StrLengthOver2.apply("cat"), true);
  32. t.checkExpect(new StrLengthOver2.apply("h"), false);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement