aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/test.lua b/test.lua
index 4263ff4..439b6cb 100755
--- a/test.lua
+++ b/test.lua
@@ -1,7 +1,5 @@
1#!/usr/bin/env lua 1#!/usr/bin/env lua
2 2
3-- $Id: test.lua $
4
5-- require"strict" -- just to be pedantic 3-- require"strict" -- just to be pedantic
6 4
7local m = require"lpeg" 5local m = require"lpeg"
@@ -1394,6 +1392,12 @@ e = compile([[
1394e = compile("{[0-9]+'.'?[0-9]*} -> sin", math) 1392e = compile("{[0-9]+'.'?[0-9]*} -> sin", math)
1395assert(e:match("2.34") == math.sin(2.34)) 1393assert(e:match("2.34") == math.sin(2.34))
1396 1394
1395e = compile("'pi' -> math", _G)
1396assert(e:match("pi") == math.pi)
1397
1398e = compile("[ ]* 'version' -> _VERSION", _G)
1399assert(e:match(" version") == _VERSION)
1400
1397 1401
1398function eq (_, _, a, b) return a == b end 1402function eq (_, _, a, b) return a == b end
1399 1403