-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com> Jsoo check jsoo version before adding --linkall Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com> Jsoo: update tests Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com> Jsoo: do not inspect Command.Args.t Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com> Changes Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com> Jsoo: refactor version module, add expect tests Signed-off-by: Hugo Heuzard <hugo.heuzard@gmail.com>
- Loading branch information
Showing
16 changed files
with
170 additions
and
46 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
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
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,50 @@ | ||
open Stdune | ||
open Dune_rules | ||
open! Dune_engine | ||
open! Dune_tests_common | ||
|
||
let%expect_test _ = | ||
let test s l = | ||
match Jsoo_rules.Version.of_string s with | ||
| None -> print_endline "Could not parse version" | ||
| Some version -> | ||
let c = Jsoo_rules.Version.compare version l in | ||
let r = | ||
match c with | ||
| Eq -> "=" | ||
| Lt -> "<" | ||
| Gt -> ">" | ||
in | ||
print_endline r | ||
in | ||
(* equal *) | ||
test "5.0.1" (5, 0); | ||
[%expect {| = |}]; | ||
test "5.0.0" (5, 0); | ||
[%expect {| = |}]; | ||
test "5.0" (5, 0); | ||
[%expect {| = |}]; | ||
test "5" (5, 0); | ||
[%expect {| = |}]; | ||
test "5.0+1" (5, 0); | ||
[%expect {| = |}]; | ||
test "5.0~1" (5, 0); | ||
[%expect {| = |}]; | ||
test "5.0+1" (5, 0); | ||
[%expect {| = |}]; | ||
test "5.0.1+git-5.0.1-14-g904cf100b0" (5, 0); | ||
[%expect {| = |}]; | ||
|
||
test "5.0.1" (5, 1); | ||
[%expect {| < |}]; | ||
test "5.0" (5, 1); | ||
[%expect {| < |}]; | ||
test "5.1.1" (5, 0); | ||
[%expect {| > |}]; | ||
test "5.1" (5, 0); | ||
[%expect {| > |}]; | ||
test "4.0.1" (5, 0); | ||
[%expect {| < |}]; | ||
test "5.0.1" (4, 0); | ||
[%expect {| > |}]; | ||
() |