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 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.