Update testcases to use baseline
This commit is contained in:
parent
609d1bc92c
commit
4a1f652b66
16 changed files with 163 additions and 32 deletions
|
@ -1,5 +1,6 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputDeclarationMultiFiles.baseline
|
||||
// @declaration: true
|
||||
// @Filename: inputFile1.ts
|
||||
//// var x: number = 5;
|
||||
|
@ -15,7 +16,4 @@
|
|||
//// y : number;
|
||||
//// }
|
||||
|
||||
var inputFile1 = "tests/cases/fourslash/inputFile1";
|
||||
var inputFile2 = "tests/cases/fourslash/inputFile2";
|
||||
var outputFilenames = inputFile1 + ".js" + " " + inputFile2 + ".js" + " " + inputFile1 + ".d.ts" + " " + inputFile2 + ".d.ts";
|
||||
verify.emitOutput(EmitReturnStatus.Succeeded);
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,5 +1,6 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputDeclarationSingleFile.baseline
|
||||
// @declaration: true
|
||||
// @Filename: inputFile1.ts
|
||||
// @out: declSingleFile.js
|
||||
|
@ -16,8 +17,4 @@
|
|||
//// y : number;
|
||||
//// }
|
||||
|
||||
var singleFilename = "declSingleFile";
|
||||
var jsFilename = singleFilename + ".js";
|
||||
var declFilename = singleFilename + ".d.ts";
|
||||
var outputFilenames = jsFilename + " " + declFilename;
|
||||
verify.emitOutput(EmitReturnStatus.Succeeded, outputFilenames);
|
||||
verify.baselineGetEmitOutput();
|
14
tests/cases/fourslash/getEmitOutputMapRoot.ts
Normal file
14
tests/cases/fourslash/getEmitOutputMapRoot.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputMapRoots.baseline
|
||||
// @Filename: inputFile.ts
|
||||
// @sourceMap: true
|
||||
// @mapRoot: mapRootDir/
|
||||
//// var x = 109;
|
||||
//// var foo = "hello world";
|
||||
//// class M {
|
||||
//// x: number;
|
||||
//// y: string;
|
||||
//// }
|
||||
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,10 +1,11 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: noErrorsResult.ts
|
||||
// @BaselineFile: getEmitOutputNoErrors.baseline
|
||||
// @Filename: inputFile.ts
|
||||
//// var x;
|
||||
//// class M {
|
||||
//// x: number;
|
||||
//// y: string;
|
||||
//// }
|
||||
|
||||
verify.emitOutput(EmitReturnStatus.Succeeded, "tests/cases/fourslash/noErrorsResult.js");
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @out: tests/cases/fourslash/singleFile.js
|
||||
// @BaselineFile: getEmitOutputSingleFile.baseline
|
||||
// @out: outputDir/singleFile.js
|
||||
// @Filename: inputFile1.ts
|
||||
//// var x: any;
|
||||
//// class Bar {
|
||||
|
@ -15,5 +16,4 @@
|
|||
//// y : number
|
||||
//// }
|
||||
|
||||
var outputFilename = "tests/cases/fourslash/singleFile.js";
|
||||
verify.emitOutput(EmitReturnStatus.Succeeded, outputFilename);
|
||||
verify.baselineGetEmitOutput();
|
32
tests/cases/fourslash/getEmitOutputSingleFile2.ts
Normal file
32
tests/cases/fourslash/getEmitOutputSingleFile2.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputSingleFile2.baseline
|
||||
// @declaration: true
|
||||
// @Filename: inputFile1.ts
|
||||
// @out: declSingleFile.js
|
||||
// @outDir: tests/cases/fourslash/
|
||||
//// var x: number = 5;
|
||||
//// class Bar {
|
||||
//// x : string;
|
||||
//// y : number
|
||||
//// }
|
||||
|
||||
// @Filename: inputFile2.ts
|
||||
//// var x1: string = "hello world";
|
||||
//// class Foo{
|
||||
//// x : string;
|
||||
//// y : number;
|
||||
//// }
|
||||
|
||||
// @Filename: inputFile3.ts
|
||||
////export var foo = 10;
|
||||
////export var bar = "hello world"
|
||||
|
||||
var singleFilename = "declSingleFile";
|
||||
var jsFilename = singleFilename + ".js";
|
||||
var declFilename = singleFilename + ".d.ts";
|
||||
var exportFilename = "tests/cases/fourslash/inputFile3"
|
||||
var exportJSFilename = exportFilename + ".js";
|
||||
var exportDeclFilename = exportFilename + ".d.ts";
|
||||
var outputFilenames = jsFilename + " " + declFilename + " " + exportJSFilename + " " + exportDeclFilename;
|
||||
verify.baselineGetEmitOutput();
|
13
tests/cases/fourslash/getEmitOutputSourceMap.ts
Normal file
13
tests/cases/fourslash/getEmitOutputSourceMap.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputSourceMap.baseline
|
||||
// @sourceMap: true
|
||||
// @Filename: inputFile.ts
|
||||
//// var x = 109;
|
||||
//// var foo = "hello world";
|
||||
//// class M {
|
||||
//// x: number;
|
||||
//// y: string;
|
||||
//// }
|
||||
|
||||
verify.baselineGetEmitOutput();
|
25
tests/cases/fourslash/getEmitOutputSourceMap2.ts
Normal file
25
tests/cases/fourslash/getEmitOutputSourceMap2.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputSourceMap2.baseline
|
||||
// @sourceMap: true
|
||||
// @Filename: inputFile1.ts
|
||||
// @outDir: sample/outDir
|
||||
//// var x = 109;
|
||||
//// var foo = "hello world";
|
||||
//// class M {
|
||||
//// x: number;
|
||||
//// y: string;
|
||||
//// }
|
||||
|
||||
// @Filename: inputFile2.ts
|
||||
//// var intro = "hello world";
|
||||
//// if (intro !== undefined) {
|
||||
//// var k = 10;
|
||||
//// }
|
||||
|
||||
var filename = "sample/outDir/sourceMapResult";
|
||||
var jsFilename = filename + ".js";
|
||||
var sourceMapFilename = filename + ".js.map";
|
||||
var outputFilenames = jsFilename + " " + sourceMapFilename;
|
||||
verify.baselineGetEmitOutput();
|
||||
//verify.emitOutput(EmitReturnStatus.Succeeded, outputFilenames);
|
14
tests/cases/fourslash/getEmitOutputSourceRoot.ts
Normal file
14
tests/cases/fourslash/getEmitOutputSourceRoot.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputSourceRoot.baseline
|
||||
// @sourceMap: true
|
||||
// @Filename: inputFile.ts
|
||||
// @sourceRoot: sourceRootDir/
|
||||
//// var x = 109;
|
||||
//// var foo = "hello world";
|
||||
//// class M {
|
||||
//// x: number;
|
||||
//// y: string;
|
||||
//// }
|
||||
|
||||
verify.baselineGetEmitOutput();
|
21
tests/cases/fourslash/getEmitOutputSourceRoot2.ts
Normal file
21
tests/cases/fourslash/getEmitOutputSourceRoot2.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputSourceRootMultiFiles.baseline
|
||||
// @Filename: inputFile1.ts
|
||||
// @sourceMap: true
|
||||
// @sourceRoot: sourceRootDir/
|
||||
//// var x = 109;
|
||||
//// var foo = "hello world";
|
||||
//// class M {
|
||||
//// x: number;
|
||||
//// y: string;
|
||||
//// }
|
||||
|
||||
// @Filename: inputFile2.ts
|
||||
//// var bar = "hello world Typescript";
|
||||
//// class C {
|
||||
//// x: number;
|
||||
//// y: string[];
|
||||
//// }
|
||||
|
||||
verify.baselineGetEmitOutput();
|
13
tests/cases/fourslash/getEmitOutputWithEmitterErrors.ts
Normal file
13
tests/cases/fourslash/getEmitOutputWithEmitterErrors.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputWithEmitterErrors.baseline
|
||||
// @declaration: true
|
||||
// @Filename: inputFile.ts
|
||||
////module M {
|
||||
//// class C { }
|
||||
//// export var foo = new C();
|
||||
////}
|
||||
|
||||
|
||||
// Only generate javscript file. The semantic error should not affect it
|
||||
verify.baselineGetEmitOutput();
|
12
tests/cases/fourslash/getEmitOutputWithEmitterErrors2.ts
Normal file
12
tests/cases/fourslash/getEmitOutputWithEmitterErrors2.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputWithEmitterErrors2.baseline
|
||||
// @declaration: true
|
||||
// @module: AMD
|
||||
// @Filename: inputFile.ts
|
||||
////class C { }
|
||||
////export module M {
|
||||
//// export var foo = new C();
|
||||
////}
|
||||
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,7 +1,7 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: semanticErrorsResult.ts
|
||||
// @BaselineFile: getEmitOutputWithSemanticErrors.baseline
|
||||
// @Filename: inputFile.ts
|
||||
//// var x:number = "hello world";
|
||||
|
||||
// Only generate javscript file. The semantic error should not affect it
|
||||
verify.emitOutput(EmitReturnStatus.JSGeneratedWithSemanticErrors,"tests/cases/fourslash/semanticErrorsResult.js");
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,8 +1,8 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @BaselineFile: getEmitOutputWithSemanticErrors2.baseline
|
||||
// @declaration: true
|
||||
// @Filename: semanticErrorsResult2.ts
|
||||
// @Filename: inputFile.ts
|
||||
//// var x:number = "hello world";
|
||||
|
||||
// Fail to generate .d.ts file due to semantic error but succeeded in generate javascript file
|
||||
verify.emitOutput(EmitReturnStatus.DeclarationGenerationSkipped,"tests/cases/fourslash/semanticErrorsResult2.js");
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,6 +1,7 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @Filename: getEmitOutputWithSyntaxErrorsResult.ts
|
||||
// @BaselineFile: getEmitOutputWithSyntaxErrors.baseline
|
||||
// @Filename: inputFile.ts
|
||||
//// var x:
|
||||
|
||||
verify.emitOutput(EmitReturnStatus.AllOutputGenerationSkipped);
|
||||
verify.baselineGetEmitOutput();
|
|
@ -1,10 +0,0 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @declaration
|
||||
// @Filename: syntaxErrorsResult2.ts
|
||||
//// var x;
|
||||
//// class M {
|
||||
//// x : string;
|
||||
//// y : numer
|
||||
|
||||
verify.emitOutput(EmitReturnStatus.AllOutputGenerationSkipped);
|
Loading…
Reference in a new issue