tests: make tests reproducible

This commit is contained in:
ge
2026-05-05 23:24:52 +03:00
parent f45af2e4ba
commit b3984a74e3
3 changed files with 3 additions and 7 deletions
+2 -4
View File
@@ -1,17 +1,15 @@
module main
import os
import v.util.diff
import embedfs
fn test_mymod() {
oldpwd := os.getwd()
expected_out := os.read_file('tests/mymod_test.out')!
expected := '{"some": "JSON data"}\n'
os.chdir('tests/mymod')!
gen := embedfs.generate('assets')!
os.write_file('assets_generated.v', gen)!
ret := os.execute('${os.quoted_path(@VEXE)} run .')
dump(diff.compare_text(ret.output, expected_out)!)
assert ret.output == expected_out
assert ret.output == expected
os.chdir(oldpwd)!
}