-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow tests for comparison checks
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test.yaml:16:17: "string" value cannot be compared to "{}" value with "==" operator [expression] | ||
test.yaml:18:17: "number" value cannot be compared to "array<bool>" value with "!=" operator [expression] | ||
test.yaml:20:17: "array<bool>" value cannot be compared to "array<{}>" value with "==" operator [expression] | ||
test.yaml:22:17: "number" value cannot be compared to "null" value with ">" operator [expression] | ||
test.yaml:24:17: "bool" value cannot be compared to "bool" value with "<" operator [expression] | ||
test.yaml:26:17: "string" value cannot be compared to "{}" value with ">=" operator [expression] | ||
test.yaml:28:17: "bool" value cannot be compared to "array<bool>" value with "<=" operator [expression] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
o: | ||
- {} | ||
a: | ||
- [true] | ||
a2: | ||
- [{}] | ||
steps: | ||
- run: echo 'comparing == to object with implicit conversion is not allowed' | ||
if: ${{ 'foo' == matrix.o }} | ||
- run: echo 'comparing != to array with implicit conversion is not allowed' | ||
if: ${{ 42 != matrix.a }} | ||
- run: echo 'comparing == array and incompatible array is not allowed' | ||
if: ${{ matrix.a == matrix.a2 }} | ||
- run: echo 'comparing > to null is not allowed' | ||
if: ${{ 1 > null }} | ||
- run: echo 'comparing > to bool is not allowed' | ||
if: ${{ false < true }} | ||
- run: echo 'comparing >= to object is not allowed' | ||
if: ${{ 'foo' >= matrix.o }} | ||
- run: echo 'comparing <= to array is not allowed' | ||
if: ${{ false <= matrix.a }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
on: push | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
o: | ||
- {} | ||
a: | ||
- [true] | ||
steps: | ||
- run: echo 'string is converted to number implicitly' | ||
if: ${{ '42' == 42 }} | ||
- run: echo 'bool is converted to number implicitly' | ||
if: ${{ true == 1 }} | ||
- run: echo 'null is converted to number implicitly' | ||
if: ${{ null == 0 }} | ||
- run: echo 'string and bool implicit conversions are allowed though it is problematic' | ||
if: ${{ '1' == true }} | ||
- run: echo 'string and null implicit conversions are allowed though it is problematic' | ||
if: ${{ '0' == null }} | ||
- run: echo 'comparing null to any value is allowed' | ||
if: ${{ null == matrix.o }} | ||
- run: echo 'comparing object to object is allowed' | ||
if: ${{ matrix.o == matrix.o }} | ||
- run: echo 'comparing object to object is allowed' | ||
if: ${{ matrix.a == matrix.a }} | ||
- run: echo 'string is converted to number implicitly on <' | ||
if: ${{ '41' < 42 }} |