move the configitem tests to the lowlevel suite

This commit is contained in:
Christian Thaeter 2008-09-25 00:07:35 +02:00
parent f754e1521f
commit 3f273bb0b1
2 changed files with 62 additions and 63 deletions

View file

@ -21,6 +21,68 @@ out: delim = '='
out: value = ' baz'
END
TEST "create configitem with empty line" configitem_simple_ctor_dtor '' <<END
END
TEST "create configitem with blank line" configitem_simple_ctor_dtor $' \t \t' <<END
END
TEST "create configitem with comment" configitem_simple_ctor_dtor $' #\t comment bla' <<END
END
TEST "create configitem with section" configitem_simple_ctor_dtor $'\t[prefix suffix ] bla' <<END
END
TEST "create configitem with directive" configitem_simple_ctor_dtor $' @include \t\t file \t' <<END
END
TEST "create configitem with configentry" configitem_simple_ctor_dtor $' key \t=\t value' <<END
END
TEST "create configitem with configentry (redirect)" configitem_simple_ctor_dtor $'keya <\t\t keyb ' <<END
END
TEST "check content of configitem with empty line" configitem_simple_content_check $'' << END
END
TEST "check content of configitem with comment" configitem_simple_content_check $'\t #comment bla' << END
out: item->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' <<END
out: bar

View file

@ -131,69 +131,6 @@ END
PLANNED "bool set" <<END
END
TEST "create configitem with empty line" configitem_simple_ctor_dtor '' <<END
END
TEST "create configitem with blank line" configitem_simple_ctor_dtor $' \t \t' <<END
END
TEST "create configitem with comment" configitem_simple_ctor_dtor $' #\t comment bla' <<END
END
TEST "create configitem with section" configitem_simple_ctor_dtor $'\t[prefix suffix ] bla' <<END
END
TEST "create configitem with directive" configitem_simple_ctor_dtor $' @include \t\t file \t' <<END
END
TEST "create configitem with configentry" configitem_simple_ctor_dtor $' key \t=\t value' <<END
END
TEST "create configitem with configentry (redirect)" configitem_simple_ctor_dtor $'keya <\t\t keyb ' <<END
END
TEST "check content of configitem with empty line" configitem_simple_content_check $'' << END
END
TEST "check content of configitem with comment" configitem_simple_content_check $'\t #comment bla' << END
out: item->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