upper_method.gravity 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #unittest {
  2. name: "upper() methods for string -- complex";
  3. error: NONE;
  4. result: true;
  5. };
  6. func main () {
  7. var s = "This is just a really long test string to try and get as MUCH variation as possible"
  8. // Numbers Only
  9. // the v in variation
  10. var a_int = s.upper(62) == "This is just a really long test string to try and get as MUCH Variation as possible"
  11. if (a_int == false) { System.print("a) int failed"); return false }
  12. var b_int = s.upper(-21) == s.upper(62)
  13. if (b_int == false) { System.print("b) int failed"); return false }
  14. var c_int = s.upper(2) == "ThIs is just a really long test string to try and get as MUCH variation as possible"
  15. if (c_int == false) { System.print("c) int failed"); return false }
  16. var d_int = s.upper(-81) == s.upper(2)
  17. if (d_int == false) { System.print("d) int failed"); return false }
  18. // Try a character that is already uppercase
  19. var e_int = s.upper(0) == "This is just a really long test string to try and get as MUCH variation as possible"
  20. if (e_int == false) { System.print("e) int failed"); return false }
  21. return true
  22. }