refined test-diff script