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

In single mode the current working directory is added to import paths by default #2050

Closed
wants to merge 1 commit into from

Conversation

drug007
Copy link
Contributor

@drug007 drug007 commented Dec 1, 2020

Fix #2051

This PR adds the current working dir to the list of import paths if user run test command in single file mode like:

dub test --single path/to/file.d

to let dub to find the file.

Important:
the file should not be named main.d because the file is imported as module main and there will be conflict between static import main and function D main:

/tmp/dub_test_root_test.d(9,12): Error: function D main conflicts with static import dub_test_root.main at /tmp/dub_test_root_test.d(3,15)

@dlang-bot
Copy link
Collaborator

Thanks for your pull request and interest in making D better, @drug007! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

@drug007 drug007 changed the title In single mode the current working directory is added by default In single mode the current working directory is added to import paths by default Dec 1, 2020
@thewilsonator
Copy link
Contributor

Please add a changelog entry and a test case.

@drug007
Copy link
Contributor Author

drug007 commented Dec 2, 2020

Closed as obsolete, see #2052

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running unit tests from DUB single file packages fails
3 participants