Refresh snapshots

This commit is contained in:
GearsDatapacks 2025-03-11 22:36:35 +00:00 committed by Louis Pilfold
parent 47bb5e7302
commit f5748a735c
72 changed files with 0 additions and 1368 deletions

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMarkdownPagesOpts::default())"
snapshot_kind: text
---
//// LICENSE.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile_with_markdown_pages(config, vec![], pages,\nCompileWithMarkdownPagesOpts::default())"
snapshot_kind: text
---
//// one.html

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile_with_markdown_pages(config, modules, pages,\nCompileWithMarkdownPagesOpts { hex_publish: Some(DocContext::Build) })"
snapshot_kind: text
---
//// LICENSE.html

View file

@ -1,6 +1,5 @@
---
source: compiler-core/src/docs/tests.rs
expression: json
snapshot_kind: text
---
{"items":[{"type":"module","parentTitle":"gleam/option","title":"gleam/option","doc":"","ref":"gleam/option.html"},{"type":"type","parentTitle":"gleam/option","title":"Option","doc":"`Option` represents a value that may be present or not. `Some` means the value is present, `None` means the value is not.","ref":"gleam/option.html#Option"},{"type":"function","parentTitle":"gleam/option","title":"unwrap","doc":"Extracts the value from an `Option`, returning a default value if there is none.","ref":"gleam/option.html#unwrap"},{"type":"constant","parentTitle":"gleam/dynamic/decode","title":"bool","doc":"A decoder that decodes `Bool` values.\n\n # Examples\n\n \n let result = decode.run(dynamic.from(True), decode.bool)\n assert result == Ok(True)\n \n","ref":"gleam/dynamic/decode.html#bool"}],"proglang":"gleam"}

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/docs/tests.rs
expression: "compile(config, modules)"
snapshot_kind: text
---
//// app.html

View file

@ -1,20 +0,0 @@
---
source: compiler-core/src/javascript/tests/bit_arrays.rs
expression: "\nfn go(x) {\n let n = 16\n let assert <<a:bits-size(n)>> = x\n}\n"
---
----- SOURCE CODE
fn go(x) {
let n = 16
let assert <<a:bits-size(n)>> = x
}
----- ERROR
error: Unsupported feature for compilation target
┌─ /src/javascript/error.gleam:4:16
4 │ let assert <<a:bits-size(n)>> = x
│ ^^^^^^^^^^^^^^
This bit array size option in patterns is not supported for JavaScript compilation.

View file

@ -1,20 +0,0 @@
---
source: compiler-core/src/javascript/tests/bit_arrays.rs
expression: "\nfn go(x) {\n let n = 16\n let assert <<a:size(n)>> = x\n}\n"
---
----- SOURCE CODE
fn go(x) {
let n = 16
let assert <<a:size(n)>> = x
}
----- ERROR
error: Unsupported feature for compilation target
┌─ /src/javascript/error.gleam:4:16
4 │ let assert <<a:size(n)>> = x
│ ^^^^^^^^^
Non-constant size option in patterns is not supported for JavaScript compilation.

View file

@ -1,8 +1,6 @@
---
source: compiler-core/src/language_server/tests/action.rs
assertion_line: 4432
expression: "\npub type Wibble {\n OneTwo(wibble: Int, next: Wibble)\n ThreeFour(wobble: Float, text: String, values: List(Bool))\n FiveSixSeven(one_two: Int)\n}\n"
snapshot_kind: text
---
----- BEFORE ACTION

View file

@ -1,8 +1,6 @@
---
source: compiler-core/src/language_server/tests/action.rs
assertion_line: 5199
expression: "\nimport gleam/io\n\npub fn main(x) {\n case x {\n True -> {\n let message = \"Hello!\"\n io.println(message)\n }\n False -> Nil\n }\n}\n"
snapshot_kind: text
---
----- BEFORE ACTION

View file

