-
Notifications
You must be signed in to change notification settings - Fork 409
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 <[email protected]>
- Loading branch information
Showing
11 changed files
with
135 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
open Stdune | ||
module Jsoo_rules = Dune_rules.Jsoo_rules | ||
|
||
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 {| > |}]; | ||
() |