Skip to content

Commit

Permalink
Add test cases for self modification in code block node
Browse files Browse the repository at this point in the history
  • Loading branch information
ke-yu committed Oct 20, 2016
1 parent 6554972 commit 3a17b6b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/DynamoCoreTests/DSEvaluationModelTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,16 @@ public void TestDictionaryDefinition2()
AssertPreviewValue("e7bf0921-cf77-4f37-8336-8aa9c56b22a6", new object[] { "qux" });
AssertPreviewValue("756497b4-4f7a-4ae3-9e5c-de5f69762d16", new object[] { 1024 });
}

[Test]
public void TestMAGN9507()
{
// x = {1, 2, 3};
// x = Count(x);
var dynFilePath = Path.Combine(TestDirectory, @"core\dsevaluation\MAGN-9507.dyn");
OpenModel(dynFilePath);
AssertPreviewValue("3bf992eb-ecc9-4fcc-a90b-9b1ee7e925e9", 3);
}
}

[Category("DSCustomNode")]
Expand Down
22 changes: 22 additions & 0 deletions test/core/dsevaluation/MAGN-9507.dyn
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Workspace Version="1.2.1.2931" X="0" Y="0" zoom="1" Name="Home" Description="" RunType="Automatic" RunPeriod="1000" HasRunWithoutCrash="True">
<NamespaceResolutionMap />
<Elements>
<Dynamo.Graph.Nodes.CodeBlockNodeModel guid="2ac2cd51-7fd9-40aa-a70e-cbf8fe96762a" type="Dynamo.Graph.Nodes.CodeBlockNodeModel" nickname="Code Block" x="88" y="170" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false" CodeText="{1,2,3};" ShouldFocus="false" />
<Dynamo.Graph.Nodes.CodeBlockNodeModel guid="a3d712af-3e73-4c53-8001-055b4c0b78fb" type="Dynamo.Graph.Nodes.CodeBlockNodeModel" nickname="Code Block" x="286" y="175" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="true" CodeText="x= y;&#xA;x = Count(x);" ShouldFocus="false">
<PortInfo index="0" default="False" />
</Dynamo.Graph.Nodes.CodeBlockNodeModel>
<CoreNodeModels.Watch guid="3bf992eb-ecc9-4fcc-a90b-9b1ee7e925e9" type="CoreNodeModels.Watch" nickname="Watch" x="497" y="184" isVisible="true" isUpstreamVisible="true" lacing="Disabled" isSelectedInput="False" IsFrozen="false" isPinned="false">
<PortInfo index="0" default="False" />
</CoreNodeModels.Watch>
</Elements>
<Connectors>
<Dynamo.Graph.Connectors.ConnectorModel start="2ac2cd51-7fd9-40aa-a70e-cbf8fe96762a" start_index="0" end="a3d712af-3e73-4c53-8001-055b4c0b78fb" end_index="0" portType="0" />
<Dynamo.Graph.Connectors.ConnectorModel start="a3d712af-3e73-4c53-8001-055b4c0b78fb" start_index="0" end="3bf992eb-ecc9-4fcc-a90b-9b1ee7e925e9" end_index="0" portType="0" />
</Connectors>
<Notes />
<Annotations />
<Presets />
<Cameras>
<Camera Name="Background Preview" eyeX="-17" eyeY="24" eyeZ="50" lookX="12" lookY="-13" lookZ="-58" upX="0" upY="1" upZ="0" />
</Cameras>
</Workspace>

0 comments on commit 3a17b6b

Please sign in to comment.