Files
Alessandro ScandoneandGitHub 5dfc34cd3c feat: feature flag syntax (#120)
* feat: feature flag syntax

* feat: change syntax

* feat: reject invalid features

* feat: add static check of unknown features

* feat: more defensive args handling

* fix: fix typo
2026-03-04 13:32:35 +00:00

3.3 KiB
Executable File

 
[TestShowDiff - 1]
{
"common": "ok",
- "x": 42
+ "x": 100
}
 
---
 
[TestSingleTest - 1]
❯ example.num (2 tests | 1 failed)
× tfailing
✓ tpassing
 
 
FAIL example.num.specs.json > tfailing
 
GOT:
 
| Source | Destination | Asset | Amount |
| world | dest | USD/2 | 100 |
 
 
- Expected
+ Received
 
expect.postings
 
[
{
- "source": "wrong-source",
+ "source": "world",
"destination": "dest",
"amount": 100,
"asset": "USD/2"
}
]
 
 
Test files 1 failed (1)
Tests 1 failed | 1 passed (2)
 
---
 
[TestComplexAssertions - 1]
❯ example.num (2 tests | 1 failed)
× send when there are enough funds
✓ tpassing
 
 
FAIL example.num.specs.json > send when there are enough funds
 
GIVEN:
 
| Account | Asset | Balance |
| alice | USD/2 | 9999 |
 
 
GOT:
 
| Source | Destination | Asset | Amount |
| alice | dest | USD/2 | 100 |
 
 
- Expected
+ Received
 
expect.error.missingFunds
 
- true
+ false
 
expect.endBalances
 
{
"alice": {
- "USD/2": -100
+ "USD/2": 9899
},
"dest": {
- "USD/2": 1
+ "USD/2": 100
}
}
 
expect.movements
 
{
"alice": {
"dest": {
- "EUR": 100
+ "USD/2": 100
}
}
}
 
 
Test files 1 failed (1)
Tests 1 failed | 1 passed (2)
 
---
 
[TestNoFilesErr - 1]
No specs files found
 
---
 
[TestParseErrSpecs - 1]
 
Error: example.num.specs.json
 
invalid character 'o' in literal null (expecting 'u')
 
---
 
[TestSchemaErrSpecs - 1]
 
Error: example.num.specs.json
 
json: cannot unmarshal number into Go struct field Specs.balances of type interpreter.Balances
 
---
 
[TestNumscriptParseErr - 1]
 
Error: example.num:1:1
 
token recognition error at: '!'
 
 
Error: example.num:1:5
 
mismatched input '<EOF>' expecting '('
 
 
0 | !err
| ~~~~
 
---
 
[TestRuntimeErr - 1]
 
Error: example.num:1:29
 
Invalid value received. Expecting value of type account (got ops! instead)
 
 
0 | send [USD/2 100] ( source = "ops!" destination = @world)
| ~~~~~~
 
---
 
[TestFocusUi - 1]
✓ example.num (2 tests | 1 skipped)
 
Test files 1 passed (1)
Tests 1 passed | 1 skipped (2)
 
---