diff --git a/.github/workflows/linux_ci.yml b/.github/workflows/linux_ci.yml index c6e65208933386..ba0dfb93af4447 100644 --- a/.github/workflows/linux_ci.yml +++ b/.github/workflows/linux_ci.yml @@ -57,6 +57,8 @@ jobs: # run: V_CI_CSTRICT=1 ./v -cstrict test-self - name: Build examples run: ./v -W build-examples + - name: Run the submodule example, using a relative path + run: ./v -W run examples/submodule - name: Build v tools run: ./v -W build-tools - name: Build v binaries diff --git a/examples/submodule/mymodules/main_functions.v b/examples/submodule/mymodules/main_functions.v index 0697d36d253c02..71f058050cb8cf 100644 --- a/examples/submodule/mymodules/main_functions.v +++ b/examples/submodule/mymodules/main_functions.v @@ -1,4 +1,4 @@ -module mymodule +module mymodules pub fn add_xy(x int, y int) int { return x + y diff --git a/vlib/v/util/module.v b/vlib/v/util/module.v index bc676d5a74e342..b789a6f26af8c0 100644 --- a/vlib/v/util/module.v +++ b/vlib/v/util/module.v @@ -107,8 +107,9 @@ fn mod_path_to_full_name(pref_ &pref.Preferences, mod string, path string) !stri } } mut in_vmod_path := false + parts := path.split(os.path_separator) for vmod_folder in vmod_folders { - if path.contains(vmod_folder + os.path_separator) { + if vmod_folder in parts { in_vmod_path = true break }