mirror of
https://github.com/priyanshujain/messageboardbench.git
synced 2026-10-04 20:17:06 +00:00
Checkpoint experiments through SWE pilot v2
This commit is contained in:
1 parent
abacd5c5e1
commit
72d77018d8
845 files changed
+431756
-41
No files matched your search
@@ -0,0 +1,34 @@
|
||||
from func import min_operations_to_rearrange
|
||||
|
||||
def test_func(candidate):
|
||||
# Sample test cases
|
||||
assert candidate(6, 'BWBWBW', 'WWWBBB') == 4
|
||||
assert candidate(6, 'BBBBBB', 'WWWWWW') == -1
|
||||
assert candidate(14, 'BBBWBWWWBBWWBW', 'WBWWBBWWWBWBBB') == 7
|
||||
|
||||
# Additional test cases
|
||||
assert candidate(10, 'BBBBBWBWWW', 'BBWWWWWBBB') == -1
|
||||
assert candidate(14, 'WBWBWBWBWBWBWB', 'WWWWWWWBBBBBBB') == 8
|
||||
assert candidate(14, 'BWBBBWBBWBBWBB', 'WWWWBBBBBBBBBB') == 8
|
||||
assert candidate(14, 'BWBBBBBBBBBBBB', 'WBBBBBBBBBBBBB') == 4
|
||||
assert candidate(4, 'WWBB', 'BBWW') == 3
|
||||
assert candidate(4, 'BBWW', 'WWBB') == 7
|
||||
assert candidate(12, 'WBWWWWBWBBBB', 'BBBBBBWWWWWW') == 8
|
||||
assert candidate(3, 'BBW', 'BBW') == 0
|
||||
assert candidate(14, 'BWBWWWBBWBWWBW', 'WWWBBBWWBWBWWB') == 9
|
||||
assert candidate(3, 'BBW', 'WBB') == -1
|
||||
assert candidate(2, 'BW', 'WB') == -1
|
||||
assert candidate(2, 'BW', 'BW') == 0
|
||||
assert candidate(12, 'WBWBWBWBBBBB', 'BBBBBBBBWWWW') == 8
|
||||
assert candidate(14, 'WWWWWWWWWWWWWW', 'WWWWWWWWWWWWWW') == 0
|
||||
assert candidate(14, 'BBWBWBBBBBBBBB', 'WWBBBBBBBBBBBB') == 5
|
||||
assert candidate(9, 'WBWBWBWWW', 'WWWWWWBBB') == 6
|
||||
assert candidate(4, 'WWBB', 'WBWB') == -1
|
||||
assert candidate(14, 'WWWWBWWBWWBWWW', 'BBBWWWWWWWWWWW') == 7
|
||||
assert candidate(14, 'WBWBBBWWBWBBWB', 'BBBWWWBBWBWBBW') == 9
|
||||
assert candidate(4, 'BBWW', 'WWBB') == 3
|
||||
assert candidate(14, 'BWBWBWBWBWBWBW', 'BWBWBWBWBWBWBW') == 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_func(min_operations_to_rearrange)
|
||||
print("All tests passed!")
|
||||
Reference in new issue
Block a user