我们有一个函数可以对非空整数数组进行升序排序。例如,输入:-9 4 5 -1 10输出-9 -1 4 5 10问题是我们如何编写测试用例来涵盖所有的用例。提前感谢
发布于 2017-05-25 11:53:38
使用python:
>>> from random import randint as rint
>>> test_array = [rint(-100, 100) for i in range(100)] #random array to test
[78, -54, -88, ...]
>>> sorted(test_array) == my_array_after_testing #test if the arrays match uphttps://stackoverflow.com/questions/44171984
复制相似问题