-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fix shuffle test #1454
Fix shuffle test #1454
Conversation
addons/arrays/test_shuffle.sqf
Outdated
_original = [1, 2, 3]; | ||
_result = _original call CBA_fnc_shuffle; | ||
TEST_OP(count _result,==,1,_fn); | ||
|
||
_original = []; | ||
_result = [_original] call CBA_fnc_shuffle; | ||
TEST_OP(count _result,==,count _original,_fn); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Maybe replace the test with: _original = [1, 2, 3];
_result = [_original] call CBA_fnc_shuffle;
TEST_OP(count _result,==,1,_fn); |
If I understand everything correctly, then the original test fails with params expected types script error: [1, 2, 3] params [["_array", [], [[]]], ["_inPlace", false, [false]]]; converts the 1 to [], and the 2 to false, and drops the 3. This may have broken when adding |
That's my quick analysis of it as well. The suggested replacement test seems more or less like the remaining first test, assuming you want 3 as expected count. CBA_A3/addons/arrays/test_shuffle.sqf Lines 16 to 18 in 224eb42
|
Ah, I missed that. Could just replace the assert line with TEST_OP(_result,isEqualTo,[],_fn); |
Sure, will do |
cbfc7e4
to
6d0cbb9
Compare
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
When merged this pull request will: