I think this aspect does not apply to any language other than C++. In modern languages, with modern compilers, JITs, and whatnot optimisations, I do not think it still makes any significant difference.
Actually assertEquals() should check if two arrays point to the same instance of an object, so it should not be the right thing to use here.
Like Flash said assertArrayEquals() should be used, but I read in the documentation for Java Test framework here that String Arrays are not supported.
fixed + upgraded to JUnit 5
I learned C/C++ in school and we used the postfix notation.
You can immediately recognize C++ programmer when they use
++i
instead ofi++
;)https://stackoverflow.com/questions/24901/is-there-a-performance-difference-between-i-and-i-in-c
I think this aspect does not apply to any language other than C++. In modern languages, with modern compilers, JITs, and whatnot optimisations, I do not think it still makes any significant difference.
Actually assertEquals() should check if two arrays point to the same instance of an object, so it should not be the right thing to use here.
Like Flash said assertArrayEquals() should be used, but I read in the documentation for Java Test framework here that String Arrays are not supported.
Gotta say which language.