Created
June 8, 2012 11:56
-
-
Save hyzhak/2895244 to your computer and use it in GitHub Desktop.
Test hamcrest.as to compare two ByteArrays
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
import org.hamcrest.assertThat; | |
import org.hamcrest.object.equalTo; | |
/** | |
* Test failed with message: | |
* | |
* Error: Expected: <test.string> | |
* but: was <test.string> | |
* | |
*/ | |
[Test] | |
public function testByteArrayComparison() : void | |
{ | |
var test : String = "test.string"; | |
var ba1 : ByteArray = new ByteArray(); | |
ba1.writeUTFBytes(test); | |
var ba2 : ByteArray = new ByteArray(); | |
ba2.writeUTFBytes(test); | |
assertThat(ba1, equalTo(ba2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment