← Back to lesson 32: Prove the project is done

Prove the project is done: full examples and further reading

The original lesson material is preserved here for reference. The main notebook focuses on this lesson's core question.

The original English project below is a log cleaner. The current notebooks use the same file-statistics project as the Chinese route. These preserved examples show another application of the concepts; their inputs and expected outputs belong to the log cleaner.

Run the acceptance matrix, then finish with a short release checklist.

Execute every original example and produce a simple pass/fail report.

Run this first

Run it once, change one input, and compare the new result.

Original full example
# Run every promise through the public parser
cases = [
  {"INFO ready", {:ok, {:info, "ready"}}},
  {"", :skip},
  {"BROKEN", {:error, :invalid_line}}
]

Enum.all?(cases, fn {input, expected} -> Cleaner.parse_line(input) == expected end)

The acceptance result is true when all three promises still hold.

Steps for the full example

  1. Read Enum.all?/2: Confirm that every acceptance case passes.
  2. Read mix test: Run the complete regression suite.
  3. Read $?: In a shell, inspect whether the command exited successfully.

Original lesson notes

Run the example first. Predict one result, then change one input and run it again.

A matrix runs the agreed inputs through the public API and compares exact outputs.

A regression is old behavior that breaks after a later change.

Symbols and terms
Enum.all?/2
Confirm that every acceptance case passes.
mix test
Run the complete regression suite.
$?
In a shell, inspect whether the command exited successfully.
acceptance matrix
A matrix runs the agreed inputs through the public API and compares exact outputs.
regression
A regression is old behavior that breaks after a later change.
release checklist
A short checklist verifies tests, documentation, packaging, and known limits.

Original full exercise

Add the WARN hot case to the matrix.

Exercise starter
{"WARN hot", ____}

Use {:ok, {:warn, "hot"}}.

Show hint

Copy the result shape from the brief.

Show original answer
Reference answer
{"WARN hot", {:ok, {:warn, "hot"}}}
Is a green acceptance matrix enough by itself?

No. Also run unit tests, check docs, build the command, and record known limits.

Original lesson takeaways
Design trade-offs and language comparisons
Original course references