diff options
| author | Ron Martin <cpuwzd@comcast.net> | 2021-03-28 23:29:37 -0400 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2021-04-03 21:40:16 -0400 |
| commit | 0d29fa5d042d56517aaefb21f4fc512516039377 (patch) | |
| tree | b07603fa84b097feb0a9cb1e4b2cef45702ccb06 /src/test | |
| parent | 2031d4703e6a64ae1fff367beb7210b3587a0f28 (diff) | |
| download | wix-0d29fa5d042d56517aaefb21f4fc512516039377.tar.gz wix-0d29fa5d042d56517aaefb21f4fc512516039377.tar.bz2 wix-0d29fa5d042d56517aaefb21f4fc512516039377.zip | |
Fix deprecated $(loc.xxx) localization variable references.
Fixes wixtoolset/issues#6262
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/WixToolsetTest.Converters/ConverterFixture.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/test/WixToolsetTest.Converters/ConverterFixture.cs index 39521da0..13df9da7 100644 --- a/src/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConverterFixture.cs | |||
| @@ -407,5 +407,43 @@ namespace WixToolsetTest.Converters | |||
| 407 | Assert.Equal(2, errors); | 407 | Assert.Equal(2, errors); |
| 408 | Assert.Equal(expected, actual); | 408 | Assert.Equal(expected, actual); |
| 409 | } | 409 | } |
| 410 | |||
| 411 | [Fact] | ||
| 412 | public void CanConvertDeprecatedPrefix() | ||
| 413 | { | ||
| 414 | var parse = String.Join(Environment.NewLine, | ||
| 415 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 416 | "<Fragment>", | ||
| 417 | "<ComponentGroup Id=\"$(loc.Variable)\" />", | ||
| 418 | "<ComponentGroup Id=\"$$(loc.Variable)\" />", | ||
| 419 | "<ComponentGroup Id=\"$$$(loc.Variable)\" />", | ||
| 420 | "<ComponentGroup Id=\"$$$$(loc.Variable)\" />", | ||
| 421 | "<ComponentGroup Id=\"$$$$$(loc.Variable)\" />", | ||
| 422 | "</Fragment>", | ||
| 423 | "</Wix>"); | ||
| 424 | |||
| 425 | var expected = String.Join(Environment.NewLine, | ||
| 426 | "<Wix xmlns=\"http://wixtoolset.org/schemas/v4/wxs\">", | ||
| 427 | "<Fragment>", | ||
| 428 | "<ComponentGroup Id=\"!(loc.Variable)\" />", | ||
| 429 | "<ComponentGroup Id=\"$$(loc.Variable)\" />", | ||
| 430 | "<ComponentGroup Id=\"$$!(loc.Variable)\" />", | ||
| 431 | "<ComponentGroup Id=\"$$$$(loc.Variable)\" />", | ||
| 432 | "<ComponentGroup Id=\"$$$$!(loc.Variable)\" />", | ||
| 433 | "</Fragment>", | ||
| 434 | "</Wix>"); | ||
| 435 | |||
| 436 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | ||
| 437 | |||
| 438 | var messaging = new MockMessaging(); | ||
| 439 | var converter = new WixConverter(messaging, 2, null, null); | ||
| 440 | |||
| 441 | var errors = converter.ConvertDocument(document); | ||
| 442 | |||
| 443 | var actual = UnformattedDocumentString(document); | ||
| 444 | |||
| 445 | Assert.Equal(3, errors); | ||
| 446 | Assert.Equal(expected, actual); | ||
| 447 | } | ||
| 410 | } | 448 | } |
| 411 | } | 449 | } |
