From b4bf5fa304f374680892174575aa01d7bcc94c1e Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 28 Nov 2011 20:51:56 -0700 Subject: don't segfault when toggling a nonexistent variable --- tests/test-command.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/test-command.c b/tests/test-command.c index b3c3d0c..2d91b64 100644 --- a/tests/test-command.c +++ b/tests/test-command.c @@ -351,6 +351,12 @@ test_toggle_string (void) { // and wrap to the first value when it reaches the end. parse_cmd_line("toggle useragent 'x' 'y'", NULL); g_assert_cmpstr("x", ==, uzbl.net.useragent); + + // user-defined variables can be toggled too. + parse_cmd_line("toggle new_variable 'x' 'y'", NULL); + gchar *value = get_var_value_string("new_variable"); + g_assert_cmpstr("x", ==, value); + g_free(value); } int -- cgit v1.2.3