-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from cuihtlauac/add_path
Add `path` function
- Loading branch information
Showing
7 changed files
with
45 additions
and
1 deletion.
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
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 @@ | ||
let path_empty () = | ||
Alcotest.(check (option Testable.yojson)) | ||
__LOC__ (Some Fixtures.json_value) | ||
(Yojson.Safe.Util.path [] Fixtures.json_value) | ||
|
||
let path_missing () = | ||
Alcotest.(check (option Testable.yojson)) | ||
__LOC__ None | ||
(Yojson.Safe.Util.path [ "does not exist" ] Fixtures.json_value) | ||
|
||
let path_traverse () = | ||
Alcotest.(check (option Testable.yojson)) | ||
__LOC__ | ||
(Some (`Int 42)) | ||
(Yojson.Safe.Util.path [ "assoc"; "value" ] Fixtures.json_value) | ||
|
||
let tests = | ||
[ | ||
("empty path", `Quick, path_empty); | ||
("non-existing path", `Quick, path_missing); | ||
("traversal", `Quick, path_traverse); | ||
] |
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 @@ | ||
val tests : unit Alcotest.test_case list |