From 9bb5c285f007d4d2f83ff5593db5afa7fa2a0310 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 10 Dec 2018 15:53:26 -0200 Subject: persist: handle keys that are keywords correctly. Closes #947. --- spec/persist_spec.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') diff --git a/spec/persist_spec.lua b/spec/persist_spec.lua index dccb0ec4..734b2a4e 100644 --- a/spec/persist_spec.lua +++ b/spec/persist_spec.lua @@ -36,6 +36,14 @@ foo = { ]], persist.save_from_table_to_string({foo = {1, 2, 3, 4}, bar = {baz = "string"}})) end) + it("table with a keyword key (#947)", function() + assert.are.same([[ +bar = { + ["function"] = "foo" +} +]], persist.save_from_table_to_string({bar = {["function"] = "foo"}})) + end) + it("strings with quotes", function() assert.are.same([[ bar = "a \\backslash?" -- cgit v1.2.3-55-g6feb