From 5bd075d32d6c530b05b8bc45482edd868fa10b2d Mon Sep 17 00:00:00 2001 From: pmario Date: Sun, 5 May 2024 18:12:31 +0200 Subject: [PATCH] make param values different to names --- .../tests/test-widget-getVariableInfo.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/editions/test/tiddlers/tests/test-widget-getVariableInfo.js b/editions/test/tiddlers/tests/test-widget-getVariableInfo.js index d1fa2aab3..7273a6dce 100644 --- a/editions/test/tiddlers/tests/test-widget-getVariableInfo.js +++ b/editions/test/tiddlers/tests/test-widget-getVariableInfo.js @@ -50,10 +50,10 @@ describe("Widget module", function() { it("should make sure that getVariableInfo returns all expected parameters", function() { var wiki = new $tw.Wiki(); wiki.addTiddlers([ - {title: "A", text: "\\define macro(a:a) aaa"}, - {title: "B", text: "\\function fn(f:f) fff\n\\function x() []"}, - {title: "C", text: "\\procedure proc(p:p) ppp"}, - {title: "D", text: "\\widget $my.widget(w:w) www"} + {title: "A", text: "\\define macro(a:aa) aaa"}, + {title: "B", text: "\\function fn(f:ff) fff\n\\function x() []"}, + {title: "C", text: "\\procedure proc(p:pp) ppp"}, + {title: "D", text: "\\widget $my.widget(w:ww) www"} ]); var text = "\\import A B C D\n\n<$let abc=def>"; var widgetNode = createWidgetNode(parseText(text,wiki),wiki); @@ -64,17 +64,17 @@ describe("Widget module", function() { childNode = childNode.children[0]; } - expect(childNode.getVariableInfo("macro",{allowSelfAssigned:true}).params).toEqual([{name:"a",value:"a"}]); + expect(childNode.getVariableInfo("macro",{allowSelfAssigned:true}).params).toEqual([{name:"a",value:"aa"}]); // function params - expect(childNode.getVariableInfo("fn", {allowSelfAssigned:true}).params).toEqual([{name:"f",value:"f"}]); + expect(childNode.getVariableInfo("fn", {allowSelfAssigned:true}).params).toEqual([{name:"f",value:"ff"}]); // functions have a text and a value expect(childNode.getVariableInfo("x", {allowSelfAssigned:true}).text).toBe("fff"); expect(childNode.getVariableInfo("x", {allowSelfAssigned:true}).srcVariable.value).toBe("[]"); // procedures and widgets failed prior to v5.3.4 - expect(childNode.getVariableInfo("proc", {allowSelfAssigned:true}).params).toEqual([{name:"p",default:"p"}]); - expect(childNode.getVariableInfo("$my.widget", {allowSelfAssigned:true}).params).toEqual([{name:"w",default:"w"}]); + expect(childNode.getVariableInfo("proc", {allowSelfAssigned:true}).params).toEqual([{name:"p",default:"pp"}]); + expect(childNode.getVariableInfo("$my.widget", {allowSelfAssigned:true}).params).toEqual([{name:"w",default:"ww"}]); // no params expected expect(childNode.getVariableInfo("abc", {allowSelfAssigned:true})).toEqual({text:"def"});