E81002: orphan expected output file (no matching commandline args)

Category: E81xxx-E83xxx Test configuration, execution and coverage · Classification: ORPHAN_EXPECTED_OUTPUT · All error codes

What went wrong

An expected_case_{id}.txt file exists but no matching commandline_arg_{id}.txt. Parameterized tests require both files with matching {id}.

Worked examples

Compilable examples demonstrating this error and the correct fix:

  • ek9 -q 953 (How do @Test programs work with command-line arguments...)

File naming pattern

Each expected_case_{id}.txt pairs with the commandline_arg_{id}.txt of the same {id}. For instance, a dev/ directory holding expected_case_goodbye.txt but no commandline_arg_goodbye.txt is this error.

How to fix it

  1. Create missing file: `touch dev/commandline_arg_{id}.txt` (one arg per line)
  2. Or remove orphan expected file if test isn't needed
  3. Or rename if typo (check -E2 for fuzzy suggestions)

Common causes

  • Deleted commandline file but forgot expected file
  • Case mismatch: 'Test' vs 'test' (same on macOS, different on Linux)

See also

  • E81002: expected file exists, commandline missing (this error)
  • E81001: commandline file exists, expected missing

Examples

Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.

Fails with E81002: orphan expected output file (no matching commandline args) - reported by the test runner, not the compiler, when ek9 -t greeting.ek9 runs in this project.

bad/greeting.ek9

#!ek9
defines module error.e81002.bad

  defines function

    greeting() as pure
      -> name as String
      <- result as String: `Hello, ${name}`

bad/dev/tests.ek9

#!ek9
defines module error.e81002.bad.tests

  references
    error.e81002.bad::greeting

  defines program

    @Test
    GreetingCases()
      -> name as String
      stdout <- Stdout()
      stdout.println(greeting(name))

bad/dev/commandline_arg_simple.txt

EK9

bad/dev/expected_case_other.txt

Hello, World

bad/dev/expected_case_simple.txt

Hello, EK9
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
  1 parameterized (1 cases total)

Executing 1 test...

❌ FAIL error.e81002.bad.tests::GreetingCases [Assert] (nms)
    Test configuration error: missing commandline_arg_other.txt

Summary: 0 passed, 1 failed (1 total)
Types: 1 assert
Duration: nms
ek9: tests failed (exit 11)
E81002: orphan expected output file (no matching commandline args)
  missing commandline_arg_other.txt
  See: ek9 -h E81002

Fixed: The orphan expected_case_other.txt gets its commandline_arg_other.txt

good/greeting.ek9

#!ek9
defines module error.e81002.good

  defines function

    greeting() as pure
      -> name as String
      <- result as String: `Hello, ${name}`

good/dev/tests.ek9

#!ek9
defines module error.e81002.good.tests

  references
    error.e81002.good::greeting

  defines program

    @Test
    GreetingCases()
      -> name as String
      stdout <- Stdout()
      stdout.println(greeting(name))

good/dev/commandline_arg_other.txt

World

good/dev/commandline_arg_simple.txt

EK9

good/dev/expected_case_other.txt

Hello, World

good/dev/expected_case_simple.txt

Hello, EK9
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
  1 parameterized (2 cases total)

Executing 1 test...

✅ PASS error.e81002.good.tests::GreetingCases [Param:other] (nms)
✅ PASS error.e81002.good.tests::GreetingCases [Param:simple] (nms)

Summary: 2 passed, 0 failed (2 results from 1 programs)
Types: 2 parameterized
Duration: nms