|
2 | 2 | * Copyright (c) Red Hat. All rights reserved.
|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 |
| -import {startsWith, endsWith, convertSimple2RegExpPattern} from '../src/languageservice/utils/strings'; |
| 5 | +import {startsWith, endsWith, convertSimple2RegExp} from '../src/languageservice/utils/strings'; |
6 | 6 | var assert = require('assert');
|
7 | 7 |
|
8 | 8 | suite("String Tests", () => {
|
@@ -75,12 +75,22 @@ suite("String Tests", () => {
|
75 | 75 |
|
76 | 76 | });
|
77 | 77 |
|
78 |
| - describe('convertSimple2RegExpPattern', function(){ |
| 78 | + describe('convertSimple2RegExp', function(){ |
79 | 79 |
|
80 |
| - it('Test of convertSimple2RegExpPattern', () => { |
| 80 | + it('Test of convertRegexString2RegExp', () => { |
81 | 81 |
|
82 |
| - var result = convertSimple2RegExpPattern("/*"); |
83 |
| - assert.equal(result, "/.*"); |
| 82 | + var result = convertSimple2RegExp("/toc\\.yml/i").test("TOC.yml"); |
| 83 | + assert.equal(result, true); |
| 84 | + |
| 85 | + }); |
| 86 | + |
| 87 | + it('Test of convertGlobalPattern2RegExp', () => { |
| 88 | + |
| 89 | + var result = convertSimple2RegExp("toc.yml").test("toc.yml"); |
| 90 | + assert.equal(result, true); |
| 91 | + |
| 92 | + result = convertSimple2RegExp("toc.yml").test("TOC.yml"); |
| 93 | + assert.equal(result, false); |
84 | 94 |
|
85 | 95 | });
|
86 | 96 |
|
|
0 commit comments