SQLite Forum

The lemon parser test failed
Login

The lemon parser test failed

(1) By Alexey Ismagilov (ismagilov) on 2024-05-05 01:33:57 [source]

Hello everyone!

I ran the lemon parser test suite and found a few problems,
the main one of which is that not all tests pass.

=== Version of SQLite3 ===
I have got source code from the repo https://github.com/sqlite/sqlite.
Tested on:
Commit: c52c00f67095b4ca7c21b2215e607c5119cecb24
Author: dan <Dan Kennedy>
Date:   2024.05.04 16:50:47

=== Steps to reproduce ===
Assume that SRC is the path to the SQLite3 source code
1. Copy required files:
    cp SRC/tool/lemon.c SRC/tool/lempar.c SRC/test/lemon-test01.y .
2. Compile lemon:
    cc lemon.c -o lemon
3. Generate test code:
    ./lemon lemon-test01.y
4. Compile tests:
    cc lemon-test01.c -o lemon-test01
5. Run tests:
    ./lemon-test01

=== Compile problems ===
The `testCase` function should return `void`, not `int`, see lemon-test01.y:31.

=== Runtime problems ===
Running the `lemon-test01` executable gives the following output:
>>> begin <<<
test 100: ok
test 110: ok
test 120: ok
test 200: ok
test 210: got 0, expected 1
test 220: got 3, expected 0
test 200: ok
test 210: ok
test 220: got 2, expected 0
3 errors out 9 tests
>>> end <<<

I don't clearly understand the test suite, thus I don't know where an error:
in the lemon or in the test suite.

=== Other problems ===
I think third part of the test suite should has 3XX numbers, not 2XX.

(2) By Stephan Beal (stephan) on 2024-05-07 13:26:57 in reply to 1 [link] [source]

I ran the lemon parser test suite and found a few problems,

This was fixed via a documentation update: src:9bdf73a8d4a3b4a7

That test file is obsolete, retained only for reference.