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

Fix check for file type #13760

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions spec/compiler/crystal_path/crystal_path_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ describe Crystal::CrystalPath do
assert_finds "../test_folder", relative_to: "test_files/test_folder/file_three.cr", results: [
"test_files/test_folder/test_folder.cr",
]
assert_finds "foo.cr", results: [
"foo.cr/foo.cr",
]

# For `require "foo"`:
# 1. foo.cr (to find something in the standard library)
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion src/compiler/crystal/crystal_path.cr
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ module Crystal

each_file_expansion(filename, relative_to) do |path|
absolute_path = File.expand_path(path, dir: @current_dir)
return absolute_path if File.exists?(absolute_path)
return absolute_path if File.file?(absolute_path)
end

nil
Expand Down