Create lexer and template

This commit is contained in:
Kyle Fuller
2014-10-24 14:25:53 +01:00
parent bf67ea3e5f
commit 652a4f9c88
7 changed files with 110 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
//
// LexerTests.swift
// Stencil
//
// Created by Kyle Fuller on 24/10/2014.
// Copyright (c) 2014 Cocode. All rights reserved.
//
import Cocoa
import XCTest
import Stencil
class LexerTests: XCTestCase {
func testTokenizeText() {
let lexer = Lexer(templateString:"Hello World")
let tokens = lexer.tokenize()
XCTAssertEqual(tokens.count, 1)
XCTAssertEqual(tokens.first!, Token.Text(value: "Hello World"))
}
}