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.
Improve error message on assertion when rules fail to parse
- Loading branch information
Showing
4 changed files
with
24 additions
and
12 deletions.
There are no files selected for viewing
File renamed without changes.
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#![cfg(test)] | ||
|
||
mod binding_imports; | ||
mod binding_rules; | ||
mod bindings_assertions; | ||
mod bindings_imports; | ||
mod bindings_output; | ||
mod bindings_rules; | ||
mod cst_output; | ||
mod doc_examples; | ||
mod trivia; |