Skip to content

Commit 46133cf

Browse files
committed
Fix tests
1 parent 7c06774 commit 46133cf

File tree

77 files changed

+602
-663
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+602
-663
lines changed

regression-tests/pure2-is-with-free-functions-predicate.cpp2

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fun: (v) = {
1515
main: () -> int = {
1616
fun(3.14);
1717
fun(42);
18-
fun('a');
18+
fun(std::int8_t('a')); // char on ARM is unsigned https://discourse.llvm.org/t/why-is-char-type-considered-unsigned-in-arm-architecture/69763
1919
}
2020

2121
pred_i: (x : int ) -> bool = {

regression-tests/pure2-is-with-unnamed-predicates.cpp2

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ fun: (v) = {
1515
main: () -> int = {
1616
fun(3.14);
1717
fun(42);
18-
fun('a');
18+
fun(std::int8_t('a')); // char on ARM is unsigned https://discourse.llvm.org/t/why-is-char-type-considered-unsigned-in-arm-architecture/69763
1919
}

regression-tests/pure2-type-safety-1.cpp2

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ main: () -> int =
2323

2424
test_generic: ( x, msg ) = {
2525
msgx: std::string = msg;
26-
print( msgx + " is int? ", x is int );
26+
log( msgx + " is int? ", x is int );
2727
}
2828

29-
print: ( msg: std::string, b: bool ) = {
29+
log: ( msg: std::string, b: bool ) = {
3030
bmsg: * const char;
3131
if b { bmsg = "true"; }
3232
else { bmsg = "false"; }

regression-tests/test-results/apple-clang-14-c++2b/pure2-is-with-free-functions-predicate.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3

regression-tests/test-results/apple-clang-14-c++2b/pure2-is-with-unnamed-predicates.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
42
1+
42

regression-tests/test-results/apple-clang-14-c++2b/pure2-variadics.cpp.execution

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ abr
44
3.14word-1500
55
first all() returned false
66
second all() returned true
7-
sum of (1, 2, 3, 100) is: 106
7+
sum of (1, 2, 3, 100) is: 106
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(970) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
1+
../../../include/cpp2util.h(1068) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(782) : Bounds safety violation
1+
../../../include/cpp2util.h(880) : Bounds safety violation
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(782) : Contract violation: fill: value must contain at least count elements
1+
../../../include/cpp2util.h(880) : Contract violation: fill: value must contain at least count elements

regression-tests/test-results/apple-clang-15-c++2b/mixed-is-as-variant.cpp.execution

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ v is std::monostate = false
9494
v is X< 0> = false, (v as X< 1>) = bad_variant_access
9595
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
9696
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
97-
v is X<20> = false, (v as X<20>) = bad_variant_access
97+
v is X<20> = true, (v as X<20>) = works!
9898

9999
## v as const lvalue reference
100100

@@ -103,7 +103,7 @@ v is std::monostate = false
103103
v is X< 0> = false, (v as X< 1>) = bad_variant_access
104104
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
105105
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
106-
v is X<20> = false, (v as X<20>) = bad_variant_access
106+
v is X<20> = true, (v as X<20>) = works!
107107

108108
## v as rvalue reference
109109

@@ -112,7 +112,7 @@ v is std::monostate = false
112112
v is X< 0> = false, (v as X< 1>) = bad_variant_access
113113
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
114114
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
115-
v is X<20> = false, (v as X<20>) = bad_variant_access
115+
v is X<20> = true, (v as X<20>) = works!
116116

117117
# X<10>(std::exception)
118118

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
sending error to my framework... [dynamic null dereference attempt detected]
2-
from source location: ../../../include/cpp2util.h(861) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = int *&]
2+
from source location: ../../../include/cpp2util.h(959) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = int *&]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(861) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::expected<int, bool>]: Null safety violation: std::expected has an unexpected value
1+
../../../include/cpp2util.h(959) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::expected<int, bool>]: Null safety violation: std::expected has an unexpected value
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(861) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional<int>]: Null safety violation: std::optional does not contain a value
1+
../../../include/cpp2util.h(959) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::optional<int>]: Null safety violation: std::optional does not contain a value
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(861) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr<int>]: Null safety violation: std::shared_ptr is empty
1+
../../../include/cpp2util.h(959) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::shared_ptr<int>]: Null safety violation: std::shared_ptr is empty
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(861) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr<int>]: Null safety violation: std::unique_ptr is empty
1+
../../../include/cpp2util.h(959) decltype(auto) cpp2::impl::assert_not_null(auto &&, std::source_location) [arg:auto = std::unique_ptr<int>]: Null safety violation: std::unique_ptr is empty

