hyperrealm / libconfig

C/C++ library for processing configuration files
https://hyperrealm.github.io/libconfig/
GNU Lesser General Public License v2.1
1.1k stars 360 forks source link

Test failed in `ParsingAndFormatting` #141

Closed Junzki closed 4 years ago

Junzki commented 5 years ago

In branch master, compiled on ArchLinux (amd64) with GCC 8.2.1 20181127.

Here is output:

-> % make test
cd tests && ./libconfig_tests
[TEST] ParsingAndFormatting
parsing testdata/input_0.cfg
parsing testdata/input_1.cfg
parsing testdata/input_2.cfg
parsing testdata/input_3.cfg
parsing testdata/input_4.cfg
parsing testdata/input_5.cfg
parsing testdata/input_6.cfg
error: syntax error:5
tests.c:50: failed assert: (ok)
[FAIL] ParsingAndFormatting
[TEST] ParseInvalidFiles
[ OK ] ParseInvalidFiles
[TEST] ParseInvalidStrings
[ OK ] ParseInvalidStrings
[TEST] BigInt1
[ OK ] BigInt1
[TEST] BigInt2
[ OK ] BigInt2
[TEST] BigInt3
[ OK ] BigInt3
[TEST] BigInt4
[ OK ] BigInt4
[TEST] BigInt5
[ OK ] BigInt5
[TEST] BigInt6
[ OK ] BigInt6
[TEST] BigInt7
[ OK ] BigInt7
[TEST] RemoveSetting
[ OK ] RemoveSetting
[TEST] EscapedStrings
[ OK ] EscapedStrings
*** FAILURES! ***
12 tests; 11 passed, 1 failed
make: *** [Makefile:875: test] Error 1

And appending an empty new line to testdata/input_6.cfg clears up the problem.

hyperrealm commented 4 years ago

I think this problem has since been fixed; there was a parsing issue when there was no final newline in the input file. The tests all pass for me with the code at head.

Junzki commented 4 years ago

Tests all passed for me now, thank you :)