-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rewrite a lot of things (#2)
* refactor: rewrite a lot of things * add docs and demo app build step * rewrite most of Colors functions * add fg and bg function to ComptimeColors * add more unit test
- Loading branch information
1 parent
f2b2146
commit be61878
Showing
11 changed files
with
386 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
# Zig | ||
zig-cache/ | ||
zig-out/ | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const std = @import("std"); | ||
|
||
pub fn main() !void { | ||
// Prints to stderr (it's a shortcut based on `std.io.getStdErr()`) | ||
std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); | ||
|
||
// stdout is for the actual output of your application, for example if you | ||
// are implementing gzip, then only the compressed bytes should be sent to | ||
// stdout, not any debugging messages. | ||
const stdout_file = std.io.getStdOut().writer(); | ||
var bw = std.io.bufferedWriter(stdout_file); | ||
const stdout = bw.writer(); | ||
|
||
try stdout.print("Run `zig build test` to run the tests.\n", .{}); | ||
|
||
try bw.flush(); // don't forget to flush! | ||
} | ||
|
||
test "simple test" { | ||
var list = std.ArrayList(i32).init(std.testing.allocator); | ||
defer list.deinit(); // try commenting this out and see if zig detects the memory leak! | ||
try list.append(42); | ||
try std.testing.expectEqual(@as(i32, 42), list.pop()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
pub const Colors = @import("colors.zig").Colors; | ||
pub const ComptimeColors = @import("colors.zig").ComptimeColors; | ||
pub const createColors = @import("colors.zig").createColors; | ||
|
||
pub const ComptimeColors = @import("comptime_colors.zig").ComptimeColors; | ||
|
||
pub const utils = @import("utils.zig"); | ||
|
||
test { | ||
_ = @import("tests/comptime_colors_test.zig"); | ||
_ = @import("tests/colors_test.zig"); | ||
_ = @import("tests/utils_test.zig"); | ||
} |
Oops, something went wrong.