diff options
Diffstat (limited to 'clang/unittests/Format/SortImportsTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/SortImportsTestJS.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/clang/unittests/Format/SortImportsTestJS.cpp b/clang/unittests/Format/SortImportsTestJS.cpp index 77c37e337dd..e43844c49cb 100644 --- a/clang/unittests/Format/SortImportsTestJS.cpp +++ b/clang/unittests/Format/SortImportsTestJS.cpp @@ -190,40 +190,29 @@ TEST_F(SortImportsTestJS, SideEffectImports) { } TEST_F(SortImportsTestJS, AffectedRange) { - // Sort excluding a suffix. - verifySort("import {sym} from 'b';\n" + // Affected range inside of import statements. + verifySort("import {sym} from 'a';\n" + "import {sym} from 'b';\n" "import {sym} from 'c';\n" - "import {sym} from 'a';\n" + "\n" "let x = 1;", "import {sym} from 'c';\n" "import {sym} from 'b';\n" "import {sym} from 'a';\n" "let x = 1;", 0, 30); - // Sort excluding a prefix. + // Affected range outside of import statements. verifySort("import {sym} from 'c';\n" - "import {sym} from 'a';\n" - "import {sym} from 'b';\n" - "\n" - "let x = 1;", - "import {sym} from 'c';\n" "import {sym} from 'b';\n" "import {sym} from 'a';\n" "\n" "let x = 1;", - 30, 0); - // Sort a range within imports. - verifySort("import {sym} from 'c';\n" - "import {sym} from 'a';\n" - "import {sym} from 'b';\n" - "import {sym} from 'c';\n" - "let x = 1;", "import {sym} from 'c';\n" "import {sym} from 'b';\n" "import {sym} from 'a';\n" - "import {sym} from 'c';\n" + "\n" "let x = 1;", - 24, 30); + 70, 1); } TEST_F(SortImportsTestJS, SortingCanShrink) { |