add and update tests
This commit is contained in:
parent
0df66a5e6d
commit
28fce55e1f
|
@ -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() { }
|
||||
}
|
||||
}`);
|
|
@ -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;
|
||||
}
|
||||
}`);
|
||||
|
|
14
tests/cases/fourslash/formatOnEnterOpenBraceRemoveNewLine.ts
Normal file
14
tests/cases/fourslash/formatOnEnterOpenBraceRemoveNewLine.ts
Normal 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) {`);
|
||||
|
||||
|
15
tests/cases/fourslash/formatRemoveNewLineAfterOpenBrace.ts
Normal file
15
tests/cases/fourslash/formatRemoveNewLineAfterOpenBrace.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
//// function foo()
|
||||
//// {
|
||||
//// }
|
||||
//// if (true)
|
||||
//// {
|
||||
//// }
|
||||
|
||||
format.document();
|
||||
verify.currentFileContentIs(
|
||||
`function foo() {
|
||||
}
|
||||
if (true) {
|
||||
}`);
|
|
@ -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');
|
||||
|
|
|
@ -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) { }`);
|
Loading…
Reference in a new issue