From 8020bf90d6dd2dd24e7a04bf19077780444e22ab Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Nov 2015 14:44:51 -0800 Subject: [PATCH] Test cases to verify --inlineSourceMap with --sourcemap --mapRoot and --sourceRoot Note that --sourceRoot fails with crash --- .../optionsInlineSourceMapMapRoot.errors.txt | 9 +++++ .../optionsInlineSourceMapMapRoot.js | 7 ++++ ...ptionsInlineSourceMapMapRoot.sourcemap.txt | 33 +++++++++++++++++++ ...optionsInlineSourceMapSourcemap.errors.txt | 7 ++++ .../optionsInlineSourceMapSourcemap.js | 7 ++++ ...ionsInlineSourceMapSourcemap.sourcemap.txt | 33 +++++++++++++++++++ .../compiler/optionsInlineSourceMapMapRoot.ts | 4 +++ .../optionsInlineSourceMapSourceRoot.ts | 4 +++ .../optionsInlineSourceMapSourcemap.ts | 4 +++ 9 files changed, 108 insertions(+) create mode 100644 tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt create mode 100644 tests/baselines/reference/optionsInlineSourceMapMapRoot.js create mode 100644 tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt create mode 100644 tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt create mode 100644 tests/baselines/reference/optionsInlineSourceMapSourcemap.js create mode 100644 tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt create mode 100644 tests/cases/compiler/optionsInlineSourceMapMapRoot.ts create mode 100644 tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts create mode 100644 tests/cases/compiler/optionsInlineSourceMapSourcemap.ts diff --git a/tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt b/tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt new file mode 100644 index 00000000000..a9efb0e2971 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapMapRoot.errors.txt @@ -0,0 +1,9 @@ +error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'. +error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. + + +!!! error TS5052: Option 'mapRoot' cannot be specified without specifying option 'sourceMap'. +!!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. +==== tests/cases/compiler/optionsInlineSourceMapMapRoot.ts (0 errors) ==== + + var a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapMapRoot.js b/tests/baselines/reference/optionsInlineSourceMapMapRoot.js new file mode 100644 index 00000000000..6389f9eb84a --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapMapRoot.js @@ -0,0 +1,7 @@ +//// [optionsInlineSourceMapMapRoot.ts] + +var a = 10; + +//// [optionsInlineSourceMapMapRoot.js] +var a = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt b/tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt new file mode 100644 index 00000000000..e12e2d1096a --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapMapRoot.sourcemap.txt @@ -0,0 +1,33 @@ +=================================================================== +JsFile: optionsInlineSourceMapMapRoot.js +mapUrl: c:/TypeScript/tests/cases/compiler/optionsInlineSourceMapMapRoot.js.map +sourceRoot: +sources: optionsInlineSourceMapMapRoot.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsInlineSourceMapMapRoot.js +sourceFile:optionsInlineSourceMapMapRoot.ts +------------------------------------------------------------------- +>>>var a = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >var +3 > a +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcE1hcFJvb3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvcHRpb25zSW5saW5lU291cmNlTWFwTWFwUm9vdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxJQUFJLENBQUMsR0FBRyxFQUFFLENBQUMifQ== \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt b/tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt new file mode 100644 index 00000000000..e91781ccd77 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourcemap.errors.txt @@ -0,0 +1,7 @@ +error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. + + +!!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. +==== tests/cases/compiler/optionsInlineSourceMapSourcemap.ts (0 errors) ==== + + var a = 10; \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourcemap.js b/tests/baselines/reference/optionsInlineSourceMapSourcemap.js new file mode 100644 index 00000000000..96d468d27da --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourcemap.js @@ -0,0 +1,7 @@ +//// [optionsInlineSourceMapSourcemap.ts] + +var a = 10; + +//// [optionsInlineSourceMapSourcemap.js] +var a = 10; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0= \ No newline at end of file diff --git a/tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt b/tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt new file mode 100644 index 00000000000..ecd6c4062c3 --- /dev/null +++ b/tests/baselines/reference/optionsInlineSourceMapSourcemap.sourcemap.txt @@ -0,0 +1,33 @@ +=================================================================== +JsFile: optionsInlineSourceMapSourcemap.js +mapUrl: optionsInlineSourceMapSourcemap.js.map +sourceRoot: +sources: optionsInlineSourceMapSourcemap.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:tests/cases/compiler/optionsInlineSourceMapSourcemap.js +sourceFile:optionsInlineSourceMapSourcemap.ts +------------------------------------------------------------------- +>>>var a = 10; +1 > +2 >^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >var +3 > a +4 > = +5 > 10 +6 > ; +1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(1, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(1, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(1, 9) Source(2, 9) + SourceIndex(0) +5 >Emitted(1, 11) Source(2, 11) + SourceIndex(0) +6 >Emitted(1, 12) Source(2, 12) + SourceIndex(0) +--- +>>>//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3B0aW9uc0lubGluZVNvdXJjZU1hcFNvdXJjZW1hcC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9wdGlvbnNJbmxpbmVTb3VyY2VNYXBTb3VyY2VtYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDIn0= \ No newline at end of file diff --git a/tests/cases/compiler/optionsInlineSourceMapMapRoot.ts b/tests/cases/compiler/optionsInlineSourceMapMapRoot.ts new file mode 100644 index 00000000000..ddea5f363c7 --- /dev/null +++ b/tests/cases/compiler/optionsInlineSourceMapMapRoot.ts @@ -0,0 +1,4 @@ +// @mapRoot: local +// @inlineSourceMap: true + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts b/tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts new file mode 100644 index 00000000000..b4fdc66e309 --- /dev/null +++ b/tests/cases/compiler/optionsInlineSourceMapSourceRoot.ts @@ -0,0 +1,4 @@ +// @sourceRoot: local +// @inlineSourceMap: true + +var a = 10; \ No newline at end of file diff --git a/tests/cases/compiler/optionsInlineSourceMapSourcemap.ts b/tests/cases/compiler/optionsInlineSourceMapSourcemap.ts new file mode 100644 index 00000000000..d78097985d8 --- /dev/null +++ b/tests/cases/compiler/optionsInlineSourceMapSourcemap.ts @@ -0,0 +1,4 @@ +// @sourcemap: true +// @inlineSourceMap: true + +var a = 10; \ No newline at end of file