aboutsummaryrefslogtreecommitdiff
path: root/test/unit/formatc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/formatc.lua')
-rw-r--r--test/unit/formatc.lua15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/unit/formatc.lua b/test/unit/formatc.lua
index 00637e0b8d..2fd37c599a 100644
--- a/test/unit/formatc.lua
+++ b/test/unit/formatc.lua
@@ -65,11 +65,12 @@ local tokens = P { "tokens";
identifier = Ct(C(R("az","AZ","__") * R("09","az","AZ","__")^0) * Cc"identifier"),
-- Single character in a string
- string_char = R("az","AZ","09") + S"$%^&*()_-+={[}]:;@~#<,>.!?/ \t" + (P"\\" * S[[ntvbrfa\?'"0x]]),
+ sstring_char = R("\001&","([","]\255") + (P"\\" * S[[ntvbrfa\?'"0x]]),
+ dstring_char = R("\001!","#[","]\255") + (P"\\" * S[[ntvbrfa\?'"0x]]),
-- String literal
- string = Ct(C(P"'" * (V"string_char" + P'"')^0 * P"'" +
- P'"' * (V"string_char" + P"'")^0 * P'"') * Cc"string"),
+ string = Ct(C(P"'" * (V"sstring_char" + P'"')^0 * P"'" +
+ P'"' * (V"dstring_char" + P"'")^0 * P'"') * Cc"string"),
-- Operator
operator = Ct(C(P">>=" + P"<<=" + P"..." +
@@ -219,13 +220,7 @@ local function standalone(...) -- luacheck: ignore
Preprocess.add_to_include_path('./../../build/include')
Preprocess.add_to_include_path('./../../.deps/usr/include')
- local input = Preprocess.preprocess_stream(arg[1])
- local raw = input:read('*all')
- input:close()
-
- if raw == nil then
- print("ERROR: Preprocess.preprocess_stream():read() returned empty")
- end
+ local raw = Preprocess.preprocess('', arg[1])
local formatted
if #arg == 2 and arg[2] == 'no' then