-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dual-libs-names
Signed-off-by: Javier Chávarri <javier.chavarri@gmail.com>
- Loading branch information
Showing
6 changed files
with
161 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- dune file formatting: output utf8 if input is correctly encoded (#10113, | ||
fixes #9728, @moyodiallo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 25 additions & 3 deletions
28
test/blackbox-tests/test-cases/formatting/non-ascii-characters.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
How the non-ASCII characters are handled, this is also related to the issue #9728 | ||
Utf8 characters are handled for now, this is also related to the issue #9728 | ||
|
||
$ dune format-dune-file <<EOF | ||
> ("É") | ||
> ("Éff ĎúÑȨ") | ||
> EOF | ||
("\195\137") | ||
("Éff ĎúÑȨ") | ||
|
||
$ dune format-dune-file <<EOF | ||
> (run foo %{bin:é}) | ||
> EOF | ||
File "", line 1, characters 15-16: | ||
Error: The character '\195' is not allowed inside %{...} forms | ||
[1] | ||
|
||
$ dune format-dune-file <<EOF | ||
> (echo "hÉllo") | ||
> EOF | ||
(echo "hÉllo") | ||
|
||
$ dune format-dune-file <<EOF | ||
> (echo "É") | ||
> EOF | ||
(echo "É") | ||
|
||
$ dune format-dune-file <<EOF | ||
> (Écho "hello") | ||
> EOF | ||
File "", line 1, characters 1-1: | ||
Error: Invalid . file | ||
[1] | ||
|
||
$ bash -c "printf '(echo \"%b\")' '\xc0'"| dune format-dune-file | ||
(echo "\192") | ||
$ bash -c "printf '(echo \"%b\")' '\xf0'"| dune format-dune-file | ||
(echo "\240") |
61 changes: 61 additions & 0 deletions
61
test/blackbox-tests/test-cases/melange/library-include-subdirs.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Test moving modules in a library with `(include_subdirs unqualified)` | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.8) | ||
> (using melange 0.1) | ||
> EOF | ||
|
||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (alias mel) | ||
> (libraries foo) | ||
> (emit_stdlib false) | ||
> (preprocess (pps melange.ppx))) | ||
> EOF | ||
|
||
$ mkdir lib | ||
$ cat > lib/dune <<EOF | ||
> (include_subdirs unqualified) | ||
> (library | ||
> (name foo) | ||
> (modes melange)) | ||
> EOF | ||
$ cat > lib/foo.ml <<EOF | ||
> let name = Bar.name | ||
> EOF | ||
|
||
$ mkdir lib/init | ||
$ cat > lib/init/bar.ml <<EOF | ||
> let name = "Zoe" | ||
> EOF | ||
|
||
$ dune build @mel | ||
|
||
Melange shows the proper path to `bar.js` | ||
|
||
$ cat _build/default/output/lib/foo.js | grep bar.js | ||
let Foo__Bar = require("./init/bar.js"); | ||
|
||
$ mv lib/init lib/end | ||
|
||
$ dune build @mel | ||
|
||
The import in `foo.js` still shows the initial path to `bar.js`, but the file is not there anymore | ||
|
||
$ cat _build/default/output/lib/foo.js | grep bar.js | ||
let Foo__Bar = require("./init/bar.js"); | ||
|
||
$ test -f _build/default/output/lib/init/bar.js | ||
[1] | ||
|
||
$ test -f _build/default/output/lib/end/bar.js | ||
|
||
After removal of the js artifact, the path in `bar.js` import is correct | ||
|
||
$ rm _build/default/output/lib/foo.js | ||
|
||
$ dune build @mel | ||
|
||
$ cat _build/default/output/lib/foo.js | grep bar.js | ||
let Foo__Bar = require("./end/bar.js"); |