Elixir basics · Lesson 31 (open contents)
01 · Let the code speak02 · Meet six kinds of values03 · Put values together04 · Build a new list05 · Make the shapes match06 · Choose with case07 · Parse a number safely08 · Unpack &1 and the pipe09 · Put code in a project10 · Ask precise true-or-false questions11 · Read and update nested data12 · Count visible text and bytes13 · Let function clauses choose14 · Solve a list twice15 · Choose the smallest clear control form16 · Give domain data a shape17 · Put one tested module in Mix18 · Make success and failure predictable19 · Read and write one real file20 · Take only the data you need21 · Give different data one shared action22 · Write a callback contract23 · Write down the data contract24 · Test behavior and boundaries25 · Turn a project into a command26 · Write the project promise27 · Parse one real line28 · Keep the public API small29 · Make the promise executable30 · Package the edge and leave clues31 · Prove the project is done
ELIXIR · PROJECT · LESSON 3135 minutes

Prove the project is done

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

01 · Start with the whole example

Run this first

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

Elixir
# 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)
Check the result first
  • The acceptance result is true when all three promises still hold.
02 · Take the code apart

Read from the first line down

  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.
03 · Meet the new symbols

Symbols are not secret signs

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.

04 · Ideas inside the code

Match each name to its meaning

01

acceptance matrix

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

02

regression

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

03

release checklist

A short checklist verifies tests, documentation, packaging, and known limits.

05 · Make the idea clear

Why these forms are useful

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.

06 · Change it yourself

Close the answer and try

Add the WARN hot case to the matrix.

Practice starting point
{"WARN hot", ____}

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

Stuck? Read one hint

Copy the result shape from the brief.

After you run it, see one answer
One answer
{"WARN hot", {:ok, {:warn, "hot"}}}
Think about it: Is a green acceptance matrix enough by itself?

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

Take with you

Remember these three lines

  1. 1

    Finish against the original promises.

  2. 2

    Keep regressions executable.

  3. 3

    Ship with a small, repeatable checklist.

Lesson completeRun the code once, then mark this lesson as done.