forked from keep-starknet-strange/shinigami
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler to nullable (keep-starknet-strange#217)
<!-- enter the gh issue after hash --> - [✅] issue keep-starknet-strange#205 - [✅] follows contribution [guide](https://github.com/keep-starknet-strange/shinigami/blob/main/CONTRIBUTING.md) - [✅] code change includes tests <!-- PR description below --> Updated compiler from `opcodes: Felt252Dict<u8>` to `opcodes: Felt252Dict<Nullable<u8>>` Co-authored-by: Brandon Roberts <[email protected]>
- Loading branch information
1 parent
921f3f9
commit b42984e
Showing
5 changed files
with
47 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use crate::compiler::CompilerImpl; | ||
|
||
// TODO: More tests? | ||
|
||
#[test] | ||
fn test_compiler_unknown_opcode() { | ||
let mut compiler = CompilerImpl::new(); | ||
let res = compiler.compile("OP_FAKE"); | ||
assert!(res.is_err()); | ||
assert_eq!(res.unwrap_err(), 'Compiler error: unknown opcode', "Error message mismatch"); | ||
} |