2022-01-13 19:04:38 +08:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
2022-01-14 14:40:45 +08:00
|
|
|
#include <script_parser.h>
|
2022-01-13 19:04:38 +08:00
|
|
|
|
|
|
|
using namespace boost::unit_test;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int parseScript(const char* path) {
|
|
|
|
ifstream script(path, ios::in);
|
|
|
|
if (!script.is_open()) {
|
|
|
|
perror(path);
|
|
|
|
return ENOENT;
|
|
|
|
} else {
|
2022-01-14 14:40:45 +08:00
|
|
|
string line;
|
|
|
|
while(getline(script, line, '\n')) {
|
|
|
|
cout << line <<endl;
|
|
|
|
}
|
|
|
|
script.close();
|
2022-01-13 19:04:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|