Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
ok then!
yep, I see this. You mean that C++ tests will be fixed and OK, but C# tests will remain buggy? Why so?
The problem is the same: tests in C++ expected "" (string.Empty) and tests in C# expect "" (string.Empty). If this was fixed for C++, why cannot this be fixed for C#?
But what's with C#?
It is about strings only.
Let's look into this case: Test Failed Expected is <System.String[3]>, actual is <System.String[0]> Values differ at index [0] Missing: < "0DTFT", "91XM2ANRPN6OK0PB", <string.Empty> >
So, initial string is "0DTFT 91XM2ANRPN6OK0PB". Why does <string.Empty> present in the array? <string.Empty> is just "", i.e. nothing.
So, virtually it is everywhere.
I mean:
"0DTFT 91XM2ANRPN6OK0PB"
<string.Empty> + "0DTFT 91XM2ANRPN6OK0PB"
"0DTFT 91XM2ANRPN6OK0PB" + <string.Empty>
<string.Empty> + <string.Empty> + "0DTFT 91XM2ANRPN6OK0PB"
"0DTFT 91XM2ANRPN6OK0PB" + <string.Empty> + <string.Empty>
"0DTFT" + <string.Empty> + " 91XM2ANRPN6OK0PB"
etc.
These are totally equal expressions.
They all equal to "0DTFT 91XM2ANRPN6OK0PB".
That is why the question: if I pass "0DTFT 91XM2ANRPN6OK0PB", but your test will expect "0DTFT", "91XM2ANRPN6OK0PB" and <string.Empty> at some random position - how can I submit my solution when test fails on correct solution?
Looks like it is about tests, not about C#.
UPD: This is this issue: https://www.codewars.com/kata/57e76bc428d6fbc2d500036d/discuss/csharp#6171cd2de4e130004d59122c. The tests expected "", which is the same as string.Empty. The guy ejini战神 wrote he somehow solved it.
so, what should we do?
In case when tests expect empty string at random position we have nondeterministic (probabilistic) tests which are inapplicable for use.
Why don't you want to create tests which will expect only non-empty strings at all array indexes?
thanks!
How about this?
public class Solution { public static string[] StringToArray(string str) { return new string[0]; } } }
Test Failed
Expected is <System.String[1]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < <string.Empty> >
Test Failed
Expected is <System.String[6]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < "63C4PJK", <string.Empty>, "UG1"... >
Test Failed
Expected is <System.String[2]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < <string.Empty>, "NGPIQNZ3LDFZ46GQ" >
Test Failed
Expected is <System.String[3]>, actual is <System.String[0]>
Values differ at index [0]
Missing: < "0DTFT", "91XM2ANRPN6OK0PB", <string.Empty> >
etc.
How can test wait for <string.Empty> if only non-empty strings are allowed in result array?
This comment is hidden because it contains spoiler information about the solution