@ -1,24 +0,0 @@
---
source: compiler-core/src/parse/tests.rs
expression: case a
---
[
Expression(
Case {
location: SrcSpan {
start: 0,
end: 6,
},
subjects: [
Var {
location: SrcSpan {
start: 5,
end: 6,
},
name: "a",
},
],
clauses: [],
},
),
]

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: "-1.8e308"
snapshot_kind: text
---
----- SOURCE CODE
-1.8e308

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: const x = -1.8e308
snapshot_kind: text
---
----- SOURCE CODE
const x = -1.8e308

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: "let assert [-1.8e308, b] = [x, y]"
snapshot_kind: text
---
----- SOURCE CODE
let assert [-1.8e308, b] = [x, y]

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: "1.8e308"
snapshot_kind: text
---
----- SOURCE CODE
1.8e308

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: const x = 1.8e308
snapshot_kind: text
---
----- SOURCE CODE
const x = 1.8e308

View file

@ -1,7 +1,6 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: "let assert [1.8e308, b] = [x, y]"
snapshot_kind: text
---
----- SOURCE CODE
let assert [1.8e308, b] = [x, y]

View file

@ -1,38 +0,0 @@
---
source: compiler-core/src/type_/tests/errors.rs
expression: "\npub fn main() {\n case todo {\n 1 -> Ok(2)\n _ -> {\n todo\n 1\n }\n }\n}\n"
---
----- SOURCE CODE
pub fn main() {
case todo {
1 -> Ok(2)
_ -> {
todo
1
}
}
}
----- ERROR
error: Type mismatch
┌─ /src/one/two.gleam:5:5
5 │ ╭ _ -> {
6 │ │ todo
7 │ │ 1
│ │ ^ Did you mean to wrap this in an `Ok`?
8 │ │ }
│ ╰─────^
This case clause was found to return a different type than the previous
one, but all case clauses must return the same type.
Expected type:
Result(Int, a)
Found type:
Int

View file

@ -1,8 +1,6 @@
---
source: test-output/src/tests/echo.rs
assertion_line: 191
expression: output
snapshot_kind: text
---
--- main.gleam ----------------------
pub fn main() {

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 8
expression: "./cases/alias_unqualified_import"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 21
expression: "./cases/duplicate_module"
---
error: Duplicate module
@ -9,4 +8,3 @@ The module `main` is defined multiple times.
First: src/main.gleam
Second: test/main.gleam

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 63
expression: "./cases/erlang_escape_names"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 74
expression: "./cases/erlang_import"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 85
expression: "./cases/erlang_import_shadowing_prelude"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 96
expression: "./cases/erlang_nested"
---
//// /out/lib/the_package/_gleam_artefacts/one@two.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 118
expression: "./cases/hello_joe"
---
//// /out/lib/the_package/_gleam_artefacts/hello_joe.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 173
expression: "./cases/imported_external_fns"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 237
expression: "./cases/not_overwriting_erlang_module"
---
//// /out/lib/the_package/_gleam_artefacts/app@code.cache

View file

@ -1,13 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 249
expression: "./cases/opaque_type_construct"
---
error: Unknown variable
┌─ src/two.gleam:7:3
7 │ User(name: "Alim", score: 10)
│ ^ Did you mean `Error`?
The name `User` is not in scope here.

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 273
expression: "./cases/overwriting_erlang_module"
---
error: Erlang module name collision

View file

@ -1,6 +1,5 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 316
expression: "./cases/variable_or_module"
---
//// /out/lib/the_package/_gleam_artefacts/main.cache

View file

@ -1,53 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 8
expression: "./cases/alias_unqualified_import"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<77 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([id/1]).
-export_type([empty/0]).
-type empty() :: empty.
-file("src/one.gleam", 2).
-spec id(I) -> I.
id(X) ->
X.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<88 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([make/0]).
-file("src/two.gleam", 4).
-spec make() -> one:empty().
make() ->
one:id(empty).
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.

View file

@ -1,12 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 21
expression: "./cases/duplicate_module"
---
error: Duplicate module
The module `main` is defined multiple times.
First: src/main.gleam
Second: test/main.gleam

View file

@ -1,28 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/erlang_app_generation"
---
//// /out/lib/the_package/_gleam_artefacts/main.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/main.cache_meta
<49 byte binary>
//// /out/lib/the_package/_gleam_artefacts/main.erl
-module(main).
//// /out/lib/the_package/ebin/my_erlang_application.app
{application, my_erlang_application, [
{mod, {'my_erlang_application_sup', []}},
{vsn, "0.1.0"},
{applications, [gleam_otp,
gleam_stdlib,
inets,
midas,
simple_json,
ssl]},
{description, "It's very cool"},
{modules, [main]},
{registered, []}
]}.

View file

@ -1,51 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/erlang_bug_752"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([one/1]).
-type one(I) :: {one, I}.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<84 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([two/1]).
-type two(K) :: {two, one:one(integer())} | {gleam_phantom, K}.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.
//// /out/lib/the_package/include/two_Two.hrl
-record(two, {thing :: one:one(integer())}).

View file

@ -1,22 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/erlang_empty"
---
//// /out/lib/the_package/_gleam_artefacts/empty.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/empty.cache_meta
<49 byte binary>
//// /out/lib/the_package/_gleam_artefacts/empty.erl
-module(empty).
//// /out/lib/the_package/ebin/hello_joe.app
{application, hello_joe, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [empty]},
{registered, []}
]}.

