fix test logic

This commit is contained in:
blueloveTH 2024-04-14 13:11:12 +08:00
parent d3989474a7
commit 14a9120d9b
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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