54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
#include <iostream>
|
|
#include <fstream>
|
|
|
|
import wbt;
|
|
|
|
void test_parse_no_expressions() {
|
|
std::ifstream i("test/test_parse_no_expressions.wbt", std::ios_base::in);
|
|
std::ostream o(std::cout.rdbuf());
|
|
const WBT_Parser p(i, o);
|
|
p.parse();
|
|
}
|
|
|
|
void test_parse_single_expression() {
|
|
std::ifstream i("test/test_parse_single_expression.wbt", std::ios_base::in);
|
|
std::ostream o(std::cout.rdbuf());
|
|
const WBT_Parser p(i, o);
|
|
p.parse();
|
|
}
|
|
|
|
void test_parse_invalid_character_expression() {
|
|
std::ifstream i("test/test_parse_invalid_character_expression.wbt", std::ios_base::in);
|
|
std::ostream o(std::cout.rdbuf());
|
|
const WBT_Parser p(i, o);
|
|
p.parse();
|
|
}
|
|
|
|
void test_parse_unclosed_expression() {
|
|
std::ifstream i("test/test_parse_unclosed_expression.wbt", std::ios_base::in);
|
|
std::ostream o(std::cout.rdbuf());
|
|
const WBT_Parser p(i, o);
|
|
p.parse();
|
|
}
|
|
|
|
void test_parse_unclosed_expression_2() {
|
|
std::ifstream i("test/test_parse_unclosed_expression_2.wbt", std::ios_base::in);
|
|
std::ostream o(std::cout.rdbuf());
|
|
const WBT_Parser p(i, o);
|
|
p.parse();
|
|
}
|
|
|
|
int main() {
|
|
std::cout << std::endl << "1 -----" << std::endl;
|
|
test_parse_no_expressions();
|
|
std::cout << std::endl << "2 -----" << std::endl;
|
|
test_parse_single_expression();
|
|
std::cout << std::endl << "3 -----" << std::endl;
|
|
test_parse_invalid_character_expression();
|
|
std::cout << std::endl << "4 -----" << std::endl;
|
|
test_parse_unclosed_expression();
|
|
std::cout << std::endl << "5 -----" << std::endl;
|
|
test_parse_unclosed_expression_2();
|
|
std::cout << std::endl << "END -----" << std::endl;
|
|
}
|