changeset 3316:6ce62683e8c4 trunk

test nesting
author William Pitcock <nenolod@atheme-project.org>
date Fri, 10 Aug 2007 12:17:02 -0500
parents 848999871ae8
children d18d66f1b1d0
files src/audacious/tuple_formatter.c src/tests/tuple_formatter_test.c
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/tuple_formatter.c	Fri Aug 10 12:10:24 2007 -0500
+++ b/src/audacious/tuple_formatter.c	Fri Aug 10 12:17:02 2007 -0500
@@ -94,7 +94,13 @@
                 if (*iter == ':')
                 {
 		    level++;
-                    sel = argument;
+                    if (sel != argument)
+                    {
+                        sel = argument;
+                        continue;
+                    }
+                    else
+                        g_string_append_c(sel, *iter);
                     continue;
                 }
 
--- a/src/tests/tuple_formatter_test.c	Fri Aug 10 12:10:24 2007 -0500
+++ b/src/tests/tuple_formatter_test.c	Fri Aug 10 12:17:02 2007 -0500
@@ -114,6 +114,14 @@
     }
     g_free(tstr);
 
+    tstr = tuple_formatter_process_string(tuple, "${?splork:${?splork:${splork}} - }${splork}");
+    if (g_ascii_strcasecmp(tstr, "moo - moo"))
+    {
+        g_print("fail 11: '%s'\n", tstr);
+        return EXIT_FAILURE;
+    }
+    g_free(tstr);
+
     mowgli_object_unref(tuple);
 
     return EXIT_SUCCESS;