mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-03-24 15:55:03 +01:00
feat: implement case function (#16)
Follow GitHub Actions * added unit tests Closes #15 Reviewed-on: https://gitea.com/actions-oss/act-cli/pulls/16 Co-authored-by: ChristopherHX <christopher.homberger@web.de> Co-committed-by: ChristopherHX <christopher.homberger@web.de>
This commit is contained in:
committed by
ChristopherHX
parent
83cbf1f2b8
commit
ee2e0135d5
@@ -97,6 +97,12 @@ func TestEvaluator_Raw(t *testing.T) {
|
||||
{"contains(fromjson('[[3,5],[5,6]]').*[1], 6)", true},
|
||||
{"contains(fromjson('[[3,5],[5,6]]').*[1], 3)", false},
|
||||
{"contains(fromjson('[[3,5],[5,6]]').*[1], '6')", true},
|
||||
{"case(6 == 6, 0, 1)", 0.0},
|
||||
{"case(6 != 6, 0, 1)", 1.0},
|
||||
{"case(6 != 6, 0, 'test')", "test"},
|
||||
{"case(contains(fromjson('[\"ac\"]'), 'a'), 0, 'test')", "test"},
|
||||
{"case(0 == 1, 0, 2 == 2, 1, 0)", 1.0},
|
||||
{"case(0 == 1, 0, 2 != 2, 1, 0)", 0.0},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user