Skip to content

Commit

Permalink
Merge pull request #2 from pointfreeco/escaping-verification
Browse files Browse the repository at this point in the history
Pin swift-snapshot-testing, and added a test
  • Loading branch information
mbrandonw authored Sep 13, 2018
2 parents 6d614a8 + eec68b0 commit bb2fac7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let package = Package(
targets: ["Html"]),
],
dependencies: [
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", .revision("69b48c8")),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "0.0.1")
],
targets: [
.target(
Expand Down
5 changes: 5 additions & 0 deletions Tests/HtmlTests/AttributesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ final class AttributesTests: XCTestCase {
XCTAssertEqual("<th scope=\"row\"/>", render(th([scope(.row)], [])))
XCTAssertEqual("<th scope=\"rowgroup\"/>", render(th([scope(.rowgroup)], [])))

XCTAssertEqual(
"<a href=\"/user/foo&quot; onmouseover=&quot;alert(1)\">XSS</a>",
render(a([href("/user/foo\" onmouseover=\"alert(1)")], ["XSS"]))
)

XCTAssertEqual("<a accesskey=\"a\"/>", render(a([accesskey("a")], [])))

XCTAssertEqual(
Expand Down

0 comments on commit bb2fac7

Please sign in to comment.