From ca89d65513c57c6517d5190d33f0bbc690ba5d46 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 14 May 2022 16:01:37 -0400 Subject: Better error handling --- Lua/test.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lua/test.lua') 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)") -- cgit v1.2.3