Fix tests

This commit is contained in:
Pieter Vander Vennet 2024-01-16 04:52:05 +01:00
parent 04ee3dc32c
commit cd8f6788e7

View file

@ -770,9 +770,7 @@ export class RewriteSpecial extends DesugaringStep<TagRenderingConfigJson> {
* "special":{ * "special":{
* "type": "multi", * "type": "multi",
* "key": "_nearby_bicycle_parkings:props", * "key": "_nearby_bicycle_parkings:props",
* "tagrendering": { * "tagrendering": "<b>{id}</b> ({distance}m) {tagApply(a,b,c)}"
* "*": "<b>{id}</b> ({distance}m) {tagApply(a,b,c)}"
* }
* }} * }}
* const context = ConversionContext.test() * const context = ConversionContext.test()
* RewriteSpecial.convertIfNeeded(special, context) // => {"*": "{multi(_nearby_bicycle_parkings:props,<b>&LBRACEid&RBRACE</b> &LPARENS&LBRACEdistance&RBRACEm&RPARENS &LBRACEtagApply&LPARENSa&COMMAb&COMMAc&RPARENS&RBRACE)}"} * RewriteSpecial.convertIfNeeded(special, context) // => {"*": "{multi(_nearby_bicycle_parkings:props,<b>&LBRACEid&RBRACE</b> &LPARENS&LBRACEdistance&RBRACEm&RPARENS &LBRACEtagApply&LPARENSa&COMMAb&COMMAc&RPARENS&RBRACE)}"}
@ -877,7 +875,9 @@ export class RewriteSpecial extends DesugaringStep<TagRenderingConfigJson> {
} }
if (foundLanguages.size === 0) { if (foundLanguages.size === 0) {
const args = argNamesList.map((nm) => RewriteSpecial.escapeStr(special[nm] ?? "")).join(",") const args = argNamesList
.map((nm) => RewriteSpecial.escapeStr(special[nm] ?? ""))
.join(",")
return { return {
"*": `{${type}(${args})}`, "*": `{${type}(${args})}`,
} }