add and update tests

This commit is contained in:
Arthur Ozga 2017-06-19 20:30:11 -07:00 committed by Arthur Ozga
parent 0df66a5e6d
commit 28fce55e1f
6 changed files with 62 additions and 34 deletions

View file

@ -4,11 +4,11 @@
/////**/
////}
goTo.marker("");
edit.paste(" class TestClass{\r\n\
private foo;\r\n\
public testMethod( )\r\n\
{}\r\n\
}");
edit.paste(` class TestClass{
private foo;
public testMethod( )
{}
}`);
// We're missing scenarios of formatting option settings due to bug 693273 - [TypeScript] Need to improve fourslash support for formatting options.
// Missing scenario ** Uncheck Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste **
//verify.currentFileContentIs("module TestModule {\r\n\
@ -19,10 +19,9 @@ public testMethod( )\r\n\
//}\r\n\
//}");
// Missing scenario ** Check Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste **
verify.currentFileContentIs("module TestModule {\r\n\
class TestClass {\r\n\
private foo;\r\n\
public testMethod()\r\n\
{ }\r\n\
}\r\n\
}");
verify.currentFileContentIs(`module TestModule {
class TestClass {
private foo;
public testMethod() { }
}
}`);

View file

@ -1,18 +1,23 @@
///<reference path="fourslash.ts"/>
////function f()
////function f1()
////{ return 0; }
////function f2()
////{
////return 0;
////}
////function g()
////{ function h() {
////return 0;
////}}
format.document();
verify.currentFileContentIs(
"function f()\n" +
"{ return 0; }\n" +
"function g() {\n" +
" function h() {\n" +
" return 0;\n" +
" }\n" +
"}"
);
`function f1() { return 0; }
function f2() {
return 0;
}
function g() {
function h() {
return 0;
}
}`);

View file

@ -0,0 +1,14 @@
/// <reference path="fourslash.ts"/>
//// if(true)
//// /**/
format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", false);
goTo.marker("");
edit.insert("{");
// TODO: figure out how to get rid of 3 extra spaces on second last line.
verify.currentFileContentIs(
`if (true) {`);

View file

@ -0,0 +1,15 @@
/// <reference path="fourslash.ts"/>
//// function foo()
//// {
//// }
//// if (true)
//// {
//// }
format.document();
verify.currentFileContentIs(
`function foo() {
}
if (true) {
}`);

View file

@ -47,7 +47,7 @@ verify.currentLineContentIs("enum E {");
goTo.marker('4');
verify.currentLineContentIs("class MyClass {");
goTo.marker('cons');
verify.currentLineContentIs(" constructor()");
verify.currentLineContentIs(" constructor() { }");
goTo.marker('5');
verify.currentLineContentIs(" public MyFunction() {");
goTo.marker('6');

View file

@ -1,16 +1,11 @@
/// <reference path='fourslash.ts' />
/////*1*/class C
////{}/*2*/
/////*3*/if (true)
////{}/*4*/
////class C
////{}
////if (true)
////{}
format.document();
goTo.marker("1");
verify.currentLineContentIs("class C");
goTo.marker("2");
verify.currentLineContentIs("{ }");
goTo.marker("3");
verify.currentLineContentIs("if (true)");
goTo.marker("4");
verify.currentLineContentIs("{ }");
verify.currentFileContentIs(
`class C { }
if (true) { }`);