diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-05-14 16:01:37 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-05-14 16:01:37 -0400 |
| commit | ca89d65513c57c6517d5190d33f0bbc690ba5d46 (patch) | |
| tree | 6cfba39eeccba4c9f23aa2d07503533bf3c352e6 /Lua/test.lua | |
| parent | 563ecf332ee6e79f0cc7361e00a09963723fd402 (diff) | |
Better error handling
Diffstat (limited to 'Lua/test.lua')
| -rw-r--r-- | Lua/test.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lua/test.lua b/Lua/test.lua index 731b044..d812009 100644 --- a/Lua/test.lua +++ b/Lua/test.lua @@ -54,3 +54,10 @@ print(pat:replace("{@0}", "...baz...")) for m in pat:matches("hello world") do print(m) end + + +local ok, err = pcall(function() + bp.match("nonexistent", "xxx") +end) +assert(not ok) +print("(Successfully caught pattern matching error)") |
