summaryrefslogtreecommitdiff
path: root/tests/features/test_embed.zc
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 15:12:12 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-25 15:12:12 +0000
commit7d1944ab9d2307f2736afe8520436872db1c7617 (patch)
tree7380a4f148f9ce0b70ed9f02cfa5e8561c783a7a /tests/features/test_embed.zc
parent8b720543f538862796fec0ff6b7ea12cb140bf0f (diff)
'let' it be
Diffstat (limited to 'tests/features/test_embed.zc')
-rw-r--r--tests/features/test_embed.zc24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/features/test_embed.zc b/tests/features/test_embed.zc
index 33acef2..ad7247c 100644
--- a/tests/features/test_embed.zc
+++ b/tests/features/test_embed.zc
@@ -2,22 +2,22 @@
test "test_embed" {
"=> Static File Analyzer";
- var data = embed "std.zc";
+ let data = embed "std.zc";
"Target File: 'std.zc'";
"File Size: {data.len} bytes";
"";
- var lines: I32 = 1;
- var words: I32 = 0;
- var sum: U64 = 0;
- var in_word: bool = 0;
+ let lines: I32 = 1;
+ let words: I32 = 0;
+ let sum: U64 = 0;
+ let in_word: bool = 0;
"Analyzing content...";
- var i: int = 0;
+ let i: int = 0;
while (i < data.len) {
- var c: char = data.data[i];
+ let c: char = data.data[i];
match c {
'\n' => {
@@ -37,7 +37,7 @@ test "test_embed" {
}
}
- var b: U8 = c;
+ let b: U8 = c;
sum = sum + b;
i++;
@@ -57,7 +57,7 @@ test "test_embed" {
test "typed_embed" {
// String
- var s = embed "tests/features/embed_data.txt" as string;
+ let s = embed "tests/features/embed_data.txt" as string;
// "Hello World!\n" ? No newline in my file creation?
// echo "Hello World!" > ... likely adds newline.
// My previous tool 'write_to_file' wrote "Hello World!". It usually doesn't add newline unless specified?
@@ -65,17 +65,17 @@ test "typed_embed" {
if (s[0] != 'H') exit(101);
// Fixed array
- var arr = embed "tests/features/embed_data.txt" as u8[5];
+ let arr = embed "tests/features/embed_data.txt" as u8[5];
if (arr[0] != 'H') exit(102);
if (arr[4] != 'o') exit(103);
// Slice
- var sl = embed "tests/features/embed_data.txt" as u8[];
+ let sl = embed "tests/features/embed_data.txt" as u8[];
if (sl.len < 5) exit(104);
if (sl.data[0] != 'H') exit(105);
// Untyped regression
- var raw = embed "tests/features/embed_data.txt";
+ let raw = embed "tests/features/embed_data.txt";
if (raw.len < 5) exit(106);
if (raw.data[0] != 'H') exit(107);