Last active
August 29, 2015 14:23
-
-
Save giorgiosironi/4d49638448e9c8ea63c0 to your computer and use it in GitHub Desktop.
Verifying sort() over an input
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
sort($array); | |
for ($i = 0; $i < count($array) - 1; $i++) { | |
$this->assertTrue( | |
$array[$i] <= $array[$i+1], | |
"Array is not sorted: " . var_export($array, true) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment