Classification tests.
This commit is contained in:
parent
ebb0beb203
commit
7be2d2866b
|
@ -386,6 +386,10 @@ module FourSlashInterface {
|
|||
public syntacticClassificationsAre(...classifications: { classificationType: string; text: string }[]) {
|
||||
FourSlash.currentTestState.verifySyntacticClassifications(classifications);
|
||||
}
|
||||
|
||||
public semanticClassificationsAre(...classifications: { classificationType: string; text: string }[]) {
|
||||
FourSlash.currentTestState.verifySemanticClassifications(classifications);
|
||||
}
|
||||
}
|
||||
|
||||
export class edit {
|
||||
|
|
12
tests/cases/fourslash/semanticClassification1.ts
Normal file
12
tests/cases/fourslash/semanticClassification1.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
//// module M {
|
||||
//// export interface I {
|
||||
//// }
|
||||
//// }
|
||||
//// interface X extends M.I { }
|
||||
|
||||
debugger;
|
||||
var c = classification;
|
||||
verify.semanticClassificationsAre(
|
||||
c.moduleName("M"), c.interfaceName("I"), c.interfaceName("X"), c.moduleName("M"), c.interfaceName("I"));
|
36
tests/cases/fourslash/syntacticClassifications1.ts
Normal file
36
tests/cases/fourslash/syntacticClassifications1.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
//// // comment
|
||||
//// module M {
|
||||
//// var v = 0 + 1;
|
||||
//// var s = "string";
|
||||
////
|
||||
//// class C<T> {
|
||||
//// }
|
||||
////
|
||||
//// enum E {
|
||||
//// }
|
||||
////
|
||||
//// interface I {
|
||||
//// }
|
||||
////
|
||||
//// module M1.M2 {
|
||||
//// }
|
||||
//// }
|
||||
|
||||
debugger;
|
||||
var c = classification;
|
||||
verify.syntacticClassificationsAre(
|
||||
c.comment("// comment"),
|
||||
c.keyword("module"), c.moduleName("M"), c.punctuation("{"),
|
||||
c.keyword("var"), c.text("v"), c.operator("="), c.numericLiteral("0"), c.operator("+"), c.numericLiteral("1"), c.punctuation(";"),
|
||||
c.keyword("var"), c.text("s"), c.operator("="), c.stringLiteral('"string"'), c.punctuation(";"),
|
||||
c.keyword("class"), c.className("C"), c.punctuation("<"), c.typeParameterName("T"), c.punctuation(">"), c.punctuation("{"),
|
||||
c.punctuation("}"),
|
||||
c.keyword("enum"), c.enumName("E"), c.punctuation("{"),
|
||||
c.punctuation("}"),
|
||||
c.keyword("interface"), c.interfaceName("I"), c.punctuation("{"),
|
||||
c.punctuation("}"),
|
||||
c.keyword("module"), c.moduleName("M1"), c.punctuation("."), c.moduleName("M2"), c.punctuation("{"),
|
||||
c.punctuation("}"),
|
||||
c.punctuation("}"));
|
Loading…
Reference in a new issue