regression-tests/test-results/apple-clang-15-c++2b/pure2-is-with-free-functions-predicate.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3

regression-tests/test-results/apple-clang-15-c++2b/pure2-is-with-unnamed-predicates.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3

regression-tests/test-results/clang-12-c++20/mixed-is-as-variant.cpp.execution

+57-57
Original file line numberDiff line numberDiff line change
@@ -4,142 +4,142 @@
44

55
v is empty = true
66
v is std::monostate = true
7-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
8-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
9-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
10-
v is X<20> = false, (v as X<20>) = bad_variant_access
7+
v is X< 0> = false, (v as X< 1>) = bad variant access
8+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
9+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
10+
v is X<20> = false, (v as X<20>) = bad variant access
1111

1212
## v as const lvalue reference
1313

1414
v is empty = true
1515
v is std::monostate = true
16-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
17-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
18-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
19-
v is X<20> = false, (v as X<20>) = bad_variant_access
16+
v is X< 0> = false, (v as X< 1>) = bad variant access
17+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
18+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
19+
v is X<20> = false, (v as X<20>) = bad variant access
2020

2121
## v as rvalue reference
2222

2323
v is empty = true
2424
v is std::monostate = true
25-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
26-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
27-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
28-
v is X<20> = false, (v as X<20>) = bad_variant_access
25+
v is X< 0> = false, (v as X< 1>) = bad variant access
26+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
27+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
28+
v is X<20> = false, (v as X<20>) = bad variant access
2929

3030
# X<1>
3131

3232
## v as lvalue reference
3333

3434
v is empty = false
3535
v is std::monostate = false
36-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
36+
v is X< 0> = false, (v as X< 1>) = bad variant access
3737
v is X< 1> = true, (v as X< 1>).to_string() = X<1>
38-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
39-
v is X<20> = false, (v as X<20>) = bad_variant_access
38+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
39+
v is X<20> = false, (v as X<20>) = bad variant access
4040

4141
## v as const lvalue reference
4242

4343
v is empty = false
4444
v is std::monostate = false
45-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
45+
v is X< 0> = false, (v as X< 1>) = bad variant access
4646
v is X< 1> = true, (v as X< 1>).to_string() = X<1>
47-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
48-
v is X<20> = false, (v as X<20>) = bad_variant_access
47+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
48+
v is X<20> = false, (v as X<20>) = bad variant access
4949

5050
## v as rvalue reference
5151

5252
v is empty = false
5353
v is std::monostate = false
54-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
54+
v is X< 0> = false, (v as X< 1>) = bad variant access
5555
v is X< 1> = true, (v as X< 1>).to_string() = X<1>
56-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
57-
v is X<20> = false, (v as X<20>) = bad_variant_access
56+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
57+
v is X<20> = false, (v as X<20>) = bad variant access
5858

5959
# X<19>
6060

6161
## v as lvalue reference
6262

6363
v is empty = false
6464
v is std::monostate = false
65-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
66-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
65+
v is X< 0> = false, (v as X< 1>) = bad variant access
66+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
6767
v is X<19> = true, (v as X<19>).to_string() = X<19>
68-
v is X<20> = false, (v as X<20>) = bad_variant_access
68+
v is X<20> = false, (v as X<20>) = bad variant access
6969

7070
## v as const lvalue reference
7171

7272
v is empty = false
7373
v is std::monostate = false
74-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
75-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
74+
v is X< 0> = false, (v as X< 1>) = bad variant access
75+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
7676
v is X<19> = true, (v as X<19>).to_string() = X<19>
77-
v is X<20> = false, (v as X<20>) = bad_variant_access
77+
v is X<20> = false, (v as X<20>) = bad variant access
7878

7979
## v as rvalue reference
8080

8181
v is empty = false
8282
v is std::monostate = false
83-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
84-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
83+
v is X< 0> = false, (v as X< 1>) = bad variant access
84+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
8585
v is X<19> = true, (v as X<19>).to_string() = X<19>
86-
v is X<20> = false, (v as X<20>) = bad_variant_access
86+
v is X<20> = false, (v as X<20>) = bad variant access
8787

8888
# X<20>
8989

9090
## v as lvalue reference
9191

9292
v is empty = false
9393
v is std::monostate = false
94-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
95-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
96-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
97-
v is X<20> = false, (v as X<20>) = bad_variant_access
94+
v is X< 0> = false, (v as X< 1>) = bad variant access
95+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
96+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
97+
v is X<20> = true, (v as X<20>) = works!
9898

9999
## v as const lvalue reference
100100

