Accepted baselines.

This commit is contained in:
Daniel Rosenwasser 2015-11-09 13:27:08 -08:00
parent 38090c6ba5
commit d294524861
4 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,18 @@
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(2,5): error TS2322: Type 'string' is not assignable to type '"ABC"'.
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(3,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts(6,5): error TS2322: Type 'string' is not assignable to type '"JK`L"'.
==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings01.ts (3 errors) ====
let ABC: "ABC" = `ABC`;
~~~
!!! error TS2322: Type 'string' is not assignable to type '"ABC"'.
let DE_NEWLINE_F: "DE\nF" = `DE
~~~~~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
F`;
let G_QUOTE_HI: 'G"HI';
let JK_BACKTICK_L: "JK`L" = `JK\`L`;
~~~~~~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type '"JK`L"'.

View file

@ -0,0 +1,20 @@
//// [stringLiteralTypesWithTemplateStrings01.ts]
let ABC: "ABC" = `ABC`;
let DE_NEWLINE_F: "DE\nF" = `DE
F`;
let G_QUOTE_HI: 'G"HI';
let JK_BACKTICK_L: "JK`L" = `JK\`L`;
//// [stringLiteralTypesWithTemplateStrings01.js]
var ABC = "ABC";
var DE_NEWLINE_F = "DE\nF";
var G_QUOTE_HI;
var JK_BACKTICK_L = "JK`L";
//// [stringLiteralTypesWithTemplateStrings01.d.ts]
declare let ABC: "ABC";
declare let DE_NEWLINE_F: "DE\nF";
declare let G_QUOTE_HI: 'G"HI';
declare let JK_BACKTICK_L: "JK`L";

View file

@ -0,0 +1,13 @@
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(2,5): error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'.
tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(4,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'.
==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts (2 errors) ====
let abc: "AB\r\nC" = `AB
~~~
!!! error TS2322: Type 'string' is not assignable to type '"AB\r\nC"'.
C`;
let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`;
~~~~~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'.

View file

@ -0,0 +1,14 @@
//// [stringLiteralTypesWithTemplateStrings02.ts]
let abc: "AB\r\nC" = `AB
C`;
let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`;
//// [stringLiteralTypesWithTemplateStrings02.js]
var abc = "AB\nC";
var de_NEWLINE_f = "DE" + "\n" + "F";
//// [stringLiteralTypesWithTemplateStrings02.d.ts]
declare let abc: "AB\r\nC";
declare let de_NEWLINE_f: "DE\nF";