E81010: invalid placeholder syntax in expected output
What went wrong
An expected output file contains an invalid placeholder syntax. Placeholders use EK9 type names in double braces: {{TypeName}}
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 208 (How do I test output containing dynamic values like dates...)
- ek9 -q 953 (How do @Test programs work with command-line arguments...)
Valid placeholders
Basic: {{String}}, {{Integer}}, {{Float}}, {{Boolean}}, {{Character}}, {{Bits}} Time: {{Date}}, {{Time}}, {{DateTime}}, {{Duration}}, {{Millisecond}} Other: {{Money}}, {{Colour}}, {{Resolution}}, {{Dimension}}, {{RegEx}}, {{GUID}}
Common typos
{{UUID}} -> {{GUID}}, {{Color}} -> {{Colour}}, {{Int}} -> {{Integer}}
{{datetime}} -> {{DateTime}}, {{Timestamp}} -> {{DateTime}}
{{Long}}/{{Double}} -> {{Integer}}/{{Float}}
Example
expected_output.txt: Test started at: {{DateTime}} Items processed: {{Integer}} Status: OK // Literal - must match exactly
How to fix it
- Use correct EK9 type name (case-sensitive)
- Use {{String}} as catch-all if no specific type fits
- Remove {{ }} for literal text matching
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E81010: invalid placeholder syntax in expected output - reported by the test runner, not the compiler, when ek9 -t greeting.ek9 runs in this project.
bad/greeting.ek9
#!ek9 defines module error.e81010.bad defines function greeting() as pure -> name as String <- result as String: `Hello, ${name}`
bad/dev/tests.ek9
#!ek9 defines module error.e81010.bad.tests references error.e81010.bad::greeting defines program @Test GreetingOnce() stdout <- Stdout() stdout.println(greeting("EK9"))
bad/dev/expected_output.txt
Hello, {{UUID}}
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
1 blackbox (output validated against expected_output.txt)
Executing 1 test...
❌ FAIL error.e81010.bad.tests::GreetingOnce [BlackBox] (nms)
E81010: Invalid placeholder(s) in expected output: UUID
Summary: 0 passed, 1 failed (1 total)
Types: 1 blackbox
Duration: nms
ek9: tests failed (exit 11)
Fixed: The placeholder is the EK9 type String
good/greeting.ek9
#!ek9 defines module error.e81010.good defines function greeting() as pure -> name as String <- result as String: `Hello, ${name}`
good/dev/tests.ek9
#!ek9 defines module error.e81010.good.tests references error.e81010.good::greeting defines program @Test GreetingOnce() stdout <- Stdout() stdout.println(greeting("EK9"))
good/dev/expected_output.txt
Hello, {{String}}
$ ek9 -t greeting.ek9
ℹ️ Found 1 test:
1 blackbox (output validated against expected_output.txt)
Executing 1 test...
✅ PASS error.e81010.good.tests::GreetingOnce [BlackBox] (nms)
Summary: 1 passed, 0 failed (1 total)
Types: 1 blackbox
Duration: nms