Skip to content

Commit dfd2226

Browse files
committed
DYN-10572 tests: generalize per-port Use Levels verification to sister variadic nodes
Adds regression tests for String.Join (separator prefix port + variadic port) and List.Join (pure-variadic over IList) confirming the per-port Use Levels fix generalizes across DSVarArgFunction shapes. The String.Join test also exercises the bounded post-pack UseLevelAndReplicationGuide pass with LevelAndReplicationGuideInputCount == 1, while the List.Join test exercises the count == 0 path on a [IsLacingDisabled] variadic node.
1 parent 978815d commit dfd2226

4 files changed

Lines changed: 434 additions & 0 deletions

File tree

test/DynamoCoreTests/Nodes/ListTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@ public void TestConcatenateListsNormalInput()
105105

106106
}
107107

108+
[Test]
109+
public void TestListJoinUseLevelsOnVariadicPort()
110+
{
111+
// DYN-10572: List.Join is a pure-variadic DSVarArgFunction (no non-variadic
112+
// prefix). With [IsLacingDisabled] on the C# method the node's lacing is
113+
// Disabled, so per-port Use Levels must still be honored pre-pack even
114+
// though no replication guides are applied. This test confirms the
115+
// variadic Use Levels path runs without breaking the post-pack pass
116+
// (which is a no-op here because LevelAndReplicationGuideInputCount is 0).
117+
string testFilePath = Path.Combine(listTestFolder, "TestListJoinUseLevelsOnVariadicPort.dyn");
118+
119+
RunModel(testFilePath);
120+
121+
AssertPreviewValue("dddd11110000222200003333dddd4444", new object[] { 1, 2, 3, 4 });
122+
}
123+
108124
#endregion
109125

110126
#region Test DiagonalLeftList

test/DynamoCoreTests/Nodes/StringTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,21 @@ public void TestJoinStringNormalInput()
226226

227227
}
228228

229+
[Test]
230+
public void TestJoinStringUseLevelsOnVariadicPort()
231+
{
232+
// DYN-10572: String.Join has both a non-variadic prefix port (separator)
233+
// and variadic ports. Set UseLevels on the separator port to exercise the
234+
// bounded post-pack pass (LevelAndReplicationGuideInputCount == 1) AND on
235+
// a variadic port to exercise the new pre-pack handling, confirming both
236+
// code paths cooperate correctly.
237+
string testFilePath = Path.Combine(localDynamoStringTestFolder, "TestJoinStringUseLevelsOnVariadicPort.dyn");
238+
239+
RunModel(testFilePath);
240+
241+
AssertPreviewValue("cccc11110000222200003333cccc4444", new string[] { "x-a", "x-b" });
242+
}
243+
229244
#endregion
230245

