예제 #1
0
		public void Can_tokenize_multiple_brackets()
		{
			var lexer = new LispLexer();
			var list = "(() (()()()())";
			var result = lexer.GetTokenList(list);
			var expected = new[] { "(", "(", ")", "(", "(", ")", "(", ")", "(", ")", "(", ")", ")" };
			CollectionAssert.AreEqual(expected, result);
		}
예제 #2
0
		public void Can_tokenize_integer()
		{
			var lexer = new LispLexer();
			var list = "(1 22 3456789 )";
			var result = lexer.GetTokenList(list);
			var expected = new[] { "(", "1", "22", "3456789", ")" };
			CollectionAssert.AreEqual(expected, result);
		}
예제 #3
0
		public void Can_tokenize_empty_string()
		{
			var lexer = new LispLexer();
			var list = "";
			var result = lexer.GetTokenList(list);
			var expected = new string[0];
			CollectionAssert.AreEqual(expected, result);
		}
예제 #4
0
		public void Can_tokenize_quoted_strings()
		{
			var lexer = new LispLexer();
			var list = "(test \"neki string\" \"drugi string\")";
			var result = lexer.GetTokenList(list);
			var expected = new[] { "(", "test", "neki string", "drugi string", ")" };
			CollectionAssert.AreEqual(expected, result);
		}
예제 #5
0
		public void Can_tokenize_empty_list()
		{
			var lexer = new LispLexer();
			var list = "()";
			var result = lexer.GetTokenList(list);
			var expected = new[] { "(", ")" };
			CollectionAssert.AreEqual(expected, result);
		}