From 402c57cf7e09e366fed384d0be80343cad8cdd06 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 11 Dec 2014 17:04:21 -0800 Subject: [PATCH] Adding classification test. --- .../cases/unittests/services/colorization.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/cases/unittests/services/colorization.ts b/tests/cases/unittests/services/colorization.ts index b29f119f944..44804e4f9f5 100644 --- a/tests/cases/unittests/services/colorization.ts +++ b/tests/cases/unittests/services/colorization.ts @@ -317,7 +317,9 @@ describe('Colorization', function () { operator("<"), identifier("number"), finalEndOfLineState(ts.EndOfLineState.Start)); + }); + it("ClassifiesConflictTokens", () => { // no longer in something that looks generic. test("Foo number", ts.EndOfLineState.Start, @@ -327,6 +329,33 @@ describe('Colorization', function () { operator(">"), keyword("number"), finalEndOfLineState(ts.EndOfLineState.Start)); + + // Test conflict markers. + test( +"class C {\r\n\ +<<<<<<< HEAD\r\n\ + v = 1;\r\n\ +=======\r\n\ + v = 2;\r\n\ +>>>>>>> Branch - a\r\n\ +}", + ts.EndOfLineState.Start, + keyword("class"), + identifier("C"), + punctuation("{"), + comment("<<<<<<< HEAD"), + identifier("v"), + operator("="), + numberLiteral("1"), + punctuation(";"), + comment("======="), + identifier("v"), + operator("="), + numberLiteral("2"), + punctuation(";"), + comment(">>>>>>> Branch - a"), + punctuation("}"), + finalEndOfLineState(ts.EndOfLineState.Start)); }); }); }); \ No newline at end of file