roc/crates/cli/tests/benchmarks/test_base64.roc
Jan 68e524e110
snake_case-ify all remaining camelCase names in hiding (#7561)
* Snake-case-ify def names in comments

* Snake-case-ify def names in strings

* Snake-case-ify ignored function parameters

* Snake-case-ify test script names, for consistency

* Update CI snapshot to match snake_case

* snake case correction

---------

Co-authored-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-02-05 16:05:03 +01:00

15 lines
474 B
Text

app [main!] { pf: platform "platform/main.roc" }
import Base64
import pf.Host
main! : {} => {}
main! = \{} ->
when Base64.from_bytes(Str.to_utf8("Hello World")) is
Err(_) -> Host.put_line!("sadness")
Ok(encoded) ->
Host.put_line!(Str.concat("encoded: ", encoded))
when Base64.to_str(encoded) is
Ok(decoded) -> Host.put_line!(Str.concat("decoded: ", decoded))
Err(_) -> Host.put_line!("sadness")