Skip to content

Commit ce8f8bc

Browse files
authored
Improve/update tests (#590)
1 parent b6ffa69 commit ce8f8bc

9 files changed

+17
-15
lines changed

regression-tests/mixed-fixed-type-aliases.cpp2

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#include <typeinfo>
1+
#include <filesystem>
22
#include <iostream>
3+
#include <typeinfo>
34

45
namespace my {
56
using u16 = float;
@@ -20,5 +21,5 @@ main: (args) -> int = {
2021
test(z);
2122

2223
for args do (arg)
23-
std::cout << arg << "\n";
24+
std::cout << std::filesystem::path(arg).filename() << "\n";
2425
}

regression-tests/pure2-stdio-with-raii.cpp2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// "A better C than C" ... ?
33
//
44
main: () -> int = {
5-
s: std::string = "Freddy";
5+
s: std::string = "Fred";
66
myfile := cpp2::fopen("xyzzy", "w");
77
_ = myfile.fprintf( "Hello %s with UFCS!", s.c_str() );
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
true
22
false
3-
./test.exe
3+
"test.exe"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
true
22
false
3-
./test.exe
3+
"test.exe"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
true
22
false
3-
./test.exe
3+
"test.exe"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Hello Freddy with UFCS!
1+
Hello Fred with UFCS!

regression-tests/test-results/mixed-fixed-type-aliases.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,26 @@
99

1010
//=== Cpp2 type definitions and function declarations ===========================
1111

12-
#include <typeinfo>
12+
#include <filesystem>
1313
#include <iostream>
14+
#include <typeinfo>
1415

1516
namespace my {
1617
using u16 = float;
1718
}
1819

19-
#line 8 "mixed-fixed-type-aliases.cpp2"
20+
#line 9 "mixed-fixed-type-aliases.cpp2"
2021
auto test(auto const& x) -> void;
2122

2223

23-
#line 15 "mixed-fixed-type-aliases.cpp2"
24+
#line 16 "mixed-fixed-type-aliases.cpp2"
2425
[[nodiscard]] auto main(int const argc_, char** argv_) -> int;
2526

2627

2728
//=== Cpp2 function definitions =================================================
2829

2930

30-
#line 8 "mixed-fixed-type-aliases.cpp2"
31+
#line 9 "mixed-fixed-type-aliases.cpp2"
3132
auto test(auto const& x) -> void{
3233
std::cout
3334
<< std::boolalpha
@@ -37,14 +38,14 @@ auto test(auto const& x) -> void{
3738

3839
[[nodiscard]] auto main(int const argc_, char** argv_) -> int{
3940
auto args = cpp2::make_args(argc_, argv_);
40-
#line 16 "mixed-fixed-type-aliases.cpp2"
41+
#line 17 "mixed-fixed-type-aliases.cpp2"
4142
my::u16 y {42};
4243
test(std::move(y));
4344

4445
cpp2::u16 z {42};
4546
test(std::move(z));
4647

4748
for ( auto const& arg : args )
48-
std::cout << arg << "\n";
49+
std::cout << CPP2_UFCS_0(filename, std::filesystem::path(arg)) << "\n";
4950
}
5051

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
true
22
false
3-
test.exe
3+
"test.exe"

regression-tests/test-results/pure2-stdio-with-raii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#line 4 "pure2-stdio-with-raii.cpp2"
2424
[[nodiscard]] auto main() -> int{
25-
std::string s {"Freddy"};
25+
std::string s {"Fred"};
2626
auto myfile {cpp2::fopen("xyzzy", "w")};
2727
static_cast<void>(CPP2_UFCS(fprintf, std::move(myfile), "Hello %s with UFCS!", CPP2_UFCS_0(c_str, std::move(s))));
2828
}

0 commit comments

Comments
 (0)