]> git.mxchange.org Git - simgear.git/blobdiff - simgear/misc/strutils_test.cxx
HTTP: Rename urlretrieve/urlload to save/load.
[simgear.git] / simgear / misc / strutils_test.cxx
index 8369f4ea76be36442cdc9d298d4f870a6f7a07e9..baba43ca30cde4437eb02e40d01660979effc0c4 100644 (file)
@@ -63,6 +63,22 @@ int main (int ac, char ** av)
 // since we compare numerically, leasing zeros shouldn't matter
     VERIFY(compare_versions("0.06.7", "0.6.07") == 0);
     
+    string_list la = split("zero one two three four five");
+    COMPARE(la[2], "two");
+    COMPARE(la[5], "five");
+    COMPARE(la.size(), 6);
+    
+    string_list lb = split("alpha:beta:gamma:delta", ":", 2);
+    COMPARE(lb.size(), 3);
+    COMPARE(lb[0], "alpha");
+    COMPARE(lb[1], "beta");
+    COMPARE(lb[2], "gamma:delta");
+    
+    std::string j = join(la, "&");
+    COMPARE(j, "zero&one&two&three&four&five");
+
+    COMPARE(unescape("\\ \\n\\t\\x41\\117a"), " \n\tAOa");
+
     cout << "all tests passed successfully!" << endl;
     return 0;
 }