forked from NomicFoundation/slang
-
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.
Add test to check that the binding rules for Solidity parse correctly
- Loading branch information
Showing
8 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
6 changes: 5 additions & 1 deletion
6
crates/solidity/outputs/cargo/slang_solidity/src/generated/bindings/mod.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,22 @@ | ||
use std::path::PathBuf; | ||
|
||
use metaslang_graph_builder::ast::File; | ||
use slang_solidity::bindings; | ||
use slang_solidity::cst::KindTypes; | ||
|
||
#[test] | ||
fn test_binding_rules_parse_successfully() { | ||
let binding_rules = bindings::get_binding_rules(); | ||
let graph_builder = File::<KindTypes>::from_str(binding_rules); | ||
|
||
assert!( | ||
graph_builder.is_ok(), | ||
"Parsing binding rules failed:\n{}", | ||
graph_builder | ||
.err() | ||
.map(|err| err | ||
.display_pretty(&PathBuf::from("rules.msgb"), binding_rules) | ||
.to_string()) | ||
.unwrap_or_default() | ||
); | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#![cfg(test)] | ||
|
||
mod binding_rules; | ||
mod cst_output; | ||
mod doc_examples; | ||
mod trivia; |
6 changes: 5 additions & 1 deletion
6
crates/testlang/outputs/cargo/slang_testlang/src/generated/bindings/mod.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.