Skip to content

Commit

Permalink
add test files
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Dec 12, 2023
1 parent 0167f28 commit cd8f512
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/src/01-01.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub fn main() !void {
defer _ = gpa.deinit();
const allocator = gpa.allocator();

const file = try fs.cwd().openFile("build.zig", .{});
const file = try fs.cwd().openFile("tests/hello-world.txt", .{});
defer file.close();

const rdr = file.reader();
Expand Down
2 changes: 1 addition & 1 deletion examples/src/02-01.zig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn main() !void {
defer _ = gpa.deinit();
const allocator = gpa.allocator();

const file = try fs.cwd().openFile("build.zig", .{});
const file = try fs.cwd().openFile("tests/hello-world.txt", .{});
defer file.close();

const digest = try sha256_digest(allocator, file);
Expand Down
3 changes: 3 additions & 0 deletions examples/tests/hello-world.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Hello Zig. 😁

I love Zig very much!
2 changes: 1 addition & 1 deletion src/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Each recipe is accompanied by an illustrative example named after its correspond
# Contributing

Anyone is welcome to contribute. This project use [prettier](https://prettier.io/) to format markdown files, make sure to execute `make lint` before open PR.
This cookbook is a work in progress, and we welcome contributions from the community. If you have a favorite recipe that you'd like to share, please submit a pull request.

# Acknowledgment

Expand Down

0 comments on commit cd8f512

Please sign in to comment.