View file

@ -1,65 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 63
expression: "./cases/erlang_escape_names"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<61 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export(['receive'/1]).
-file("src/one.gleam", 2).
-spec 'receive'(I) -> I.
'receive'(X) ->
X.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<136 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([qualified_call/0, qualified_value/0, unqualified_call/0, unqualified_value/0]).
-file("src/two.gleam", 4).
-spec qualified_call() -> integer().
qualified_call() ->
one:'receive'(1).
-file("src/two.gleam", 8).
-spec qualified_value() -> fun((Q) -> Q).
qualified_value() ->
fun one:'receive'/1.
-file("src/two.gleam", 12).
-spec unqualified_call() -> integer().
unqualified_call() ->
one:'receive'(1).
-file("src/two.gleam", 16).
-spec unqualified_value() -> fun((S) -> S).
unqualified_value() ->
fun one:'receive'/1.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.

View file

@ -1,50 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 74
expression: "./cases/erlang_import"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<88 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([unbox/1]).
-file("src/one.gleam", 3).
-spec unbox(two:box()) -> integer().
unbox(X) ->
{box, I} = X,
I.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([box/0]).
-type box() :: {box, integer()}.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.

View file

@ -1,49 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 85
expression: "./cases/erlang_import_shadowing_prelude"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<61 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([error/0]).
-type error() :: error.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<88 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-file("src/two.gleam", 4).
-spec main() -> one:error().
main() ->
error.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.

View file

@ -1,31 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 96
expression: "./cases/erlang_nested"
---
//// /out/lib/the_package/_gleam_artefacts/one@two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one@two.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one@two.erl
-module(one@two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-file("src/one/two.gleam", 1).
-spec main() -> binary().
main() ->
<<"Hi there"/utf8>>.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one@two]},
{registered, []}
]}.

View file

@ -1,40 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/erlang_nested_qualified_constant"
---
//// /out/lib/the_package/_gleam_artefacts/one@two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one@two.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one@two.erl
-module(one@two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([a/0]).
-type a() :: a.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<100 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one@two,
two]},
{registered, []}
]}.

View file

@ -1,31 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 118
expression: "./cases/hello_joe"
---
//// /out/lib/the_package/_gleam_artefacts/hello_joe.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/hello_joe.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/hello_joe.erl
-module(hello_joe).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([main/0]).
-file("src/hello_joe.gleam", 1).
-spec main() -> binary().
main() ->
<<"Hello, Joe!"/utf8>>.
//// /out/lib/the_package/ebin/hello_joe.app
{application, hello_joe, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [hello_joe]},
{registered, []}
]}.

View file

@ -1,17 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/import_cycle"
---
error: Import cycle
┌─ src/one.gleam:1:1
1 │ import one
│ ^ Imported here
The import statements for these modules form a cycle:
┌─────┐
│ one
└─────┘
Gleam doesn't support dependency cycles like these, please break the
cycle to continue.

View file

@ -1,31 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/import_cycle_multi"
---
error: Import cycle
┌─ src/three.gleam:1:1
1 │ import one
│ ^ Imported here
┌─ src/two.gleam:1:1
1 │ import three
│ ^ Imported here
┌─ src/one.gleam:1:1
1 │ import two
│ ^ Imported here
The import statements for these modules form a cycle:
┌─────┐
│ three
│ ↓
│ two
│ ↓
│ one
└─────┘
Gleam doesn't support dependency cycles like these, please break the
cycle to continue.

