Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(tests) Add full type coverage for > and >= operators #322

Merged
merged 1 commit into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion release-notes/v0.2.0.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [0.2.0] - Unreleased

### Addded
### Added
- Allow assignment from `int` to `double` [[#300][300]]

### Changed
Expand All @@ -16,6 +16,7 @@
- Add full type coverage for `-=` and `+=` operators [[#319][319]]
- Add full type coverage for `==` and `!=` operators [[#320][320]]
- Add full type coverage for `<` and `<=` operators [[#321][321]]
- Add full type coverage for `>` and `>=` operators [[#322][322]]

[300]: https://github.com/perlang-org/perlang/pull/300
[302]: https://github.com/perlang-org/perlang/issues/302
Expand All @@ -25,3 +26,4 @@
[318]: https://github.com/perlang-org/perlang/pull/318
[319]: https://github.com/perlang-org/perlang/pull/319
[321]: https://github.com/perlang-org/perlang/pull/321
[322]: https://github.com/perlang-org/perlang/pull/322
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,49 @@ public static class BinaryOperatorData
new object[] { "2147483647", "33.0", "True" },
new object[] { "12.0", "34.0", "False" },
new object[] { "34.0", "33.0", "True" },

new object[] { "2", "18446744073709551616", "False" },
new object[] { "2", "9223372036854775807", "False" },
new object[] { "4294967296", "9223372036854775807", "False" },
new object[] { "9223372036854775807", "2", "True" },
new object[] { "9223372036854775807", "9223372036854775807", "False" },
new object[] { "9223372036854775807", "18446744073709551616", "False" },
new object[] { "9223372036854775807", "12.0", "True" },
new object[] { "18446744073709551616", "2", "True" },
new object[] { "18446744073709551616", "4294967296", "True" },
new object[] { "18446744073709551616", "9223372036854775807", "True" },
new object[] { "18446744073709551616", "18446744073709551616", "False" },
new object[] { "12.0", "34.0", "False" },
new object[] { "34.0", "33.0", "True" },
};

public static IEnumerable<object[]> Greater_unsupported_types =>
new List<object[]>
{
new object[] { "12.0", "34", "Operands must be numbers, not double and int" },
new object[] { "34.0", "33", "Operands must be numbers, not double and int" },
new object[] { "2", "4294967295", "Operands must be numbers, not int and System.UInt32" },
new object[] { "2", "18446744073709551615", "Operands must be numbers, not int and System.UInt64" },
new object[] { "4294967295", "33", "Operands must be numbers, not System.UInt32 and int" },
new object[] { "33", "4294967295", "Operands must be numbers, not int and System.UInt32" },
new object[] { "4294967295", "4294967295", "Operands must be numbers, not System.UInt32 and System.UInt32" },
new object[] { "4294967295", "9223372036854775807", "Operands must be numbers, not System.UInt32 and long" },
new object[] { "4294967295", "18446744073709551615", "Operands must be numbers, not System.UInt32 and System.UInt64" },
new object[] { "4294967295", "18446744073709551616", "Operands must be numbers, not System.UInt32 and bigint" },
new object[] { "4294967295", "12.0", "Operands must be numbers, not System.UInt32 and double" },
new object[] { "9223372036854775807", "4294967295", "Operands must be numbers, not long and System.UInt32" },
new object[] { "9223372036854775807", "18446744073709551615", "Operands must be numbers, not long and System.UInt64" },
new object[] { "18446744073709551615", "2", "Operands must be numbers, not System.UInt64 and int" },
new object[] { "18446744073709551615", "4294967295", "Operands must be numbers, not System.UInt64 and System.UInt32" },
new object[] { "18446744073709551615", "9223372036854775807", "Operands must be numbers, not System.UInt64 and long" },
new object[] { "18446744073709551615", "18446744073709551615", "Operands must be numbers, not System.UInt64 and System.UInt64" },
new object[] { "18446744073709551615", "18446744073709551616", "Operands must be numbers, not System.UInt64 and bigint" },
new object[] { "18446744073709551615", "12.0", "Operands must be numbers, not System.UInt64 and double" },
new object[] { "18446744073709551616", "4294967295", "Operands must be numbers, not bigint and System.UInt32" },
new object[] { "18446744073709551616", "18446744073709551615", "Operands must be numbers, not bigint and System.UInt64" },
new object[] { "18446744073709551616", "12.0", "Operands must be numbers, not bigint and double" },
new object[] { "-12.0", "-34", "Operands must be numbers, not double and int" },
new object[] { "-12.0", "4294967295", "Operands must be numbers, not double and System.UInt32" },
new object[] { "-12.0", "9223372036854775807", "Operands must be numbers, not double and long" },
new object[] { "-12.0", "18446744073709551615", "Operands must be numbers, not double and System.UInt64" },
new object[] { "-12.0", "18446744073709551616", "Operands must be numbers, not double and bigint" },
};

public static IEnumerable<object[]> GreaterEqual =>
Expand All @@ -49,15 +83,49 @@ public static class BinaryOperatorData
new object[] { "2147483647", "33.0", "True" },
new object[] { "12.0", "34.0", "False" },
new object[] { "34.0", "33.0", "True" },

new object[] { "2", "18446744073709551616", "False" },
new object[] { "2", "9223372036854775807", "False" },
new object[] { "4294967296", "9223372036854775807", "False" },
new object[] { "9223372036854775807", "2", "True" },
new object[] { "9223372036854775807", "9223372036854775807", "True" },
new object[] { "9223372036854775807", "18446744073709551616", "False" },
new object[] { "9223372036854775807", "12.0", "True" },
new object[] { "18446744073709551616", "2", "True" },
new object[] { "18446744073709551616", "4294967296", "True" },
new object[] { "18446744073709551616", "9223372036854775807", "True" },
new object[] { "18446744073709551616", "18446744073709551616", "True" },
new object[] { "12.0", "34.0", "False" },
new object[] { "34.0", "33.0", "True" },
};

public static IEnumerable<object[]> GreaterEqual_unsupported_types =>
new List<object[]>
{
new object[] { "12.0", "34", "Operands must be numbers, not double and int" },
new object[] { "34.0", "33", "Operands must be numbers, not double and int" },
new object[] { "2", "4294967295", "Operands must be numbers, not int and System.UInt32" },
new object[] { "2", "18446744073709551615", "Operands must be numbers, not int and System.UInt64" },
new object[] { "4294967295", "33", "Operands must be numbers, not System.UInt32 and int" },
new object[] { "33", "4294967295", "Operands must be numbers, not int and System.UInt32" }
new object[] { "4294967295", "4294967295", "Operands must be numbers, not System.UInt32 and System.UInt32" },
new object[] { "4294967295", "9223372036854775807", "Operands must be numbers, not System.UInt32 and long" },
new object[] { "4294967295", "18446744073709551615", "Operands must be numbers, not System.UInt32 and System.UInt64" },
new object[] { "4294967295", "18446744073709551616", "Operands must be numbers, not System.UInt32 and bigint" },
new object[] { "4294967295", "12.0", "Operands must be numbers, not System.UInt32 and double" },
new object[] { "9223372036854775807", "4294967295", "Operands must be numbers, not long and System.UInt32" },
new object[] { "9223372036854775807", "18446744073709551615", "Operands must be numbers, not long and System.UInt64" },
new object[] { "18446744073709551615", "2", "Operands must be numbers, not System.UInt64 and int" },
new object[] { "18446744073709551615", "4294967295", "Operands must be numbers, not System.UInt64 and System.UInt32" },
new object[] { "18446744073709551615", "9223372036854775807", "Operands must be numbers, not System.UInt64 and long" },
new object[] { "18446744073709551615", "18446744073709551615", "Operands must be numbers, not System.UInt64 and System.UInt64" },
new object[] { "18446744073709551615", "18446744073709551616", "Operands must be numbers, not System.UInt64 and bigint" },
new object[] { "18446744073709551615", "12.0", "Operands must be numbers, not System.UInt64 and double" },
new object[] { "18446744073709551616", "4294967295", "Operands must be numbers, not bigint and System.UInt32" },
new object[] { "18446744073709551616", "18446744073709551615", "Operands must be numbers, not bigint and System.UInt64" },
new object[] { "18446744073709551616", "12.0", "Operands must be numbers, not bigint and double" },
new object[] { "-12.0", "-34", "Operands must be numbers, not double and int" },
new object[] { "-12.0", "4294967295", "Operands must be numbers, not double and System.UInt32" },
new object[] { "-12.0", "9223372036854775807", "Operands must be numbers, not double and long" },
new object[] { "-12.0", "18446744073709551615", "Operands must be numbers, not double and System.UInt64" },
new object[] { "-12.0", "18446744073709551616", "Operands must be numbers, not double and bigint" },
};

public static IEnumerable<object[]> Less =>
Expand Down