forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#104944 - aDotInTheVoid:jsondoclint-unit-tes…
…ts, r=jyn514 Support unit tests for jsondoclint r? ```@ghost```
- Loading branch information
Showing
5 changed files
with
70 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use super::*; | ||
|
||
#[test] | ||
fn basic_find() { | ||
use SelectorPart::*; | ||
|
||
let j = serde_json::json!({ | ||
"index": { | ||
"4": { | ||
"inner": { | ||
"items": ["1", "2", "3"] | ||
} | ||
} | ||
} | ||
}); | ||
|
||
let sel = find_selector(&j, &serde_json::json!("1")); | ||
let exp: Vec<Vec<SelectorPart>> = vec![vec![ | ||
Field("index".to_owned()), | ||
Field("4".to_owned()), | ||
Field("inner".to_owned()), | ||
Field("items".to_owned()), | ||
Index(0), | ||
]]; | ||
|
||
assert_eq!(exp, sel); | ||
} |
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