Skip to content

Commit 92876f9

Browse files
committed
LRS-30 for 2.0.0+, version is JUST 2.0.0
1 parent 9a13ae6 commit 92876f9

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

src/xapi_schema/spec.cljc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@
288288
(s/with-gen
289289
(s/and string?
290290
(partial re-matches xAPIVersionRegEx))
291-
#(sgen/fmap (fn [i]
292-
(#?(:clj format
293-
:cljs gstring/format) "1.0.%d" i))
294-
(sgen/int))))
291+
#(sgen/return "2.0.0")))
295292

296293
(s/def ::sha2
297294
(s/with-gen

src/xapi_schema/spec/regex.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
(def xAPIVersionRegEx
149149
(let [suf-part "[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*"
150150
suffix (str "(\\.[0-9]+(?:-" suf-part ")?(?:\\+" suf-part ")?)?")
151-
ver-str (str "^[1-2]\\.0" suffix "$")]
151+
ver-str (str "^(1\\.0" suffix ")|(2\\.0\\.0)$")]
152152
(re-pattern ver-str)))
153153

154154
(def Base64RegEx

test/xapi_schema/spec/regex_test.cljc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,9 @@
151151
(re-matches xAPIVersionRegEx "1.0")
152152
(re-matches xAPIVersionRegEx "1.0.32-abc.def+ghi.jkl")))
153153
(is (not (re-matches xAPIVersionRegEx "0.9.5"))))
154-
(testing "matches xAPI 2.0.x versions"
154+
(testing "matches xAPI 2.0.0 version only"
155155
(is (and (re-matches xAPIVersionRegEx "2.0.0")
156-
(re-matches xAPIVersionRegEx "2.0.2")
157-
(re-matches xAPIVersionRegEx "2.0")
158-
(re-matches xAPIVersionRegEx "2.0.32-abc.def+ghi.jkl")))))
156+
(not (re-matches xAPIVersionRegEx "2.0.2"))))))
159157

160158
(deftest duration-regex-test
161159
(testing "matches ISO durations"

0 commit comments

Comments
 (0)