1
0
mirror of https://github.com/albfan/bash-ini-parser.git synced 2025-08-09 05:22:44 +03:00

Update variable test.

This commit is contained in:
Pavel Rehak
2018-05-25 19:47:53 +02:00
parent cc2f5542d7
commit 0ce2bee87b
4 changed files with 36 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/build-aux/tap-driver.sh $(top_srcdir)/build-aux/tap-driver.sh
TESTS = t0001-whitespace.sh t0002-invalid.sh t0003-sections.sh t0004-comments.sh t0005-new_var.sh TESTS = t0001-whitespace.sh t0002-invalid.sh t0003-sections.sh t0004-comments.sh t0005-new_var.sh t0006-duplication.sh
EXTRA_DIST = $(TESTS) EXTRA_DIST = $(TESTS)

23
t/t0006-duplication.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
test_description="check duplication"
. setup.sh
DIR_TEST=$SHARNESS_TEST_DIRECTORY/t0006
test_expect_failure "Remove duplication" "
export COVERAGE_NAME=duplication_parser
cp ../.simplecov .
cfg_parser $DIR_TEST/duplication.ini
export COVERAGE_NAME=duplication_section
cfg_section_sec1
var1=bar
export COVERAGE_NAME=duplication_update
cfg_update sec1 var1
export COVERAGE_NAME=duplication_writer
cfg_writer > duplication.out
diff $DIR_TEST/duplication.out.correct duplication.out
"
test_done

6
t/t0006/duplication.ini Normal file
View File

@@ -0,0 +1,6 @@
[sec1]
var1=foo
var2=foo2
[sec2]
var1=foo
var2=foo2

View File

@@ -0,0 +1,6 @@
[sec1]
var1="bar"
var2="foo2"
[sec2]
var1="foo"
var2="foo2"