Skip to content

Commit

Permalink
Merge pull request #190 from na4zagin3/feature/lint
Browse files Browse the repository at this point in the history
Support SATySFi versions with commit suffix
  • Loading branch information
na4zagin3 authored Oct 19, 2020
2 parents a96fc27 + 0f20d4d commit 88bbadd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/satysfi/version.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@ let read_local_packages = function
let extract_version_string =
let re =
let open Re in
let version_char =
alt [
alnum;
char '.';
]
in
seq [
bos;
rep space;
str "SATySFi version";
rep space;
rep graph
rep version_char
|> group;
]
|> compile
Expand All @@ -79,7 +85,7 @@ let%expect_test "extract_version_string: valid: dev" =
extract_version_string " SATySFi version v0.0.5-27-gc841df2\n"
|> printf !"%{sexp: string option}";
[%expect{|
(v0.0.5-27-gc841df2) |}]
(v0.0.5) |}]

let parse_version_output str =
extract_version_string str
Expand All @@ -91,6 +97,12 @@ let%expect_test "parse_version_output: valid: normal" =
[%expect{|
(Satysfi_0_0_5) |}]

let%expect_test "parse_version_output: valid: dev" =
parse_version_output " SATySFi version v0.0.5-27-gc841df2\n"
|> printf !"%{sexp: t option}";
[%expect{|
(Satysfi_0_0_5) |}]

let get_current_version_cmd =
let open Shexp_process in
let open Shexp_process.Infix in
Expand Down

0 comments on commit 88bbadd

Please sign in to comment.