231246
#region number to string test cases
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
{
2+
"Uuid": "dddd0001-dddd-dddd-dddd-dddddddddddd",
3+
"IsCustomNode": false,
4+
"Description": "",
5+
"Name": "TestListJoinUseLevelsOnVariadicPort",
6+
"ElementResolver": {
7+
"ResolutionMap": {}
8+
},
9+
"Inputs": [],
10+
"Outputs": [],
11+
"Nodes": [
12+
{
13+
"ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore",
14+
"NodeType": "CodeBlockNode",
15+
"Code": "[1,2];",
16+
"Id": "dddd10000000000000000000000000a1",
17+
"Inputs": [],
18+
"Outputs": [
19+
{
20+
"Id": "dddd10000000000000000000000000b1",
21+
"Name": "",
22+
"Description": "Value of expression at line 1",
23+
"UsingDefaultValue": false,
24+
"Level": 2,
25+
"UseLevels": false,
26+
"KeepListStructure": false
27+
}
28+
],
29+
"Replication": "Disabled",
30+
"Description": "Allows for DesignScript code to be authored directly"
31+
},
32+
{
33+
"ConcreteType": "Dynamo.Graph.Nodes.CodeBlockNodeModel, DynamoCore",
34+
"NodeType": "CodeBlockNode",
35+
"Code": "[3,4];",
36+
"Id": "dddd10000000000000000000000000a2",
37+
"Inputs": [],
38+
"Outputs": [
39+
{
40+
"Id": "dddd10000000000000000000000000b2",
41+
"Name": "",
42+
"Description": "Value of expression at line 1",
43+
"UsingDefaultValue": false,
44+
"Level": 2,
45+
"UseLevels": false,
46+
"KeepListStructure": false
47+
}
48+
],
49+
"Replication": "Disabled",
50+
"Description": "Allows for DesignScript code to be authored directly"
51+
},
52+
{
53+
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSVarArgFunction, DynamoCore",
54+
"FunctionSignature": "DSCore.List.Join@var[]..[]",
55+
"FunctionType": "VariableArgument",
56+
"NodeType": "FunctionNode",
57+
"Id": "dddd11110000222200003333dddd4444",
58+
"Inputs": [
59+
{
60+
"Id": "dddd10000000000000000000000000c1",
61+
"Name": "list0",
62+
"Description": "Lists to join into one.\n\nvar[]..[]",
63+
"UsingDefaultValue": false,
64+
"Level": 2,
65+
"UseLevels": false,
66+
"KeepListStructure": false
67+
},
68+
{
69+
"Id": "dddd10000000000000000000000000c2",
70+
"Name": "list1",
71+
"Description": "Lists to join into one.\n\nvar[]..[]",
72+
"UsingDefaultValue": false,
73+
"Level": 1,
74+
"UseLevels": true,
75+
"KeepListStructure": false
76+
}
77+
],
78+
"Outputs": [
79+
{
80+
"Id": "dddd10000000000000000000000000d1",
81+
"Name": "list",
82+
"Description": "Joined list.",
83+
"UsingDefaultValue": false,
84+
"Level": 2,
85+
"UseLevels": false,
86+
"KeepListStructure": false
87+
}
88+
],
89+
"Replication": "Disabled",
90+
"Description": "Concatenates all given lists into a single list.\n\nList.Join (lists: var[]..[]): var[]..[]"
91+
}
92+
],
93+
"Connectors": [
94+
{
95+
"Start": "dddd10000000000000000000000000b1",
96+
"End": "dddd10000000000000000000000000c1",
97+
"Id": "dddd10000000000000000000000000e1",
98+
"IsHidden": "False"
99+
},
100+
{
101+
"Start": "dddd10000000000000000000000000b2",
102+
"End": "dddd10000000000000000000000000c2",
103+
"Id": "dddd10000000000000000000000000e2",
104+
"IsHidden": "False"
105+
}
106+
],
107+
"Dependencies": [],
108+
"NodeLibraryDependencies": [],
109+
"Thumbnail": "",
110+
"GraphDocumentationURL": null,
111+
"ExtensionWorkspaceData": [],
112+
"Author": "",
113+
"Linting": {
114+
"activeLinter": "None",
115+
"activeLinterId": "7b75fb44-43fd-4631-a878-29f4d5d8399a",
116+
"warningCount": 0,
117+
"errorCount": 0
118+
},
119+
"Bindings": [],
120+
"View": {
121+
"Dynamo": {
122+
"ScaleFactor": 1.0,
123+
"HasRunWithoutCrash": true,
124+
"IsVisibleInDynamoLibrary": true,
125+
"Version": "2.14.0.0",
126+
"RunType": "Automatic",
127+
"RunPeriod": "1000"
128+
},
129+
"Camera": {
130+
"Name": "Background Preview",
131+
"EyeX": -17.0,
132+
"EyeY": 24.0,
133+
"EyeZ": 50.0,
134+
"LookX": 12.0,
135+
"LookY": -13.0,
136+
"LookZ": -58.0,
137+
"UpX": 0.0,
138+
"UpY": 1.0,
139+
"UpZ": 0.0
140+
},
141+
"ConnectorPins": [],
142+
"NodeViews": [
143+
{
144+
"Name": "Code Block",
145+
"ShowGeometry": true,
146+
"Id": "dddd10000000000000000000000000a1",
147+
"IsSetAsInput": false,
148+
"IsSetAsOutput": false,
149+
"Excluded": false,
150+
"X": 0.0,
151+
"Y": 0.0
152+
},
153+
{
154+
"Name": "Code Block",
155+
"ShowGeometry": true,
156+
"Id": "dddd10000000000000000000000000a2",
157+
"IsSetAsInput": false,
158+
"IsSetAsOutput": false,
159+
"Excluded": false,
160+
"X": 0.0,
161+
"Y": 100.0
162+
},
163+
{
164+
"Name": "List.Join",
165+
"ShowGeometry": true,
166+
"Id": "dddd11110000222200003333dddd4444",
167+
"IsSetAsInput": false,
168+
"IsSetAsOutput": false,
169+
"Excluded": false,
170+
"X": 300.0,
171+
"Y": 50.0
172+
}
173+
],
174+
"Annotations": [],
175+
"X": 0.0,
176+
"Y": 0.0,
177+
"Zoom": 1.0
178+
}
179+
}

0 commit comments

Comments
 (0)