diff --git a/spec/helpers.moon b/spec/helpers.moon new file mode 100644 index 0000000..c5ddf9f --- /dev/null +++ b/spec/helpers.moon @@ -0,0 +1,9 @@ + +-- remove front indentation from a multiline string, making it suitable to be +-- parsed +unindent = (str) -> + indent = str\match "^%s+" + return str unless indent + (str\gsub("\n#{indent}", "\n")\gsub "%s+$", "") + +{ :unindent }