27 lines
539 B
C++
27 lines
539 B
C++
#include "include/test.h"
|
|
|
|
#include "../src/include/memory.h"
|
|
#include "../src/include/tokenize.h"
|
|
#include "../src/include/parser.h"
|
|
#include "../src/include/interpreter.h"
|
|
|
|
int execute(string s) {
|
|
Memory memory;;
|
|
vector<Token> tokens = tokenize({ s });
|
|
Node ast = parse(tokens);
|
|
EvalResult res = eval(ast, memory);
|
|
|
|
return get<int>(res);
|
|
}
|
|
|
|
int main() {
|
|
_TEST_PRESENTATION("Opérateurs");
|
|
|
|
_TEST_ASSERT(
|
|
_TEST_NO_EXCEPTION(execute("1,2;") == 2),
|
|
"Virgule",
|
|
true
|
|
);
|
|
|
|
return 0;
|
|
} |