From 6ed878d1b0fa4e29b482249b3fc1580c4b3e473d Mon Sep 17 00:00:00 2001 From: Pavel Rehak Date: Fri, 25 May 2018 21:18:43 +0200 Subject: [PATCH] Unwanted file test. File "2" is created after using cfg_writer. --- t/Makefile.am | 2 +- t/t0007-unwanted_file.sh | 20 ++++++++++++++++++++ t/t0007/file_2.ini | 2 ++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 t/t0007-unwanted_file.sh create mode 100644 t/t0007/file_2.ini diff --git a/t/Makefile.am b/t/Makefile.am index 8722aef..165f303 100644 --- a/t/Makefile.am +++ b/t/Makefile.am @@ -1,4 +1,4 @@ TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/build-aux/tap-driver.sh -TESTS = t0001-whitespace.sh t0002-invalid.sh t0003-sections.sh t0004-comments.sh t0005-new_var.sh t0006-duplication.sh +TESTS = t0001-whitespace.sh t0002-invalid.sh t0003-sections.sh t0004-comments.sh t0005-new_var.sh t0006-duplication.sh t0007-unwanted_file.sh EXTRA_DIST = $(TESTS) diff --git a/t/t0007-unwanted_file.sh b/t/t0007-unwanted_file.sh new file mode 100755 index 0000000..6d8321e --- /dev/null +++ b/t/t0007-unwanted_file.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +test_description="check unwanted file" + +. setup.sh + +DIR_TEST=$SHARNESS_TEST_DIRECTORY/t0007 + +test_expect_success "Unwanted file" " + export COVERAGE_NAME=file_2_parser + cp ../.simplecov . + cfg_parser $DIR_TEST/file_2.ini + cfg_section_sec1 + var1=bar + cfg_update sec1 var1 + cfg_writer > file_2.out + test ! -e 2 +" + +test_done diff --git a/t/t0007/file_2.ini b/t/t0007/file_2.ini new file mode 100644 index 0000000..f30281c --- /dev/null +++ b/t/t0007/file_2.ini @@ -0,0 +1,2 @@ +[sec1] +var1=foo