From 3f273bb0b10eb2eb5dc57ab8b7bdeae051d2bf20 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Thu, 25 Sep 2008 00:07:35 +0200 Subject: [PATCH] move the configitem tests to the lowlevel suite --- tests/20config_lowlevel.tests | 62 +++++++++++++++++++++++++++++++++ tests/22config_highlevel.tests | 63 ---------------------------------- 2 files changed, 62 insertions(+), 63 deletions(-) diff --git a/tests/20config_lowlevel.tests b/tests/20config_lowlevel.tests index 1bebedcbc..795ed11d8 100644 --- a/tests/20config_lowlevel.tests +++ b/tests/20config_lowlevel.tests @@ -21,6 +21,68 @@ out: delim = '=' out: value = ' baz' END +TEST "create configitem with empty line" configitem_simple_ctor_dtor '' <line = ' #comment bla' +END + +TEST "check content of configitem with section" configitem_simple_content_check $'[ key.foo suffix.bar ] ' << END +out: item->line = '[ key.foo suffix.bar ] ' +out: item->key_size = '7' +out: item->key = 'key.foo suffix.bar ] ' +out: item->delim = ' suffix.bar ] ' +END + +TEST "check content of configitem with directive (without argument)" configitem_simple_content_check $'\t @directive ' << END +out: item->line = ' @directive ' +out: item->key_size = '9' +out: item->key = '@directive ' +END + +TEST "check content of configitem with directive (with argument)" configitem_simple_content_check $'\t @directive \targument' << END +out: item->line = ' @directive argument' +out: item->key_size = '9' +out: item->key = '@directive argument' +out: item->delim = ' argument' +END + +TEST "check content of configitem with configentry" configitem_simple_content_check $' \t\t key.foo \t\t=\tbar' << END +out: item->line = ' key.foo = bar' +out: item->key_size = '7' +out: item->key = 'key.foo = bar' +out: item->delim = '= bar' +END + +TEST "check content of configitem with configentry (redirect)" configitem_simple_content_check $' \t\t key.foo \t\t<\tkey.bar' << END +out: item->line = ' key.foo < key.bar' +out: item->key_size = '7' +out: item->key = 'key.foo < key.bar' +out: item->delim = '< key.bar' +END + TEST "set a config and retrieve it" basic_set_get 'foo' '=bar' <line = ' #comment bla' -END - -TEST "check content of configitem with section" configitem_simple_content_check $'[ key.foo suffix.bar ] ' << END -out: item->line = '[ key.foo suffix.bar ] ' -out: item->key_size = '7' -out: item->key = 'key.foo suffix.bar ] ' -out: item->delim = ' suffix.bar ] ' -END - -TEST "check content of configitem with directive (without argument)" configitem_simple_content_check $'\t @directive ' << END -out: item->line = ' @directive ' -out: item->key_size = '9' -out: item->key = '@directive ' -END - -TEST "check content of configitem with directive (with argument)" configitem_simple_content_check $'\t @directive \targument' << END -out: item->line = ' @directive argument' -out: item->key_size = '9' -out: item->key = '@directive argument' -out: item->delim = ' argument' -END - -TEST "check content of configitem with configentry" configitem_simple_content_check $' \t\t key.foo \t\t=\tbar' << END -out: item->line = ' key.foo = bar' -out: item->key_size = '7' -out: item->key = 'key.foo = bar' -out: item->delim = '= bar' -END - -TEST "check content of configitem with configentry (redirect)" configitem_simple_content_check $' \t\t key.foo \t\t<\tkey.bar' << END -out: item->line = ' key.foo < key.bar' -out: item->key_size = '7' -out: item->key = 'key.foo < key.bar' -out: item->delim = '< key.bar' -END - - TEST "wordlist get item from empty list should fail" wordlist_get_nth 'foo.bar' '' 0 << END out: 'NULL' END