View file

@ -1,73 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 151
expression: "./cases/import_shadowed_name_warning"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([port_/0]).
-type port_() :: any().
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<120 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([use_type/1]).
-export_type([shadowing/0]).
-type shadowing() :: port.
-file("src/two.gleam", 14).
-spec use_type(one:port_()) -> nil.
use_type(Port) ->
wibble:wobble(Port).
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.
//// Warning
warning: Unused private constructor
┌─ src/two.gleam:9:3
9 │ Port
│ ^ This private constructor is never used
Hint: You can safely remove it.
//// Warning
warning: Unused private type
┌─ src/two.gleam:7:1
7 │ type Shadowing {
│ ^ This private type is never used
Hint: You can safely remove it.

View file

@ -1,107 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 162
expression: "./cases/imported_constants"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<89 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([a/0, b/0, user/0]).
-type a() :: a.
-type b() :: {b, a(), a()}.
-type user() :: {user, binary(), integer()}.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<324 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([accessors/1, destructure_qualified/1, destructure_unqualified/1, destructure_aliased/1, qualified_fn_a/0, qualified_fn_b/0, unqualified_fn_a/0, unqualified_fn_b/0, aliased_fn_a/0, aliased_fn_b/0]).
-file("src/two.gleam", 45).
-spec accessors(one:user()) -> {binary(), integer()}.
accessors(User) ->
Name = erlang:element(2, User),
Score = erlang:element(3, User),
{Name, Score}.
-file("src/two.gleam", 52).
-spec destructure_qualified(one:user()) -> {binary(), integer()}.
destructure_qualified(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 57).
-spec destructure_unqualified(one:user()) -> {binary(), integer()}.
destructure_unqualified(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 62).
-spec destructure_aliased(one:user()) -> {binary(), integer()}.
destructure_aliased(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 6).
-spec qualified_fn_a() -> one:a().
qualified_fn_a() ->
a.
-file("src/two.gleam", 12).
-spec qualified_fn_b() -> one:b().
qualified_fn_b() ->
{b, a, a}.
-file("src/two.gleam", 19).
-spec unqualified_fn_a() -> one:a().
unqualified_fn_a() ->
a.
-file("src/two.gleam", 25).
-spec unqualified_fn_b() -> one:b().
unqualified_fn_b() ->
{b, a, a}.
-file("src/two.gleam", 33).
-spec aliased_fn_a() -> one:a().
aliased_fn_a() ->
a.
-file("src/two.gleam", 39).
-spec aliased_fn_b() -> one:b().
aliased_fn_b() ->
{b, a, a}.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.
//// /out/lib/the_package/include/one_User.hrl
-record(user, {name :: binary(), score :: integer()}).

View file

@ -1,97 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 173
expression: "./cases/imported_external_fns"
---
//// /out/lib/the_package/_gleam_artefacts/one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one.cache_meta
<53 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one.erl
-module(one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([thing/0]).
-file("src/one.gleam", 2).
-spec thing() -> nil.
thing() ->
thing:new().
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<319 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([fn_reference_qualified/0, fn_reference_qualified_aliased/0, fn_reference_unqualified/0, fn_reference_unqualified_aliased/0, fn_call_qualified/0, fn_call_qualified_aliased/0, fn_call_unqualified/0, fn_call_unqualified_aliased/0, the_consts/0]).
-file("src/two.gleam", 27).
-spec fn_reference_qualified() -> fun(() -> nil).
fn_reference_qualified() ->
fun thing:new/0.
-file("src/two.gleam", 31).
-spec fn_reference_qualified_aliased() -> fun(() -> nil).
fn_reference_qualified_aliased() ->
fun thing:new/0.
-file("src/two.gleam", 35).
-spec fn_reference_unqualified() -> fun(() -> nil).
fn_reference_unqualified() ->
fun thing:new/0.
-file("src/two.gleam", 39).
-spec fn_reference_unqualified_aliased() -> fun(() -> nil).
fn_reference_unqualified_aliased() ->
fun thing:new/0.
-file("src/two.gleam", 45).
-spec fn_call_qualified() -> nil.
fn_call_qualified() ->
thing:new().
-file("src/two.gleam", 49).
-spec fn_call_qualified_aliased() -> nil.
fn_call_qualified_aliased() ->
thing:new().
-file("src/two.gleam", 53).
-spec fn_call_unqualified() -> nil.
fn_call_unqualified() ->
thing:new().
-file("src/two.gleam", 57).
-spec fn_call_unqualified_aliased() -> nil.
fn_call_unqualified_aliased() ->
thing:new().
-file("src/two.gleam", 14).
-spec the_consts() -> nil.
the_consts() ->
_ = fun thing:new/0,
_ = fun thing:new/0,
_ = fun thing:new/0,
_ = fun thing:new/0,
thing:new(),
thing:new(),
thing:new(),
thing:new().
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one,
two]},
{registered, []}
]}.

