Rewrite attr-req-value and add tests