Fixed up testing etc
This commit is contained in:
28
tests/test_vectorTest.krak
Normal file
28
tests/test_vectorTest.krak
Normal file
@@ -0,0 +1,28 @@
|
||||
import io:*;
|
||||
import mem:*;
|
||||
import vector:*;
|
||||
|
||||
typedef AbleToBeDestroyed (Destructable) {
|
||||
|void| destruct() {
|
||||
println("Destroyed!");
|
||||
}
|
||||
};
|
||||
|
||||
|int| main() {
|
||||
|vector<int>| intVec.construct();
|
||||
intVec.addEnd(1);
|
||||
intVec.addEnd(3);
|
||||
intVec.addEnd(3);
|
||||
intVec.addEnd(7);
|
||||
for (|int| i = 0; i < intVec.size; i++;)
|
||||
print(intVec.at(i));
|
||||
|
||||
println();
|
||||
|
||||
|vector<AbleToBeDestroyed>*| desVec = new<vector<AbleToBeDestroyed>>()->construct();
|
||||
|AbleToBeDestroyed| testDestruct;
|
||||
desVec->addEnd(testDestruct);
|
||||
delete<vector<AbleToBeDestroyed>>(desVec);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user