mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
fix test logic
This commit is contained in:
parent
d3989474a7
commit
14a9120d9b
@ -99,9 +99,6 @@ int main(int argc, char** argv){
|
|||||||
std::string src((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
std::string src((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
// set parent path as cwd
|
|
||||||
std::filesystem::current_path(filepath.parent_path());
|
|
||||||
|
|
||||||
bool ok = pkpy_exec_2(vm, src.c_str(), filepath.filename().string().c_str(), 0, NULL);
|
bool ok = pkpy_exec_2(vm, src.c_str(), filepath.filename().string().c_str(), 0, NULL);
|
||||||
if(!ok) pkpy_clear_error(vm, NULL);
|
if(!ok) pkpy_clear_error(vm, NULL);
|
||||||
pkpy_delete_vm(vm);
|
pkpy_delete_vm(vm);
|
||||||
|
@ -3,6 +3,9 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
# test import
|
||||||
|
os.chdir('tests')
|
||||||
|
|
||||||
import test1
|
import test1
|
||||||
|
|
||||||
assert test1.add(1, 2) == 13
|
assert test1.add(1, 2) == 13
|
||||||
|
Loading…
x
Reference in New Issue
Block a user