-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
121 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
|
||
import assert = require('assert'); | ||
import {FindModelBoundToEditorModel, parseReplaceString} from 'vs/editor/contrib/find/common/findModel'; | ||
|
||
suite('FindModel', () => { | ||
|
||
test('parseFindWidgetString', () => { | ||
let testParse = (input:string, expected:string) => { | ||
let actual = parseReplaceString(input); | ||
assert.equal(actual, expected); | ||
|
||
let actual2 = parseReplaceString('hello' + input + 'hi'); | ||
assert.equal(actual2, 'hello' + expected + 'hi'); | ||
}; | ||
|
||
// no backslash => no treatment | ||
testParse('hello', 'hello'); | ||
|
||
// \t => TAB | ||
testParse('\\thello', '\thello'); | ||
|
||
// \n => LF | ||
testParse('\\nhello', '\nhello'); | ||
|
||
// \\t => \t | ||
testParse('\\\\thello', '\\thello'); | ||
|
||
// \\\t => \TAB | ||
testParse('\\\\\\thello', '\\\thello'); | ||
|
||
// \\\\t => \\t | ||
testParse('\\\\\\\\thello', '\\\\thello'); | ||
|
||
// \ at the end => no treatment | ||
testParse('hello\\', 'hello\\'); | ||
|
||
// \ with unknown char => no treatment | ||
testParse('hello\\x', 'hello\\x'); | ||
|
||
// \ with back reference => no treatment | ||
testParse('hello\\0', 'hello\\0'); | ||
}); | ||
}); |