Перейти к содержимому
Топаз6.0 · До релиза
Загрузка →

Поиск в документации

Спецификация 6.0

Выберите результат стрелками и нажмите Enter, чтобы открыть его.

Введите имя API, номер диагностики, правило или тему проекта.

    Диагностика TPZ4007

    A std.test assertion evaluated to failure.

    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.

    Действия

    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 != expected 2

    std.test.assertEq compares its two values. Equal integer arguments complete successfully; unequal integer arguments fail at runtime with TPZ4007 at the assertion call.

    Правилоdiagnostics.tpz4007.p5.rule

    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

    Ссылка
    example.tpzRejected program
    1. import std.test as Test
    2. Test.assertEq(1, 2)
    Ожидаемый выводНенулевой код завершения
    Нет стандартного вывода.
    $ topaz run example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Этап отклонения run. Ненулевой код завершения.

    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

    Ссылка
    example.tpzRepaired program
    1. import std.test as Test
    2. Test.assertEq(1, 1)
    Ожидаемый выводКод завершения 0
    Нет стандартного вывода.
    $ topaz run example.tpz · Целевой продукт 5.21.3
    Ожидаемый результат

    Ожидаемый результат

    Выполнение завершается. Код завершения 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.

    Меню

    Загрузка →