Diagnostic and cause
СсылкаAssertion failed
- Семейство
- topaz
- Этап
- run
- Код
TPZ4007
Причина и условия
std.test.assertEq compares its two values. Equal integer arguments complete successfully; unequal integer arguments fail at runtime with TPZ4007 at the assertion call.
Связанное правило · Equality assertions require equal values →Действия
Inspect both the program result and the assertion. Correct the program when its result is wrong; change the assertion when its intended expectation is wrong.
Compiler phase: runtime.
Compiler explanation: A std.test assertion evaluated to failure.
Message templates are Pending. The explanation above is not an observed CLI message.
Observed for the candidate in Topaz 5.21.3. Execution
- error[TPZ4007]: assertEq failed: actual
1!= expected2
std.test.assertEq compares its two values. Equal integer arguments complete successfully; unequal integer arguments fail at runtime with TPZ4007 at the assertion call.
Equality assertions require equal values
std.test.assertEq compares its two values. Equal integer arguments complete successfully; unequal integer arguments fail at runtime with TPZ4007 at the assertion call.
Response
СсылкаInspect both the program result and the assertion. Correct the program when its result is wrong; change the assertion when its intended expectation is wrong.
Reproduction and verification
СсылкаRejected program
Ссылкаimport std.test as TestTest.assertEq(1, 2)
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Этап отклонения run. Ненулевой код завершения.
diagnostics-tpz4007 at
example.tpz:2:1
Run the paired runtime product assertions with TOPAZ_BIN set using node docs/topaz-reference/templates/diagnostics-p5-runtime.product.mjs. The shared example observer currently evaluates check diagnostics.
Repaired program
Ссылкаimport std.test as TestTest.assertEq(1, 1)
Нет стандартного вывода.Ожидаемый результат
Ожидаемый результат
Выполнение завершается. Код завершения 0.
Run the paired runtime product assertions with TOPAZ_BIN set using node docs/topaz-reference/templates/diagnostics-p5-runtime.product.mjs. The shared example observer currently evaluates check diagnostics.