mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
* Completed semver.is_valid and semver.compare * Addressed PR comments Signed-off-by: Minh Nguyen <luonguyen@microsoft.com> --------- Signed-off-by: Minh Nguyen <luonguyen@microsoft.com> Co-authored-by: Anand Krishnamoorthi <anakrish@microsoft.com>
40 lines
810 B
YAML
40 lines
810 B
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
cases:
|
|
- note: semver.is_valid passing
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
vers = [
|
|
"1.9.10",
|
|
"1.8.15",
|
|
"1.1",
|
|
"1.1.12-rc1+foo"
|
|
]
|
|
|
|
r = [ a | a = semver.is_valid(vers[_]) ]
|
|
query: data.test.r
|
|
want_result: [true, true, false]
|
|
skip: true # TODO: remove this
|
|
|
|
- note: semver.compare wrong arg1 type
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
a = semver.is_valid(1)
|
|
query: data.test.a
|
|
error: expects string argument
|
|
|
|
- note: semver.is_valid extra arg
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
a = semver.is_valid("", "")
|
|
query: data.test.a
|
|
error: expects 1 argument
|