-
Notifications
You must be signed in to change notification settings - Fork 585
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module Fake.Core.XmlTests | ||
|
||
open System.IO | ||
open Fake.Core | ||
open Fake.DotNet | ||
open Expecto | ||
open Expecto.Flip | ||
|
||
[<Tests>] | ||
let tests = | ||
testList "Fake.Core.Xml.Tests" [ | ||
testCase "Xml issue #1692" <| fun _ -> | ||
let original = """<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleIdentifier</key> | ||
<string>foo</string> | ||
</dict> | ||
</plist>""" | ||
let expected = """<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleIdentifier</key> | ||
<string>whateva</string> | ||
</dict> | ||
</plist>""" | ||
let tmpFile = Path.GetTempFileName() | ||
try | ||
File.WriteAllText(tmpFile, original) | ||
let bundleIdentifier = "whateva" | ||
Xml.pokeInnerText tmpFile "plist/dict/key[text()='CFBundleIdentifier']/following-sibling::string" bundleIdentifier | ||
let actual = File.ReadAllText tmpFile | ||
Expect.equal "expected same xml" expected actual | ||
finally | ||
File.Delete(tmpFile) | ||
] |