From 7aad409f8623ea8f881bef1020641cb87b800950 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 9 Jul 2009 17:37:46 -0600 Subject: test nested expansions --- tests/test-expand.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/test-expand.c b/tests/test-expand.c index 72aef23..dcbe7e3 100644 --- a/tests/test-expand.c +++ b/tests/test-expand.c @@ -195,6 +195,16 @@ test_escape_expansion (void) { g_assert_cmpstr(expand("\\@<\"hi\">\\@", 0, FALSE), ==, "@<\"hi\">@"); } +void +test_nested (void) { + uzbl.gui.sbar.msg = "xxx"; + g_assert_cmpstr(expand("@<\"..@MSG..\">@", 0, FALSE), ==, "..xxx.."); + g_assert_cmpstr(expand("@<\"..\\@MSG..\">@", 0, FALSE), ==, "..@MSG.."); + + g_assert_cmpstr(expand("@(echo ..@MSG..)@", 0, FALSE), ==, "..xxx.."); + g_assert_cmpstr(expand("@(echo ..\\@MSG..)@", 0, FALSE), ==, "..@MSG.."); +} + int main (int argc, char *argv[]) { g_type_init(); @@ -218,6 +228,7 @@ main (int argc, char *argv[]) { g_test_add_func("/test-expand/escape_markup", test_escape_markup); g_test_add_func("/test-expand/escape_expansion", test_escape_expansion); + g_test_add_func("/test-expand/nested", test_nested); initialize(argc, argv); -- cgit v1.2.3