View file

@ -1,143 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 184
expression: "./cases/imported_record_constructors"
---
//// /out/lib/the_package/_gleam_artefacts/one@one.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one@one.cache_meta
<89 byte binary>
//// /out/lib/the_package/_gleam_artefacts/one@one.erl
-module(one@one).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export_type([a/0, b/0, user/0]).
-type a() :: a.
-type b() :: {b, a(), a()}.
-type user() :: {user, binary(), integer()}.
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<491 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.erl
-module(two).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([accessors/1, destructure_qualified/1, destructure_qualified_aliased/1, destructure_unqualified/1, destructure_aliased/1, update_qualified/1, update_qualified_aliased/1, update_unqualified/1, update_aliased/1, qualified_fn_a/0, qualified_fn_b/0, qualified_aliased_fn_a/0, qualified_aliased_fn_b/0, unqualified_fn_a/0, unqualified_fn_b/0, aliased_fn_a/0, aliased_fn_b/0]).
-file("src/two.gleam", 58).
-spec accessors(one@one:user()) -> {binary(), integer()}.
accessors(User) ->
Name = erlang:element(2, User),
Score = erlang:element(3, User),
{Name, Score}.
-file("src/two.gleam", 65).
-spec destructure_qualified(one@one:user()) -> {binary(), integer()}.
destructure_qualified(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 70).
-spec destructure_qualified_aliased(one@one:user()) -> {binary(), integer()}.
destructure_qualified_aliased(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 75).
-spec destructure_unqualified(one@one:user()) -> {binary(), integer()}.
destructure_unqualified(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 80).
-spec destructure_aliased(one@one:user()) -> {binary(), integer()}.
destructure_aliased(User) ->
{user, Name, Score} = User,
{Name, Score}.
-file("src/two.gleam", 86).
-spec update_qualified(one@one:user()) -> one@one:user().
update_qualified(User) ->
erlang:setelement(2, User, <<"wibble"/utf8>>).
-file("src/two.gleam", 90).
-spec update_qualified_aliased(one@one:user()) -> one@one:user().
update_qualified_aliased(User) ->
erlang:setelement(2, User, <<"wibble"/utf8>>).
-file("src/two.gleam", 94).
-spec update_unqualified(one@one:user()) -> one@one:user().
update_unqualified(User) ->
erlang:setelement(2, User, <<"wibble"/utf8>>).
-file("src/two.gleam", 98).
-spec update_aliased(one@one:user()) -> one@one:user().
update_aliased(User) ->
erlang:setelement(2, User, <<"wibble"/utf8>>).
-file("src/two.gleam", 7).
-spec qualified_fn_a() -> one@one:a().
qualified_fn_a() ->
a.
-file("src/two.gleam", 13).
-spec qualified_fn_b() -> one@one:b().
qualified_fn_b() ->
{b, a, a}.
-file("src/two.gleam", 19).
-spec qualified_aliased_fn_a() -> one@one:a().
qualified_aliased_fn_a() ->
a.
-file("src/two.gleam", 25).
-spec qualified_aliased_fn_b() -> one@one:b().
qualified_aliased_fn_b() ->
{b, a, a}.
-file("src/two.gleam", 32).
-spec unqualified_fn_a() -> one@one:a().
unqualified_fn_a() ->
a.
-file("src/two.gleam", 38).
-spec unqualified_fn_b() -> one@one:b().
unqualified_fn_b() ->
{b, a, a}.
-file("src/two.gleam", 46).
-spec aliased_fn_a() -> one@one:a().
aliased_fn_a() ->
a.
-file("src/two.gleam", 52).
-spec aliased_fn_b() -> one@one:b().
aliased_fn_b() ->
{b, a, a}.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [one@one,
two]},
{registered, []}
]}.
//// /out/lib/the_package/include/one@one_User.hrl
-record(user, {name :: binary(), score :: integer()}).

