@echo off
set files=test-declaration.az
set files=%files% test-value.az
set files=%files% test-map.az
set files=%files% test-csv.az
set files=%files% test-dict.az
set files=%files% test-list-iterator.az
set files=%files% test-object.az
set files=%files% test-operator.az
set files=%files% test-function.az
set files=%files% test-repeater.az
set files=%files% test-block.az
set files=%files% test-re.az
set files=%files% test-string.az
set files=%files% test-application.az
set files=%files% test-error.az
set files=%files% test-formatter.az
set files=%files% test-sqlite3.az
set files=%files% test-filter.az
set files=%files% test-bytes.az
set files=%files% test-matrix.az
set files=%files% test-math.az
set files=%files% test-diff.az
set files=%files% test-optimize.az
set files=%files% test-module.az
set files=%files% test-graph.az
rem set files=%files% test-canvas.az
rem set files=%files% test-file.az

for %%F in (%files%) do ..\ascript --printcmdline %%F > result\%%~nF.result.txt
if "%1" == "print" goto print
if "%1" == "update" goto update
if "%1" == "clean" goto clean
for %%F in (%files%) do diff -u result\%%~nF.sample.txt result\%%~nF.result.txt
goto done
:print
for %%F in (%files%) do type result\%%~nF.result.txt
goto done
:update
for %%F in (%files%) do copy result\%%~nF.result.txt result\%%~nF.sample.txt >NUL
goto done
:clean
for %%F in (%files%) do del result\%%~nF.result.txt
goto done
:done
