Add a test script for for-each-ref, including test of date formatting