mirror of
https://github.com/anoma/juvix.git
synced 2024-11-30 05:42:26 +03:00
parent
6e58aad8e7
commit
deca981fa3
@ -156,11 +156,14 @@ instance Show FileExt where
|
||||
instance Pretty FileExt where
|
||||
pretty = pretty . fileExtToText
|
||||
|
||||
isHidden :: Path b File -> Bool
|
||||
isHidden = (== ".") . take 1 . toFilePath
|
||||
|
||||
isJuvixOrJuvixMdFile :: Path b File -> Bool
|
||||
isJuvixOrJuvixMdFile = isJuvixFile .||. isJuvixMarkdownFile
|
||||
|
||||
isJuvixFile :: Path b File -> Bool
|
||||
isJuvixFile = (== Just juvixFileExt) . fileExtension
|
||||
isJuvixFile = (not . isHidden) .&&. ((== Just juvixFileExt) . fileExtension)
|
||||
|
||||
isJuvixMarkdownFile :: Path b File -> Bool
|
||||
isJuvixMarkdownFile p = case splitExtension p of
|
||||
|
@ -269,5 +269,9 @@ tests =
|
||||
posTest
|
||||
"Proper formatting of import module path"
|
||||
$(mkRelDir "issue2737")
|
||||
$(mkRelFile "main.juvix"),
|
||||
posTest
|
||||
"Ignore dot files"
|
||||
$(mkRelDir "issue3068")
|
||||
$(mkRelFile "main.juvix")
|
||||
]
|
||||
|
1
tests/positive/issue3068/.hidden.juvix
Normal file
1
tests/positive/issue3068/.hidden.juvix
Normal file
@ -0,0 +1 @@
|
||||
nothing to see here
|
9
tests/positive/issue3068/Package.juvix
Normal file
9
tests/positive/issue3068/Package.juvix
Normal file
@ -0,0 +1,9 @@
|
||||
module Package;
|
||||
|
||||
import PackageDescription.V2 open;
|
||||
|
||||
package : Package :=
|
||||
defaultPackage@?{
|
||||
name := "issue3068";
|
||||
dependencies := []
|
||||
};
|
1
tests/positive/issue3068/main.juvix
Normal file
1
tests/positive/issue3068/main.juvix
Normal file
@ -0,0 +1 @@
|
||||
module main;
|
@ -1,5 +1,14 @@
|
||||
working-directory: ./../../../tests/
|
||||
tests:
|
||||
- name: ignore-dot-file
|
||||
working-directory: ./../../../tests/positive/issue3068
|
||||
command:
|
||||
- juvix
|
||||
- typecheck
|
||||
stderr:
|
||||
equals: "Well done! It type checks\n"
|
||||
exit-status: 0
|
||||
|
||||
- name: flag-help-shows-juvix-file-for-autocompletion
|
||||
command:
|
||||
- juvix
|
||||
|
Loading…
Reference in New Issue
Block a user