Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
While having the unit test case writing for French and Czech localization, on doing
assertThat(formattedDecimal).isEqualTo("8 771,23");
where formattedDecimal
is a string ,
had a result
org.junit.ComparisonFailure:
Expected :"8 771,23"
Actual :"8 771,23"
why it failed? did not understand, please guide what i am doing wrong here!!
–
–
–
maybe your formattedDecimal
including some control letters that can't see in the console. have you tried this?
assertThat("foo\bo").isNotEqualTo("foo");// ok
// ^--- it print "foo"
assertThat(formattedDecimal.getBytes()).isEqualTo("8 771,23".getBytes())
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.