@@ -0,0 +1,10 @@
+#unittest {
+ name: "count() method for string";
+ error: NONE;
+ result: true;
+};
+
+func main () {
+ var s = "Hello World"
+ return s.count("l") == 3 and s.count("World") == 1 and s.count("xyz") == 0
+}
@@ -0,0 +1,13 @@
+ name: "index() method for string";
+ if (s.index("H")==s.index("Hel") and s.index("H")==0 and s.index("d")==10) {
+ return true;
+ }
+ return false;
@@ -0,0 +1,9 @@
+ name: "index() method for string - error";
+ error: RUNTIME;
+ return s.index(2)
+ name: "index() method for string - not found";
+ return s.index("qwerty") == null
+ name: "Loadat an index for string";
+ if (s[6] == s[-5] and s[6] == "W") {
+ return true
+ return false
+ name: "Loadat an index for string - error";
+ return s[11]
@@ -0,0 +1,12 @@
+ name: "storeat an index for string";
+ result: "Hzllqwertyd";
+ var s = "Hello World";
+ s[1] = "z";
+ s[-7] = "qwerty"
+ return s;
+ name: "storeat an index for string - error";
+ s[11] = "z";
+ name: "string_repeat() method for string";
+ var b = s.string_repeat(3) == "Hello WorldHello WorldHello World"
+ var c = s.string_repeat(1) == s
+ return b && c
+ name: "string_repeat() method for string - error";
+ return s.string_repeat(0)
+ name: "upper() and lower methods for string";
+ var u = s.upper() == "HELLO WORLD"
+ var l = s.lower() == "hello world"
+ return u && l