minor refactor: improve test by not relying on toString() specific behavior