Skip to the task
Layout
Back to classic view

You are looking ahead. Your place is still task 1: Algorithm.

RUNTask 21 of 21 · step 8: Homework: the receiptRun the homework tests
Run the homework tests in practice/01/

In CLion pick All CTest and ▶, or run only topic 1's tests in the terminal. Fix things until both pass.

Checklist

  • Every task is one commit with a clear message.
Details & hint
$ ctest --preset debug -L hw01
    Start 2: hw01_receipt
1/2 Test #2: hw01_receipt .....................***Failed    0.08 sec

=== hw01_receipt: FAILED ===
The output differs on line 5.
  expected: |Item\tQty\tPrice|
  got:      |Item  Qty  Price|
  (\t = tab, ~ = a space at the end of the line)

You should see: While the receipt is wrong, the test shows the first line that differs, with tabs made visible (\t). Here spaces were typed instead of tabs. When all is well: 100% tests passed.

Stuck? The test compares the output with hw/01/tests/expected.txt: fix the program, not that file.

practice 01 CMakeLists.txt Code Diff
UNCHANGED This step does not change this file.
add_executable(p01_hello main.c)
opened for this task
$ ctest --preset debug -L hw01
    Start 2: hw01_receipt
1/2 Test #2: hw01_receipt .....................***Failed    0.08 sec

=== hw01_receipt: FAILED ===
The output differs on line 5.
  expected: |Item\tQty\tPrice|
  got:      |Item  Qty  Price|
  (\t = tab, ~ = a space at the end of the line)