Mutually contradictory test cases for #HT8 vs #LV1

Hi there,

It seems that there is a mutual contradiction between tests for stages #HT8 and #LV1. Can you please clarify the gap in my understanding?

Here’s the test that fails:

[tester::#HT8] [test-3] Running test case: 3
[tester::#HT8] [test-3] Writing contents to ./test.lox:
[tester::#HT8] [test-3] [test.lox] 23 == 20
[tester::#HT8] [test-3] $ ./your_program.sh parse test.lox
[your_program] (== 23 20)
[tester::#HT8] [test-3] 𐄂 (== 23 20)
[tester::#HT8] [test-3] Expected line #1 on stdout to be "(== 23.0 20.0)", got "(== 23 20)"
[tester::#HT8] [test-3] Test failed

Here’s the test that passes:

[tester::#LV1] Running tests for Stage #LV1 (Evaluating Expressions - Literals: Strings & Numbers)                                                                                                                                                                                
[tester::#LV1] [test-1] Running test case: 1                                                                                                                                                                                                                                      
[tester::#LV1] [test-1] Writing contents to ./test.lox:                                                                                                                                                                                                                           
[tester::#LV1] [test-1] [test.lox] 23                                                                                                                                                                                                                                             
[tester::#LV1] [test-1] $ ./your_program.sh evaluate test.lox                                                                                                                                                                                                                     
[your_program] 23
[tester::#LV1] [test-1] ✓ 1 line(s) match on stdout                                                                                                                                                                                                                               
[tester::#LV1] [test-1] ✓ Received exit code 0.                                                                                                                                                                                                                                   

Thanks,

Hi @jainsau, the difference in how integers are represented between the parser and the evaluator is simply an (arguably inconsistent) design choice made by the author of the Lox language.

Here are the reference tests provided by the author:

Thanks. This is not ideal but your response helps.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.