summaryrefslogtreecommitdiff
path: root/tests/features/test_embed.zc
diff options
context:
space:
mode:
authorSAJJA EASWAR <eshwarsajja20@gmail.com>2026-01-25 22:59:36 +0530
committerSAJJA EASWAR <eshwarsajja20@gmail.com>2026-01-25 22:59:36 +0530
commitebc8b94baa6bc694cb4829e2eb2934a1f17fa6a1 (patch)
tree71b952ad455bf17d5bdea01472f0e2297f25eabe /tests/features/test_embed.zc
parent863118c95caac0d69a35f6ae4d2e83844734a8a1 (diff)
parent489336b2101bf16edeec7bfc4379408eb19b936e (diff)
Merge branch 'main' into pr-109
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);