vxx2 / vlib / v3 / pref / pref_test.v
17 lines · 14 sloc · 493 bytes · 6c4d26f1f98c5464b012a375667ab345e462f7e0
Raw
1module pref
2
3import os
4
5// test_detect_vroot_from_subdir validates detect vroot from subdir behavior in v3 tests.
6fn test_detect_vroot_from_subdir() {
7 vroot := @VMODROOT
8 v3_dir := os.join_path(vroot, 'vlib', 'v3')
9 assert detect_vroot_from(v3_dir) == vroot
10}
11
12// test_detect_vroot_from_binary_path validates this v3 regression case.
13fn test_detect_vroot_from_binary_path() {
14 vroot := @VMODROOT
15 v3_bin := os.join_path(vroot, 'vlib', 'v3', 'v3')
16 assert detect_vroot_from(v3_bin) == vroot
17}
18