This test is very rough and might not always pass.

TODO: improve
