Skip to content

Commit

Permalink
feat(test API): testfindall() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Demali-876 committed Nov 15, 2024
1 parent 47842ea commit 33b4e06
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/test/lib.test.mo
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ actor {
#err(e);
};
};
};
public query func testFindAll(aregextext: Pattern, pattern: Text) : async Result.Result<[Types.Match], Types.RegexError> {
let regex = Regex.Regex(aregextext, null);
switch (regex.findAll(pattern)) {
case (#ok(matches)) {
#ok(matches);
};
case (#err(e)) {
#err(e);
};
};
}

}

0 comments on commit 33b4e06

Please sign in to comment.