File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ import Foundation
2+ import XCTest
3+ @testable import Leaf
4+
5+ class HTMLEscapeTests : XCTestCase {
6+ static let allTests = [
7+ ( " testHTMLEscape " , testHTMLEscape) ,
8+ ( " testHTMLEscapeCRLFQuotes " , testHTMLEscapeCRLFQuotes) ,
9+ ]
10+
11+ func testHTMLEscape( ) throws {
12+ let input = " & \" '<> "
13+ let expected = " &"'<> "
14+
15+ XCTAssertEqual ( input. htmlEscaped ( ) , expected)
16+ }
17+
18+ func testHTMLEscapeCRLFQuotes( ) throws {
19+ let input = " \r \n \" "
20+ let expected = " \r \n " "
21+
22+ XCTAssertEqual ( input. htmlEscaped ( ) , expected)
23+ }
24+ }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ XCTMain([
99 testCase ( FileLoadTests . allTests) ,
1010 testCase ( IfTests . allTests) ,
1111 testCase ( IndexTests . allTests) ,
12+ testCase ( HTMLEscapeTests . allTests) ,
1213 testCase ( LinkTests . allTests) ,
1314 testCase ( LoopTests . allTests) ,
1415 testCase ( NodeRenderTests . allTests) ,
You can’t perform that action at this time.
0 commit comments