Skip to content

Commit a6b7c6d

Browse files
committed
Compiler flag to specify line ending #1693 unit test adjustments
1 parent da870ef commit a6b7c6d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/harness/harness.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1038,17 +1038,19 @@ module Harness {
10381038
case 'newline':
10391039
if (setting.value.toLowerCase() === 'crlf') {
10401040
options.newLine = ts.NewLineKind.CarriageReturnLineFeed;
1041-
newLine = setting.value;
10421041
}
10431042
else if (setting.value.toLowerCase() === 'lf') {
10441043
options.newLine = ts.NewLineKind.LineFeed;
1045-
newLine = setting.value;
10461044
}
10471045
else {
10481046
throw new Error('Unknown option for newLine: ' + setting.value);
10491047
}
10501048
break;
10511049

1050+
case 'normalizenewline':
1051+
newLine = setting.value;
1052+
break;
1053+
10521054
case 'comments':
10531055
options.removeComments = setting.value === 'false';
10541056
break;
@@ -1482,7 +1484,7 @@ module Harness {
14821484
// List of allowed metadata names
14831485
var fileMetadataNames = ["filename", "comments", "declaration", "module",
14841486
"nolib", "sourcemap", "target", "out", "outdir", "noemitonerror",
1485-
"noimplicitany", "noresolve", "newline", "newlines", "emitbom",
1487+
"noimplicitany", "noresolve", "newline", "normalizenewline", "emitbom",
14861488
"errortruncation", "usecasesensitivefilenames", "preserveconstenums",
14871489
"includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal",
14881490
"separatecompilation"];

tests/cases/compiler/contextualTyping.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @newline: LF
1+
// @normalizenewline: \n
22
// @sourcemap: true
33
// DEFAULT INTERFACES
44
interface IFoo {

0 commit comments

Comments
 (0)