Fix formatter discarding nul bytes.

This commit is contained in:
KtorZ
2024-03-09 18:59:35 +01:00
parent b761d6a76d
commit d581183cc6
4 changed files with 24 additions and 1 deletions

View File

@@ -20,6 +20,18 @@ fn format_simple_module() {
);
}
#[test]
fn format_nul_byte() {
assert_format!(
r#"
fn label(str: String) -> Void {
str
|> builtin.append_string(@"\0", _)
|> builtin.debug(Void)
}"#
);
}
#[test]
fn format_g1_element_constant() {
assert_format!(

View File

@@ -0,0 +1,9 @@
---
source: crates/aiken-lang/src/tests/format.rs
description: "Code:\n\nfn label(str: String) -> Void {\n str\n |> builtin.append_string(@\"\\0\", _)\n |> builtin.debug(Void)\n}"
---
fn label(str: String) -> Void {
str
|> builtin.append_string(@"\0", _)
|> builtin.debug(Void)
}