Skip to the task
Layout
Back to classic view

You are looking at lesson 1. Your place is still lesson 4, task 1: Style.

RUNTask 21 of 21 · step 8: Homework: the receipt

Run the homework tests

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

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)