Skip to content

Commit

Permalink
Compiler flag to specify line ending microsoft#1693 unit test adjustm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
kmashint committed May 3, 2015
1 parent 2e0a55c commit 47c4c12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/harness/harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ module Harness {
useCaseSensitiveFileNames: boolean,
// the currentDirectory is needed for rwcRunner to passed in specified current directory to compiler host
currentDirectory?: string,
newLineKind?: ts.NewLineKind): ts.CompilerHost {
newLineKind?: ts.NewLineKind): ts.CompilerHost {

// Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames
function getCanonicalFileName(fileName: string): string {
Expand Down Expand Up @@ -1050,15 +1050,15 @@ module Harness {
break;

case 'newline':
case 'newlines':
if (setting.value.toLowerCase() === 'crlf') {
options.newLine = ts.NewLineKind.CarriageReturnLineFeed;
} else if (setting.value.toLowerCase() === 'lf') {
newLine = setting.value;
}
else if (setting.value.toLowerCase() === 'lf') {
options.newLine = ts.NewLineKind.LineFeed;
} else if (setting.value === '\\n') {
// Handle old usage, e.g. contextualTyping.ts:// @newline: \n
newLine = setting.value;
} else {
}
else {
throw new Error('Unknown option for newLine: ' + setting.value);
}
break;
Expand Down Expand Up @@ -1762,4 +1762,4 @@ module Harness {
}

// TODO: not sure why Utils.evalFile isn't working with this, eventually will concat it like old compiler instead of eval
eval(Harness.tcServicesFile);
eval(Harness.tcServicesFile);
4 changes: 0 additions & 4 deletions tests/cases/compiler/newLineFlagWithCR.ts

This file was deleted.

0 comments on commit 47c4c12

Please sign in to comment.