TU-Programmieren_2/exercise1/task1.test.cpp
2025-04-09 10:22:44 +02:00

36 lines
1.1 KiB
C++

/// @file
/// @brief Task1: tests (support for C++20 standard)
#include <cassert> // assert
#include <filesystem> // std::filesystem::path
#include <fstream> // std::ofstream
#include <iostream> // std::cout|endl
#include <sstream> // std::istringstream
#include <version> // https://en.cppreference.com/w/cpp/utility/feature_test
#include "iue-io/csv.hpp" // https://sgit.iue.tuwien.ac.at/360050/modules
int main() {
std::ostringstream oss;
oss << "This compilation unit was compiled" << std::endl;
oss << " - on " << __DATE__ << " at " << __TIME__ << std::endl;
oss << " - using the C++ language standard " << __cplusplus << std::endl;
oss << " - the main-function was present in this file: " << __FILE__ << std::endl;
std::filesystem::path filename = "info_cpp.txt";
std::ofstream ofs(filename);
ofs.exceptions(std::ios::failbit);
ofs << oss.str();
assert(__cplusplus >= 202002L);
assert(__cpp_lib_filesystem >= 201703L);
assert(__cpp_concepts >= 201907L);
std::cout << "task1.test.cpp: all asserts passed" << std::endl;
return 0;
}