-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes in computing function endpoints for replication cases #9632
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4927,7 +4927,7 @@ public void TestReplicationInInlineConditional() | |
thisTest.Verify("r", new object[] { 2, 5, 7 }); | ||
} | ||
|
||
// This tests the case 2 block in the computeFeps method(CallSite.cs line:943) | ||
// This tests the case 2 block in the computeFeps method (CallSite.cs) | ||
[Test] | ||
public void TestReplicationWithEmptyListInNestedLists() | ||
{ | ||
|
@@ -4944,7 +4944,7 @@ public void TestReplicationWithEmptyListInNestedLists() | |
thisTest.Verify("px2", new object[] { new object[] { 0 }, new object[] { } }); | ||
} | ||
|
||
// This tests the case 4 block in the computeFeps method(CallSite.cs line:943) | ||
// This tests the case 4 block in the computeFeps method (CallSite.cs) | ||
[Test] | ||
public void TestReplicationWithNullElementInNestedLists() | ||
{ | ||
|
@@ -4962,7 +4962,7 @@ public void TestReplicationWithNullElementInNestedLists() | |
thisTest.Verify("px2", new object[] { new object[] { 0 }, null }); | ||
} | ||
|
||
// This tests the case:6 block in the computeFeps method(CallSite.cs line:943) | ||
// This tests the case:6 block in the computeFeps method (CallSite.cs) | ||
// input example for case 6: l4 and l5 lists. | ||
[Test] | ||
public void TestReplicationWithArraysOfDifferentRanks() | ||
|
@@ -4990,6 +4990,63 @@ public void TestReplicationWithArraysOfDifferentRanks() | |
thisTest.Verify("px4", new object[] { null, new object[] { 0 }, new object[] { new object[] { 0 } } }); | ||
thisTest.Verify("px5", new object[] { null, new object[] { new object[] { 0 } }, new object[] { 0 } }); | ||
} | ||
|
||
// This tests the case 4 block (with type conversion) in the computeFeps method (CallSite.cs) | ||
[Test] | ||
public void TestReplicationWithMixedOptionTypeConversion() | ||
{ | ||
string code = @" | ||
def foo ( a : double[], b :double[] ) | ||
{ | ||
return = Count(a) + Count(b); | ||
} | ||
a = [ 1, 2 ]; | ||
b = [[3, 4], [5,9]]; | ||
c = b[[0.1,1.1]][0..1]; | ||
test = foo (c, a[0..1]);"; | ||
|
||
var mirror = thisTest.RunScriptSource(code); | ||
thisTest.Verify("c", new object[] {new[] {3, 4}, new[] {5, 9}}); | ||
thisTest.Verify("test", new[] {4, 4}); | ||
} | ||
|
||
// This tests the case 2 block in the computeFeps method (CallSite.cs) | ||
[Test] | ||
public void TestReplicationWithMixedOptionExactMatch() | ||
{ | ||
string code = @" | ||
def foo ( a : double[], b :double[] ) | ||
{ | ||
return = Count(a) + Count(b); | ||
} | ||
a = [ 1, 2 ]; | ||
b = [[3, 4], [5,9]]; | ||
c = b[[0,1]][0..1]; | ||
test = foo (c,a[0..1]);"; | ||
|
||
var mirror = thisTest.RunScriptSource(code); | ||
thisTest.Verify("c", new object[] { new[] { 3, 4 }, new[] { 5, 9 } }); | ||
thisTest.Verify("test", new[] { 4, 4 }); | ||
} | ||
|
||
// This tests the case 6 block in the computeFeps method (CallSite.cs) | ||
[Test] | ||
public void TestReplicationWithNonConvertibles() | ||
{ | ||
string code = @" | ||
def foo ( a : double[], b :double[] ) | ||
{ | ||
return = Count(a) + Count(b); | ||
} | ||
a = [ 1, 2 ]; | ||
b = [[3, 4], [5,9]]; | ||
c = b[[true,0]][0..1]; // [[b[true][0], b[true, 1]], [b[0,0], b[0,1]]] => [null, [3, 4]] | ||
test = foo (c, a[0..1]); "; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor change, extra spaces here at the end of the string. |
||
var mirror = thisTest.RunScriptSource(code); | ||
thisTest.Verify("c", new object[] { null, new[] { 3, 4 } }); | ||
thisTest.Verify("test", new[] { 3, 4 }); | ||
|
||
} | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't
a[0..1]
just equal toa
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes they are same.