Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import std;

int main() {
#INJECT-b585472fa
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import std;

int main() {
#INJECT-b585472fa
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import std;

int main() {
#INJECT-b585472fa
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import std;

int main() {
#INJECT-b585472fa
}
17 changes: 17 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0010/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "ut.hpp"

#include <algorithm>
#include <string>

namespace ut = boost::ut;

int main() {
using namespace ut;

"check user input"_test = [] {
std::string str = R"(#INJECT-b585472fa)";
str.erase(std::remove(str.begin(), str.end(), ' '), str.end());
std::sort(str.begin(), str.end());
expect(str == "346");
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import std;

#INJECT-b585472fa

int main() {
std::println("{}", to_fahrenheit(100.0));
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import std;

#INJECT-b585472fa

int main() {
std::println("to_fahrenheit(100.0) = {}", to_fahrenheit(100.0));
std::println("to_fahrenheit(-50.0) = {}", to_fahrenheit(-50.0));
}
19 changes: 19 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0020/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "ut.hpp"

#INJECT-b585472fa

namespace ut = boost::ut;

int main() {
using namespace ut;

"zero temperature"_test = [] {
expect(32.0_d == to_fahrenheit(0.0)) << "epsilon=0.001";
expect(0.0_d == to_fahrenheit(-17.7778)) << "epsilon=0.001";
};

"non-zero temperature"_test = [] {
expect(113.0_d == to_fahrenheit(45.0)) << "epsilon=0.001";
expect(15.8_d == to_fahrenheit(-9.0)) << "epsilon=0.001";
};
}
16 changes: 16 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0030/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "ut.hpp"

#include <algorithm>
#include <string>

namespace ut = boost::ut;

int main() {
using namespace ut;

"check user input"_test = [] {
std::string str = R"(#INJECT-b585472fa)";
str.erase(std::remove(str.begin(), str.end(), ' '), str.end());
expect(str == "4-1");
};
}
18 changes: 18 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0040/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "ut.hpp"

#include <algorithm>
#include <string>

namespace ut = boost::ut;

int main() {
using namespace ut;

"check user input"_test = [] {
std::string str = R"(#INJECT-b585472fa)";
str.erase(std::remove(str.begin(), str.end(), ' '), str.end());
std::transform(str.begin(), str.end(), str.begin(),
[](unsigned char c){ return std::tolower(c); });
expect(str == "2e-5");
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import std;

#INJECT-b585472fa

int main() {
std::println("{}", hello_xor(true, false)); // true
std::println("{}", hello_xor(false, true)); // true
std::println("{}", hello_xor(false, false)); // false
std::println("{}", hello_xor(true, true)); // false
}
10 changes: 10 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0050/wrapper_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import std;

#INJECT-b585472fa

int main() {
std::println("{}", hello_xor(true, false)); // true
std::println("{}", hello_xor(false, true)); // true
std::println("{}", hello_xor(false, false)); // false
std::println("{}", hello_xor(true, true)); // false
}
16 changes: 16 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0050/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "ut.hpp"

#INJECT-b585472fa

namespace ut = boost::ut;

int main() {
using namespace ut;

"all a, b combinations"_test = [] {
expect(hello_xor(true, false) == true);
expect(hello_xor(false, true) == true);
expect(hello_xor(true, true) == false);
expect(hello_xor(false, false) == false);
};
}
19 changes: 19 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0060/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "ut.hpp"

#include <algorithm>
#include <string>

namespace ut = boost::ut;

int main() {
using namespace ut;

"check user input"_test = [] {
std::string str = R"(#INJECT-b585472fa)";
str.erase(std::remove(str.begin(), str.end(), ' '), str.end());
std::transform(str.begin(), str.end(), str.begin(),
[](unsigned char c){ return std::tolower(c); });

expect(str == "y");
};
}
17 changes: 17 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0070/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "ut.hpp"

#include <algorithm>
#include <string>

namespace ut = boost::ut;

int main() {
using namespace ut;

"check user input"_test = [] {
std::string str = R"(#INJECT-b585472fa)";
str.erase(std::remove(str.begin(), str.end(), ' '), str.end());

expect(str == "-4");
};
}
17 changes: 17 additions & 0 deletions cpp/cpp_chapter_0020/tasks/cpp_chapter_0020_task_0080/wrapper_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "ut.hpp"

#include <algorithm>
#include <string>

namespace ut = boost::ut;

int main() {
using namespace ut;

"check user input"_test = [] {
std::string str = R"(#INJECT-b585472fa)";
str.erase(std::remove(str.begin(), str.end(), ' '), str.end());

expect(str == "12");
};
}
Loading