cli: add supplied-buffer decimal integer formatting to std

This commit is contained in:
dev committed 2026-10-06 17:18:33 +03:00
1 parent 3bb11e03b2
commit 618b4b95c1
30 files changed
+3609 -11

No files matched your search

+3 -2
View File
@@ -115,14 +115,15 @@ test "standard imports lower identically in either order" {
defer a.deinit();
const arena = a.allocator();
const body = "fn main() -> u64\neffects []\n{ return std.math.min_u64(7, 11); }\n";
const first = try checkFile(arena, "a.aji", try std.mem.concat(arena, u8, &.{ "module t\nimport std.math;\nimport std.bytes;\nimport std.utf8;\nimport std.encoding.hex;\nimport std.encoding.base64;\n", body }));
const second = try checkFile(arena, "/another/directory/b.aji", try std.mem.concat(arena, u8, &.{ "module t\nimport std.encoding.base64;\nimport std.encoding.hex;\nimport std.bytes;\nimport std.math;\nimport std.utf8;\n", body }));
const first = try checkFile(arena, "a.aji", try std.mem.concat(arena, u8, &.{ "module t\nimport std.math;\nimport std.bytes;\nimport std.utf8;\nimport std.fmt;\nimport std.encoding.hex;\nimport std.encoding.base64;\n", body }));
const second = try checkFile(arena, "/another/directory/b.aji", try std.mem.concat(arena, u8, &.{ "module t\nimport std.encoding.base64;\nimport std.encoding.hex;\nimport std.bytes;\nimport std.math;\nimport std.fmt;\nimport std.utf8;\n", body }));
try std.testing.expectEqual(Status.accepted, first.status);
try std.testing.expectEqual(Status.accepted, second.status);
try std.testing.expectEqualStrings(first.lowered.?.air, second.lowered.?.air);
// Imported code enters the ordinary verifier with its original locations.
try std.testing.expect(std.mem.indexOf(u8, first.lowered.?.annotated, "; std/bytes.aji:") != null);
try std.testing.expect(std.mem.indexOf(u8, first.lowered.?.annotated, "; std/utf8.aji:") != null);
try std.testing.expect(std.mem.indexOf(u8, first.lowered.?.annotated, "; std/fmt.aji:") != null);
try std.testing.expect(std.mem.indexOf(u8, first.lowered.?.annotated, "; std/encoding/hex.aji:") != null);
try std.testing.expect(std.mem.indexOf(u8, first.lowered.?.annotated, "; std/encoding/base64.aji:") != null);
try std.testing.expect(std.mem.indexOf(u8, first.lowered.?.air, "intrinsic ") == null);
+1
View File
@@ -11,6 +11,7 @@ const registry = [_]Entry{
.{ .name = "std.bytes", .file = "std/bytes.aji", .source = @embedFile("std_bytes_aji") },
.{ .name = "std.encoding.base64", .file = "std/encoding/base64.aji", .source = @embedFile("std_encoding_base64_aji") },
.{ .name = "std.encoding.hex", .file = "std/encoding/hex.aji", .source = @embedFile("std_encoding_hex_aji") },
.{ .name = "std.fmt", .file = "std/fmt.aji", .source = @embedFile("std_fmt_aji") },
.{ .name = "std.math", .file = "std/math.aji", .source = @embedFile("std_math_aji") },
.{ .name = "std.utf8", .file = "std/utf8.aji", .source = @embedFile("std_utf8_aji") },
};