maybe use `$text` directly and do not use `$expected`