View file

@ -1,38 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/javascript_d_ts"
---
//// /out/lib/the_package/_gleam_artefacts/hello.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/hello.cache_meta
<73 byte binary>
//// /out/lib/the_package/gleam.d.mts
export * from "../prelude.mjs";
export type * from "../prelude.d.mts";
//// /out/lib/the_package/gleam.mjs
export * from "../prelude.mjs";
//// /out/lib/the_package/hello.d.mts
import type * as _ from "./gleam.d.mts";
export class Woo extends _.CustomType {}
export type Wibble$ = Woo;
export function wobble(): Wibble$;
//// /out/lib/the_package/hello.mjs
/// <reference types="./hello.d.mts" />
import { CustomType as $CustomType } from "./gleam.mjs";
export class Woo extends $CustomType {}
export function wobble() {
return new Woo();
}

View file

@ -1,16 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/javascript_empty"
---
//// /out/lib/the_package/_gleam_artefacts/empty.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/empty.cache_meta
<49 byte binary>
//// /out/lib/the_package/empty.mjs
export {}
//// /out/lib/the_package/gleam.mjs
export * from "../prelude.mjs";

View file

@ -1,51 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/javascript_import"
---
//// /out/lib/the_package/_gleam_artefacts/one@two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/one@two.cache_meta
<57 byte binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/two.cache_meta
<80 byte binary>
//// /out/lib/the_package/gleam.d.mts
export * from "../prelude.mjs";
export type * from "../prelude.d.mts";
//// /out/lib/the_package/gleam.mjs
export * from "../prelude.mjs";
//// /out/lib/the_package/one/two.d.mts
import type * as _ from "../gleam.d.mts";
export class A extends _.CustomType {}
export type A$ = A;
//// /out/lib/the_package/one/two.mjs
/// <reference types="./two.d.mts" />
import { CustomType as $CustomType } from "../gleam.mjs";
export class A extends $CustomType {}
//// /out/lib/the_package/two.d.mts
import type * as $two from "./one/two.d.mts";
export const x: $two.A$;
//// /out/lib/the_package/two.mjs
/// <reference types="./two.d.mts" />
import * as $two from "./one/two.mjs";
export const x = /* @__PURE__ */ new $two.A();

View file

@ -1,23 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 237
expression: "./cases/not_overwriting_erlang_module"
---
//// /out/lib/the_package/_gleam_artefacts/app@code.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/app@code.cache_meta
<65 byte binary>
//// /out/lib/the_package/_gleam_artefacts/app@code.erl
-module(app@code).
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [app@code]},
{registered, []}
]}.

View file

@ -1,27 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/opaque_type_accessor"
---
error: Unknown record field
┌─ src/two.gleam:7:18
7 │ let name = user.name
│ ^ This field does not exist
The value being accessed has this type:
User
It does not have any fields.
error: Unknown record field
┌─ src/two.gleam:8:19
8 │ let score = user.score
│ ^ This field does not exist
The value being accessed has this type:
User
It does not have any fields.

View file

@ -1,13 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 249
expression: "./cases/opaque_type_construct"
---
error: Unknown variable
┌─ src/two.gleam:7:3
7 │ User(name: "Alim", score: 10)
│ ^ Did you mean `Error`?
The name `User` is not in scope here.

View file

@ -1,19 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/opaque_type_destructure"
---
error: Unknown module value
┌─ src/two.gleam:7:7
7 │ let one.User(name: name, score: score) = user
│ ^
The module `one` does not have a `User` value.
error: Unknown variable
┌─ src/two.gleam:8:5
8 │ #(name, score)
│ ^
The name `name` is not in scope here.

View file

@ -1,14 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 273
expression: "./cases/overwriting_erlang_module"
---
error: Erlang module name collision
The module `src/code.gleam` compiles to an Erlang module named `code`.
By default Erlang includes a module with the same name so if we were to
compile and load your module it would overwrite the Erlang one, potentially
causing confusing errors and crashes.
Hint: Rename this module and try again.

