Added testing! call kraken like so ./kraken --test ../path/to/test/name_of_test_without_extention This will make kraken compile and run name_of_test_without_extention.krak and compare the output it generates on stdout to name_of_test_without_extention.expected_results. If they pass, then it records the pass, if not, it records the failure and saves the intermediate files generated. It has revealed some bugs which I will fix in upcoming commits.
This commit is contained in:
29
tests/moreComplexObjectTest.krak
Normal file
29
tests/moreComplexObjectTest.krak
Normal file
@@ -0,0 +1,29 @@
|
||||
import io;
|
||||
|
||||
typedef firstObject {
|
||||
int objectNum;
|
||||
int other;
|
||||
void print() {
|
||||
print(other);
|
||||
}
|
||||
void printInd() {
|
||||
print();
|
||||
}
|
||||
};
|
||||
|
||||
typedef Int int;
|
||||
|
||||
Int aliasNum;
|
||||
|
||||
int main() {
|
||||
firstObject wooObject;
|
||||
wooObject.objectNum = 7;
|
||||
print(wooObject.objectNum);
|
||||
firstObject* objPtr = &wooObject;
|
||||
objPtr->objectNum = 42;
|
||||
print(objPtr->objectNum);
|
||||
print("\n");
|
||||
objPtr->other = 1337;
|
||||
objPtr->printInd();
|
||||
print("\n");
|
||||
}
|
||||
Reference in New Issue
Block a user