Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message when test file get an invalid name #15642

Open
Lathanao opened this issue Sep 2, 2022 · 0 comments
Open

Confusing error message when test file get an invalid name #15642

Lathanao opened this issue Sep 2, 2022 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@Lathanao
Copy link
Contributor

Lathanao commented Sep 2, 2022

V doctor:

OS: linux, Ubuntu 22.04 LTS
Processor: 12 cpus, 64bit, little endian, Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
CC version: cc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
V full version: V 0.3.0 0133ff2

What did you do?
I create a test on a module, so I need 3 files:

main.v, main file

module main

import custom

fn main() {}

custom/custom.v , in module custom, the main module file

module custom

custom/test_custom.v, in module custom

module custom

fn test_result() {
	println('whatever')
}

Then test the file:

v run "./custom/test_custom.v"

What did you expect to see?
A message explaining there is an error in the file name.

In this situation, the error message is not right, The project contains already a main module. And the message about "v -shared" is confusing.

What did you see instead?

test/redis/bugbug.v/custom/test_custom.v:1:1: error: project must include a `main` module or be a shared library (compile with `v -shared`)
    1 | module custom
      | ^
    2 | 
    3 | fn test_result() {
@Lathanao Lathanao added the Bug This tag is applied to issues which reports bugs. label Sep 2, 2022
@Lathanao Lathanao changed the title Wrong test file name get a confusing error message. Confusing error message when test file get an invalid name Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant