Revert "Merge pull request #478 from Shopify/numbers-in-identifiers"

This reverts commit 263e90e772, reversing
changes made to 4dc682313f.
This commit is contained in:
Florian Weingarten
2014-11-07 01:48:05 +00:00
parent 4b1835e3c0
commit b242a7273a
5 changed files with 17 additions and 16 deletions
+1 -4
View File
@@ -32,10 +32,7 @@ class LexerUnitTest < Minitest::Test
def test_fancy_identifiers
tokens = Lexer.new('hi five?').tokenize
assert_equal [[:id, 'hi'], [:id, 'five?'], [:end_of_string]], tokens
tokens = Lexer.new('2foo').tokenize
assert_equal [[:number, '2'], [:id, 'foo'], [:end_of_string]], tokens
assert_equal [[:id,'hi'], [:id, 'five'], [:question, '?'], [:end_of_string]], tokens
end
def test_whitespace
-11
View File
@@ -102,17 +102,6 @@ class VariableUnitTest < Minitest::Test
assert_equal 1000.01, var.name
end
def test_dashes
assert_equal VariableLookup.new('foo-bar'), Variable.new('foo-bar').name
assert_equal VariableLookup.new('foo-bar-2'), Variable.new('foo-bar-2').name
with_error_mode :strict do
assert_raises(Liquid::SyntaxError) { Variable.new('foo - bar') }
assert_raises(Liquid::SyntaxError) { Variable.new('-foo') }
assert_raises(Liquid::SyntaxError) { Variable.new('2foo') }
end
end
def test_string_with_special_chars
var = Variable.new(%| 'hello! $!@.;"ddasd" ' |)
assert_equal 'hello! $!@.;"ddasd" ', var.name