mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
add test case for ingesting as bytes with type hole
This commit is contained in:
parent
165ffcf38d
commit
df9f5a946e
3 changed files with 33 additions and 0 deletions
|
@ -895,6 +895,23 @@ main =
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial(cli_platform)]
|
||||
#[cfg_attr(windows, ignore)]
|
||||
fn ingested_file_bytes() {
|
||||
test_roc_app(
|
||||
"examples/cli",
|
||||
"ingested-file-bytes.roc",
|
||||
"ingested-file-bytes",
|
||||
&[],
|
||||
&[],
|
||||
&[],
|
||||
"22424\n",
|
||||
UseValgrind::No,
|
||||
TestCliCommands::Run,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial(parser_package)]
|
||||
#[serial(zig_platform)]
|
||||
|
|
1
examples/cli/.gitignore
vendored
1
examples/cli/.gitignore
vendored
|
@ -8,4 +8,5 @@ http-get
|
|||
file-io
|
||||
env
|
||||
ingested-file
|
||||
ingested-file-bytes
|
||||
out.txt
|
15
examples/cli/ingested-file-bytes.roc
Normal file
15
examples/cli/ingested-file-bytes.roc
Normal file
|
@ -0,0 +1,15 @@
|
|||
app "ingested-file-bytes"
|
||||
packages { pf: "cli-platform/main.roc" }
|
||||
imports [
|
||||
pf.Stdout,
|
||||
"ingested-file.roc" as ownCode : _, # A type hole can also be used here.
|
||||
]
|
||||
provides [main] to pf
|
||||
|
||||
main =
|
||||
# Due to how ownCode is used, it will be a List U8.
|
||||
ownCode
|
||||
|> List.map Num.toNat
|
||||
|> List.sum
|
||||
|> Num.toStr
|
||||
|> Stdout.line
|
Loading…
Add table
Add a link
Reference in a new issue