-XBT_TEST_SUITE("xbt_strbuff","String Buffers");
-XBT_TEST_UNIT("xbt_strbuff_substitute",test_strbuff_substitute, "test the function xbt_strbuff_substitute") {
- xbt_test_add0("Empty");mytest("", "", "");
-
- xbt_test_add0("Value shorter, no braces, only variable");mytest("$tutu", "tutu=t", "t");
- xbt_test_add0("Value shorter, braces, only variable");mytest("${tutu}", "tutu=t", "t");
- xbt_test_add0("Value shorter, no braces, data after");mytest("$tutu toto", "tutu=t", "t toto");
- xbt_test_add0("Value shorter, braces, data after");mytest("${tutu} toto", "tutu=t", "t toto");
- xbt_test_add0("Value shorter, no braces, data before");mytest("toto $tutu", "tutu=t", "toto t");
- xbt_test_add0("Value shorter, braces, data before");mytest("toto ${tutu}", "tutu=t", "toto t");
- xbt_test_add0("Value shorter, no braces, data before and after");mytest("toto $tutu tata", "tutu=t", "toto t tata");
- xbt_test_add0("Value shorter, braces, data before and after");mytest("toto ${tutu} tata", "tutu=t", "toto t tata");
-
- xbt_test_add0("Value as long, no braces, only variable");mytest("$tutu", "tutu=12345", "12345");
- xbt_test_add0("Value as long, braces, only variable");mytest("${tutu}", "tutu=1234567", "1234567");
- xbt_test_add0("Value as long, no braces, data after");mytest("$tutu toto", "tutu=12345", "12345 toto");
- xbt_test_add0("Value as long, braces, data after");mytest("${tutu} toto", "tutu=1234567", "1234567 toto");
- xbt_test_add0("Value as long, no braces, data before");mytest("toto $tutu", "tutu=12345", "toto 12345");
- xbt_test_add0("Value as long, braces, data before");mytest("toto ${tutu}", "tutu=1234567", "toto 1234567");
- xbt_test_add0("Value as long, no braces, data before and after");mytest("toto $tutu tata", "tutu=12345", "toto 12345 tata");
- xbt_test_add0("Value as long, braces, data before and after");mytest("toto ${tutu} tata", "tutu=1234567", "toto 1234567 tata");
-
- xbt_test_add0("Value longer, no braces, only variable");mytest("$t", "t=tututu", "tututu");
- xbt_test_add0("Value longer, braces, only variable");mytest("${t}", "t=tututu", "tututu");
- xbt_test_add0("Value longer, no braces, data after");mytest("$t toto", "t=tututu", "tututu toto");
- xbt_test_add0("Value longer, braces, data after");mytest("${t} toto", "t=tututu", "tututu toto");
- xbt_test_add0("Value longer, no braces, data before");mytest("toto $t", "t=tututu", "toto tututu");
- xbt_test_add0("Value longer, braces, data before");mytest("toto ${t}", "t=tututu", "toto tututu");
- xbt_test_add0("Value longer, no braces, data before and after");mytest("toto $t tata", "t=tututu", "toto tututu tata");
- xbt_test_add0("Value longer, braces, data before and after");mytest("toto ${t} tata", "t=tututu", "toto tututu tata");
-
- xbt_test_add0("Value much longer, no braces, only variable");mytest("$t", "t=" force_resize, force_resize);
- xbt_test_add0("Value much longer, no braces, data after");mytest("$t toto", "t=" force_resize, force_resize " toto");
- xbt_test_add0("Value much longer, braces, data after");mytest("${t} toto", "t=" force_resize, force_resize " toto");
- xbt_test_add0("Value much longer, no braces, data before");mytest("toto $t", "t=" force_resize, "toto " force_resize);
- xbt_test_add0("Value much longer, braces, data before");mytest("toto ${t}", "t=" force_resize, "toto " force_resize);
- xbt_test_add0("Value much longer, no braces, data before and after");mytest("toto $t tata", "t=" force_resize, "toto " force_resize " tata");
- xbt_test_add0("Value much longer, braces, data before and after");mytest("toto ${t} tata", "t=" force_resize, "toto " force_resize " tata");
-
- xbt_test_add0("Escaped $");mytest("\\$tutu", "tutu=t", "\\$tutu");
- xbt_test_add0("Space in var name (with braces)");mytest("${tu ti}", "tu_ti=t", "t");
-
- xbt_test_add0("Two variables");mytest("$toto $tutu","toto=1 tutu=2", "1 2");
+XBT_TEST_SUITE("xbt_strbuff", "String Buffers");
+XBT_TEST_UNIT("xbt_strbuff_substitute", test_strbuff_substitute, "test the function xbt_strbuff_substitute")
+{
+ xbt_test_add("Empty");
+ mytest("", "", "");
+
+ xbt_test_add("Value shorter, no braces, only variable");
+ mytest("$tutu", "tutu=t", "t");
+ xbt_test_add("Value shorter, braces, only variable");
+ mytest("${tutu}", "tutu=t", "t");
+ xbt_test_add("Value shorter, no braces, data after");
+ mytest("$tutu toto", "tutu=t", "t toto");
+ xbt_test_add("Value shorter, braces, data after");
+ mytest("${tutu} toto", "tutu=t", "t toto");
+ xbt_test_add("Value shorter, no braces, data before");
+ mytest("toto $tutu", "tutu=t", "toto t");
+ xbt_test_add("Value shorter, braces, data before");
+ mytest("toto ${tutu}", "tutu=t", "toto t");
+ xbt_test_add("Value shorter, no braces, data before and after");
+ mytest("toto $tutu tata", "tutu=t", "toto t tata");
+ xbt_test_add("Value shorter, braces, data before and after");
+ mytest("toto ${tutu} tata", "tutu=t", "toto t tata");
+
+ xbt_test_add("Value as long, no braces, only variable");
+ mytest("$tutu", "tutu=12345", "12345");
+ xbt_test_add("Value as long, braces, only variable");
+ mytest("${tutu}", "tutu=1234567", "1234567");
+ xbt_test_add("Value as long, no braces, data after");
+ mytest("$tutu toto", "tutu=12345", "12345 toto");
+ xbt_test_add("Value as long, braces, data after");
+ mytest("${tutu} toto", "tutu=1234567", "1234567 toto");
+ xbt_test_add("Value as long, no braces, data before");
+ mytest("toto $tutu", "tutu=12345", "toto 12345");
+ xbt_test_add("Value as long, braces, data before");
+ mytest("toto ${tutu}", "tutu=1234567", "toto 1234567");
+ xbt_test_add("Value as long, no braces, data before and after");
+ mytest("toto $tutu tata", "tutu=12345", "toto 12345 tata");
+ xbt_test_add("Value as long, braces, data before and after");
+ mytest("toto ${tutu} tata", "tutu=1234567", "toto 1234567 tata");
+
+ xbt_test_add("Value longer, no braces, only variable");
+ mytest("$t", "t=tututu", "tututu");
+ xbt_test_add("Value longer, braces, only variable");
+ mytest("${t}", "t=tututu", "tututu");
+ xbt_test_add("Value longer, no braces, data after");
+ mytest("$t toto", "t=tututu", "tututu toto");
+ xbt_test_add("Value longer, braces, data after");
+ mytest("${t} toto", "t=tututu", "tututu toto");
+ xbt_test_add("Value longer, no braces, data before");
+ mytest("toto $t", "t=tututu", "toto tututu");
+ xbt_test_add("Value longer, braces, data before");
+ mytest("toto ${t}", "t=tututu", "toto tututu");
+ xbt_test_add("Value longer, no braces, data before and after");
+ mytest("toto $t tata", "t=tututu", "toto tututu tata");
+ xbt_test_add("Value longer, braces, data before and after");
+ mytest("toto ${t} tata", "t=tututu", "toto tututu tata");
+
+ xbt_test_add("Value much longer, no braces, only variable");
+ mytest("$t", "t=" force_resize, force_resize);
+ xbt_test_add("Value much longer, no braces, data after");
+ mytest("$t toto", "t=" force_resize, force_resize " toto");
+ xbt_test_add("Value much longer, braces, data after");
+ mytest("${t} toto", "t=" force_resize, force_resize " toto");
+ xbt_test_add("Value much longer, no braces, data before");
+ mytest("toto $t", "t=" force_resize, "toto " force_resize);
+ xbt_test_add("Value much longer, braces, data before");
+ mytest("toto ${t}", "t=" force_resize, "toto " force_resize);
+ xbt_test_add("Value much longer, no braces, data before and after");
+ mytest("toto $t tata", "t=" force_resize, "toto " force_resize " tata");
+ xbt_test_add("Value much longer, braces, data before and after");
+ mytest("toto ${t} tata", "t=" force_resize,
+ "toto " force_resize " tata");
+
+ xbt_test_add("Escaped $");
+ mytest("\\$tutu", "tutu=t", "\\$tutu");
+ xbt_test_add("Space in var name (with braces)");
+ mytest("${tu ti}", "tu_ti=t", "t");
+
+ xbt_test_add("Two variables");
+ mytest("$toto $tutu", "toto=1 tutu=2", "1 2");