Skip to content

Commit 8bd4473

Browse files
committed
test: return different values for good measure
1 parent 1fe717c commit 8bd4473

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
t: type = {
2-
operator[]: (inout this) -> i32 = 42;
3-
operator[]: (inout this, x: _) -> i32 = 42;
4-
operator[]: (inout this, x: _, y: _) -> i32 = 42;
2+
operator[]: (inout this) -> i32 = 1;
3+
operator[]: (inout this, x: _) -> i32 = 2;
4+
operator[]: (inout this, x: _, y: _) -> i32 = 3;
55
}
66
main: () = {
7-
[[assert: t()[] == 42]]
8-
[[assert: t()[1] == 42]]
9-
[[assert: t()[1, 2] == 42]]
7+
[[assert: t()[] == 1]]
8+
[[assert: t()[1] == 2]]
9+
[[assert: t()[1, 2] == 3]]
1010
}

regression-tests/test-results/pure2-bugfix-for-empty-index.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ auto main() -> int;
3030

3131

3232
#line 2 "pure2-bugfix-for-empty-index.cpp2"
33-
[[nodiscard]] auto t::operator[]() -> cpp2::i32 { return 42; }
34-
[[nodiscard]] auto t::operator[](auto const& x) -> cpp2::i32 { return 42; }
35-
[[nodiscard]] auto t::operator[](auto const& x, auto const& y) -> cpp2::i32 { return 42; }
33+
[[nodiscard]] auto t::operator[]() -> cpp2::i32 { return 1; }
34+
[[nodiscard]] auto t::operator[](auto const& x) -> cpp2::i32 { return 2; }
35+
[[nodiscard]] auto t::operator[](auto const& x, auto const& y) -> cpp2::i32 { return 3; }
3636

3737
auto main() -> int{
38-
cpp2::Default.expects(t()[]==42, "");
39-
cpp2::Default.expects(cpp2::assert_in_bounds(t(), 1)==42, "");
40-
cpp2::Default.expects(t()[1, 2]==42, "");
38+
cpp2::Default.expects(t()[]==1, "");
39+
cpp2::Default.expects(cpp2::assert_in_bounds(t(), 1)==2, "");
40+
cpp2::Default.expects(t()[1, 2]==3, "");
4141
}
4242

0 commit comments

Comments
 (0)