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>
48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
# Copyright (c) Microsoft Corporation.
|
|
# Licensed under the MIT License.
|
|
|
|
cases:
|
|
- note: semver.compare passing
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
|
|
vers = [
|
|
"1.9.10",
|
|
"1.8.15"
|
|
]
|
|
|
|
# Compare each version against itself and others.
|
|
r = [ a | a = semver.compare(vers[_], vers[_]) ]
|
|
query: data.test.r
|
|
want_result: [0, 1, -1, 1]
|
|
skip: true # TODO: remove this
|
|
|
|
- note: semver.compare wrong arg1 type
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
a = semver.compare("", 1)
|
|
query: data.test.a
|
|
error: expects string argument
|
|
|
|
- note: semver.compare wrong arg2 type
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
a = semver.compare(1, "")
|
|
query: data.test.a
|
|
error: expects string argument
|
|
|
|
- note: semver extra arg
|
|
data: {}
|
|
modules:
|
|
- |
|
|
package test
|
|
a = semver.compare("", "", "")
|
|
query: data.test.a
|
|
error: expects 2 arguments
|