View file

@ -1,16 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 273
expression: "./cases/src_importing_test"
---
error: App importing test module
┌─ src/one.gleam:3:1
3 │ import two
│ ^ Imported here
The application module `one` is importing the test module `two`.
Test modules are not included in production builds so test modules cannot
import them. Perhaps move the `two` module to the src directory.

View file

@ -1,11 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/unknown_module_field_in_constant"
---
error: Unknown module value
┌─ src/two.gleam:3:16
3 │ pub const it = one.B
│ ^ Did you mean `A`?
The module `one` does not have a `B` value.

View file

@ -1,11 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/unknown_module_field_in_expression"
---
error: Unknown module value
┌─ src/two.gleam:4:6
4 │ one.B
│ ^ Did you mean `A`?
The module `one` does not have a `B` value.

View file

@ -1,11 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
expression: "./cases/unknown_module_field_in_import"
---
error: Unknown module value
┌─ src/two.gleam:1:13
1 │ import one.{B}
│ ^ Did you mean `A`?
The module `one` does not have a `B` value.

View file

@ -1,62 +0,0 @@
---
source: test-package-compiler/src/generated_tests.rs
assertion_line: 316
expression: "./cases/variable_or_module"
---
//// /out/lib/the_package/_gleam_artefacts/main.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/main.cache_meta
<118 byte binary>
//// /out/lib/the_package/_gleam_artefacts/main.erl
-module(main).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([module_function/1, record_field/1]).
-file("src/main.gleam", 4).
-spec module_function(power:power()) -> integer().
module_function(Power) ->
power:to_int(Power).
-file("src/main.gleam", 10).
-spec record_field(power:power()) -> integer().
record_field(Power) ->
erlang:element(2, Power).
//// /out/lib/the_package/_gleam_artefacts/power.cache
<.cache binary>
//// /out/lib/the_package/_gleam_artefacts/power.cache_meta
<77 byte binary>
//// /out/lib/the_package/_gleam_artefacts/power.erl
-module(power).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([to_int/1]).
-export_type([power/0]).
-type power() :: {power, integer()}.
-file("src/power.gleam", 6).
-spec to_int(power()) -> integer().
to_int(P) ->
erlang:element(2, P) * 9000.
//// /out/lib/the_package/ebin/importy.app
{application, importy, [
{vsn, "0.1.0"},
{applications, []},
{description, ""},
{modules, [main,
power]},
{registered, []}
]}.
//// /out/lib/the_package/include/power_Power.hrl
-record(power, {value :: integer()}).

View file

@ -1,6 +1,5 @@
---
source: test-project-compiler/src/generated_tests.rs
assertion_line: 10
expression: "./cases/with_dep"
---
//// with_dep/build/dev/erlang/example/_gleam_artefacts/example@@main.erl

View file

@ -1,6 +1,5 @@
---
source: test-project-compiler/src/generated_tests.rs
assertion_line: 32
expression: "./cases/with_dep"
---
//// with_dep/build/lsp/erlang/example/_gleam_artefacts/example@@main.erl

View file

@ -1,6 +1,5 @@
---
source: test-project-compiler/src/generated_tests.rs
assertion_line: 21
expression: "./cases/with_dep"
---
//// with_dep/build/prod/erlang/example/_gleam_artefacts/example@@main.erl

View file

@ -1,6 +1,5 @@
---
source: test-project-compiler/src/generated_tests.rs
assertion_line: 43
expression: "./cases/with_dev_dep"
---
//// with_dev_dep/build/dev/erlang/example/_gleam_artefacts/example@@main.erl

View file

@ -1,6 +1,5 @@
---
source: test-project-compiler/src/generated_tests.rs
assertion_line: 65
expression: "./cases/with_dev_dep"
---
//// with_dev_dep/build/lsp/erlang/example/_gleam_artefacts/example@@main.erl

View file

@ -1,6 +1,5 @@
---
source: test-project-compiler/src/generated_tests.rs
assertion_line: 54
expression: "./cases/with_dev_dep"
---
//// with_dev_dep/build/prod/erlang/example/_gleam_artefacts/example@@main.erl