Skip to content

Commit

Permalink
update fuzz package
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenVoich committed Nov 16, 2023
1 parent 73a1f05 commit 24641ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mops.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ datetime = "0.1.0"

[dev-dependencies]
test = "1.0.0"
fuzz = "0.1.0"
fuzz = "0.1.1"
bench = "1.0.0"
10 changes: 5 additions & 5 deletions test/users.test.mo
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ import Users "../backend/main/users";

let fuzz = Fuzz.Fuzz();
let users = Users.Users();
let aliceId = fuzz.principal.randomPrincipal(29);
let aliceId = fuzz.principal.random();

func ensureNewUser() : Principal {
let userId = fuzz.principal.randomPrincipal(29);
let userId = fuzz.principal.random();
users.ensureUser(userId);
userId;
};

test("get unkown user", func() {
assert users.getUserOpt(fuzz.principal.randomPrincipal(29)) == null;
assert users.getUserOpt(fuzz.principal.randomPrincipal(29)) == null;
assert users.getUserOpt(fuzz.principal.random()) == null;
assert users.getUserOpt(fuzz.principal.random()) == null;
});

test("register Alice", func() {
users.ensureUser(aliceId);
});

test("setName before user created", func() {
let userId = fuzz.principal.randomPrincipal(29);
let userId = fuzz.principal.random();
assert Result.isErr(users.setName(userId, "alice"));
});

Expand Down

0 comments on commit 24641ba

Please sign in to comment.