@hyperionbt/helios
Advanced tools
Comparing version 0.13.19 to 0.13.20
{ | ||
"name": "@hyperionbt/helios", | ||
"type": "module", | ||
"version": "0.13.19", | ||
"version": "0.13.20", | ||
"description": "Helios is a Domain Specific Language that compiles to Plutus-Core (i.e. Cardano on-chain validator scripts). Helios is a non-Haskell alternative to Plutus. With this library you can compile Helios scripts and build Cardano transactions, all you need to build 100% client-side dApps for Cardano.", | ||
@@ -6,0 +6,0 @@ "main": "helios.js", |
@@ -921,2 +921,77 @@ #!/usr/bin/env node | ||
// error expr tests | ||
async function test24() { | ||
await testTrue(`testing if_error | ||
func main() -> Bool { | ||
if (false) { | ||
error("never called") | ||
}; | ||
true | ||
} | ||
`); | ||
await testError(`testing if_error | ||
func main() -> Bool { | ||
if (false) { | ||
error("never called") | ||
} else { | ||
error("error") | ||
}; | ||
true | ||
} | ||
`, "error"); | ||
await testTrue(`testing switch_error | ||
func main() -> Bool { | ||
opt: Option[Int] = Option[Int]::Some{10}; | ||
opt.switch{ | ||
None => error("unexpected") | ||
}; | ||
true | ||
}`); | ||
await testTrue(`testing multi_value_if_error | ||
func multiv() -> (Int, Int) { | ||
if (true) { | ||
(1, 2) | ||
} else { | ||
error("unexpected") | ||
} | ||
} | ||
func main() -> Bool { | ||
(a: Int, _) = multiv(); | ||
a == 1 | ||
}`) | ||
await testError(`testing multi_value_if_error | ||
func multiv() -> (Int, Int) { | ||
if (true) { | ||
(1, 2) | ||
} else { | ||
(error("unexpected"), error("unexpected")) | ||
} | ||
} | ||
func main() -> Bool { | ||
(a: Int, _) = multiv(); | ||
a == 1 | ||
}`, "unexpected error call"); | ||
await testError(`testing deadcode | ||
func main() -> Bool { | ||
error("error"); | ||
true | ||
}`, "unreachable code"); | ||
} | ||
export default async function main() { | ||
@@ -968,4 +1043,6 @@ await test1(); | ||
await test23(); | ||
await test24(); | ||
} | ||
runIfEntryPoint(main, "syntax.js"); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4884091
92963