File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export abstract class GenericProcessor {
3636 }
3737
3838 replaceSubstituteWithValue ( substitute : string , value : string ) {
39- const match = new RegExp ( `('|")? ${ substitute } ( '|")? ` )
39+ const match = new RegExp ( `' ${ substitute } '|"${ substitute } "| ${ substitute } ` )
4040 this . text = this . text . replace ( match , value )
4141 }
4242}
Original file line number Diff line number Diff line change 1+ import { equal } from "assert"
2+
3+ import { HelmProcessor } from "../../../processor/helm-processor"
4+
5+ suite ( "Test GenericProcessor - replaceSubstituteWithValue()" , ( ) => {
6+ test ( "GitHub issue #154: Ensure a substitue is surrounded with the same quotation marks" , ( ) => {
7+ const text = "TABLE_SOURCES: 'vscode-yaml-sort.helm.0 TABLE'"
8+ const helmprocessor = new HelmProcessor ( text )
9+
10+ helmprocessor . replaceSubstituteWithValue ( "vscode-yaml-sort.helm.0" , "{{ LEVEL }}" )
11+
12+ const expected = "TABLE_SOURCES: '{{ LEVEL }} TABLE'"
13+
14+ equal ( helmprocessor . text , expected )
15+ } )
16+ } )
You can’t perform that action at this time.
0 commit comments