101101
v is empty = false
102102
v is std::monostate = false
103-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
104-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
105-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
106-
v is X<20> = false, (v as X<20>) = bad_variant_access
103+
v is X< 0> = false, (v as X< 1>) = bad variant access
104+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
105+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
106+
v is X<20> = true, (v as X<20>) = works!
107107

108108
## v as rvalue reference
109109

110110
v is empty = false
111111
v is std::monostate = false
112-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
113-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
114-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
115-
v is X<20> = false, (v as X<20>) = bad_variant_access
112+
v is X< 0> = false, (v as X< 1>) = bad variant access
113+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
114+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
115+
v is X<20> = true, (v as X<20>) = works!
116116

117117
# X<10>(std::exception)
118118

119119
## v as lvalue reference
120120

121-
v is empty = true
121+
v is empty = false
122122
v is std::monostate = false
123-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
124-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
125-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
126-
v is X<20> = false, (v as X<20>) = bad_variant_access
123+
v is X< 0> = false, (v as X< 1>) = bad variant access
124+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
125+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
126+
v is X<20> = true, (v as X<20>) = works!
127127

128128
## v as const lvalue reference
129129

130-
v is empty = true
130+
v is empty = false
131131
v is std::monostate = false
132-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
133-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
134-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
135-
v is X<20> = false, (v as X<20>) = bad_variant_access
132+
v is X< 0> = false, (v as X< 1>) = bad variant access
133+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
134+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
135+
v is X<20> = true, (v as X<20>) = works!
136136

137137
## v as rvalue reference
138138

139-
v is empty = true
139+
v is empty = false
140140
v is std::monostate = false
141-
v is X< 0> = false, (v as X< 1>) = bad_variant_access
142-
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
143-
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
144-
v is X<20> = false, (v as X<20>) = bad_variant_access
141+
v is X< 0> = false, (v as X< 1>) = bad variant access
142+
v is X< 1> = false, (v as X< 1>).to_string() = bad variant access
143+
v is X<19> = false, (v as X<19>).to_string() = bad variant access
144+
v is X<20> = true, (v as X<20>) = works!
145145

regression-tests/test-results/clang-12-c++20/pure2-is-with-free-functions-predicate.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3

regression-tests/test-results/clang-12-c++20/pure2-is-with-unnamed-predicates.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3

regression-tests/test-results/clang-15-c++20-libcpp/mixed-is-as-variant.cpp.execution

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ v is std::monostate = false
9494
v is X< 0> = false, (v as X< 1>) = bad_variant_access
9595
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
9696
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
97-
v is X<20> = false, (v as X<20>) = bad_variant_access
97+
v is X<20> = true, (v as X<20>) = works!
9898

9999
## v as const lvalue reference
100100

@@ -103,7 +103,7 @@ v is std::monostate = false
103103
v is X< 0> = false, (v as X< 1>) = bad_variant_access
104104
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
105105
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
106-
v is X<20> = false, (v as X<20>) = bad_variant_access
106+
v is X<20> = true, (v as X<20>) = works!
107107

108108
## v as rvalue reference
109109

@@ -112,7 +112,7 @@ v is std::monostate = false
112112
v is X< 0> = false, (v as X< 1>) = bad_variant_access
113113
v is X< 1> = false, (v as X< 1>).to_string() = bad_variant_access
114114
v is X<19> = false, (v as X<19>).to_string() = bad_variant_access
115-
v is X<20> = false, (v as X<20>) = bad_variant_access
115+
v is X<20> = true, (v as X<20>) = works!
116116

117117
# X<10>(std::exception)
118118

regression-tests/test-results/clang-15-c++20-libcpp/pure2-is-with-free-functions-predicate.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3

regression-tests/test-results/clang-15-c++20-libcpp/pure2-is-with-unnamed-predicates.cpp.execution

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
3.140000 is bigger than 3
33
42 is integer bigger than 3
44
42 is bigger than 3
5-
a is integer bigger than 3
6-
a is bigger than 3
5+
97 is integer bigger than 3
6+
97 is bigger than 3
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(970) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
1+
../../../include/cpp2util.h(1068) decltype(auto) cpp2::impl::assert_in_bounds(auto &&, std::source_location) [arg = 5, x:auto = std::vector<int>]: Bounds safety violation: out of bounds access attempt detected - attempted access at index 5, [min,max] range is [0,4]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(782) : Bounds safety violation
1+
../../../include/cpp2util.h(880) : Bounds safety violation
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../../include/cpp2util.h(782) : Contract violation: fill: value must contain at least count elements
1+
../../../include/cpp2util.h(880) : Contract violation: fill: value must contain at least count elements

0 commit comments

Comments
 (0)