Commits

Sebastian Freundt committed 9a3b94a Merge

Merge branch 'next'

* next:
minor, treat beginning of buffer differently in dt_io_find_strpd(), fixes dcal.10.dt issue
minor, provide regression tests for sed mode
minor, list t tools (for time fiddling) in build summary

Comments (0)

Files changed (5)

 AM_MISSING_PROG([HELP2MAN], [help2man], ["${missing_dir}"])
 
 ## trivial, no special stuff needed
-apps=" dadd dcal ddiff dseq dtest strptime"
+apps=" dadd dcal ddiff dseq dtest strptime tseq tadd tdiff"
 
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([lib/Makefile])
 	const char *__sp = str;
 	struct dt_d_s d = {DT_UNK};
 
-	while ((__sp = strstr(__sp, needle)) &&
-	       (d = dt_io_strpd_ep(
-			__sp += needlen, fmt, nfmt, ep)).typ == DT_UNK);
+	if ((d = dt_io_strpd_ep(__sp, fmt, nfmt, ep)).typ == DT_UNK) {
+		while ((__sp = strstr(__sp, needle)) &&
+		       (d = dt_io_strpd_ep(
+				__sp += needlen, fmt, nfmt, ep)).typ == DT_UNK);
+	}
 	*sp = (char*)__sp;
 	return d;
 }
 TESTS += dcal.6.dt
 TESTS += dcal.7.dt
 TESTS += dcal.8.dt
+TESTS += dcal.9.dt
+TESTS += dcal.10.dt
 
 TESTS += dadd.1.dt
 TESTS += dadd.2.dt
+## -*- shell-script -*-
+
+TOOL=dcal
+CMDLINE="-f \"ymd\" -S -i \"%d/%b/%Y\""
+
+## STDIN
+stdin=$(mktemp)
+cat > "${stdin}" <<EOF
+06/Oct/2011	0.947
+06/Oct/2011	1.155
+06/Oct/2011	1.171
+06/Oct/2011	1.223
+06/Oct/2011	1.240
+06/Oct/2011	1.289
+06/Oct/2011	1.307
+06/Oct/2011	1.353
+06/Oct/2011	1.372
+06/Oct/2011	1.425
+06/Oct/2011	1.445
+06/Oct/2011	1.556
+06/Oct/2011	1.578
+06/Oct/2011	1.611
+06/Oct/2011	1.633
+06/Oct/2011	1.675
+06/Oct/2011	1.698
+06/Oct/2011	1.755
+06/Oct/2011	1.779
+06/Oct/2011	1.813
+06/Oct/2011	1.838
+06/Oct/2011	1.861
+06/Oct/2011	1.887
+06/Oct/2011	1.918
+06/Oct/2011	1.945
+06/Oct/2011	1.966
+06/Oct/2011	1.993
+06/Oct/2011	2.034
+06/Oct/2011	2.062
+06/Oct/2011	2.082
+06/Oct/2011	2.111
+06/Oct/2011	0.687
+06/Oct/2011	0.658
+06/Oct/2011	0.626
+06/Oct/2011	0.568
+06/Oct/2011	0.518
+06/Oct/2011	0.501
+EOF
+ 
+## STDOUT
+stdout=$(mktemp)
+cat > "${stdout}" <<EOF
+2011-10-06	0.947
+2011-10-06	1.155
+2011-10-06	1.171
+2011-10-06	1.223
+2011-10-06	1.240
+2011-10-06	1.289
+2011-10-06	1.307
+2011-10-06	1.353
+2011-10-06	1.372
+2011-10-06	1.425
+2011-10-06	1.445
+2011-10-06	1.556
+2011-10-06	1.578
+2011-10-06	1.611
+2011-10-06	1.633
+2011-10-06	1.675
+2011-10-06	1.698
+2011-10-06	1.755
+2011-10-06	1.779
+2011-10-06	1.813
+2011-10-06	1.838
+2011-10-06	1.861
+2011-10-06	1.887
+2011-10-06	1.918
+2011-10-06	1.945
+2011-10-06	1.966
+2011-10-06	1.993
+2011-10-06	2.034
+2011-10-06	2.062
+2011-10-06	2.082
+2011-10-06	2.111
+2011-10-06	0.687
+2011-10-06	0.658
+2011-10-06	0.626
+2011-10-06	0.568
+2011-10-06	0.518
+2011-10-06	0.501
+EOF
+
+## dcal.10.dt ends here
+## -*- shell-script -*-
+
+TOOL=dcal
+CMDLINE="-f \"ymd\" -S -i \"%d/%b/%Y\""
+
+## STDIN
+stdin=$(mktemp)
+cat > "${stdin}" <<EOF
+EONIA	06/Oct/2011	0.947
+EURIBOR1W	06/Oct/2011	1.155
+EURIBOR1W_365	06/Oct/2011	1.171
+EURIBOR2W	06/Oct/2011	1.223
+EURIBOR2W_365	06/Oct/2011	1.240
+EURIBOR3W	06/Oct/2011	1.289
+EURIBOR3W_365	06/Oct/2011	1.307
+EURIBOR1M	06/Oct/2011	1.353
+EURIBOR1M_365	06/Oct/2011	1.372
+EURIBOR2M	06/Oct/2011	1.425
+EURIBOR2M_365	06/Oct/2011	1.445
+EURIBOR3M	06/Oct/2011	1.556
+EURIBOR3M_365	06/Oct/2011	1.578
+EURIBOR4M	06/Oct/2011	1.611
+EURIBOR4M_365	06/Oct/2011	1.633
+EURIBOR5M	06/Oct/2011	1.675
+EURIBOR5M_365	06/Oct/2011	1.698
+EURIBOR6M	06/Oct/2011	1.755
+EURIBOR6M_365	06/Oct/2011	1.779
+EURIBOR7M	06/Oct/2011	1.813
+EURIBOR7M_365	06/Oct/2011	1.838
+EURIBOR8M	06/Oct/2011	1.861
+EURIBOR8M_365	06/Oct/2011	1.887
+EURIBOR9M	06/Oct/2011	1.918
+EURIBOR9M_365	06/Oct/2011	1.945
+EURIBOR10M	06/Oct/2011	1.966
+EURIBOR10M_365	06/Oct/2011	1.993
+EURIBOR11M	06/Oct/2011	2.034
+EURIBOR11M_365	06/Oct/2011	2.062
+EURIBOR12M	06/Oct/2011	2.082
+EURIBOR12M_365	06/Oct/2011	2.111
+EUREPO1W	06/Oct/2011	0.687
+EUREPO2W	06/Oct/2011	0.658
+EUREPO1M	06/Oct/2011	0.626
+EUREPO3M	06/Oct/2011	0.568
+EUREPO6M	06/Oct/2011	0.518
+EUREPO12M	06/Oct/2011	0.501
+EOF
+ 
+## STDOUT
+stdout=$(mktemp)
+cat > "${stdout}" <<EOF
+EONIA	2011-10-06	0.947
+EURIBOR1W	2011-10-06	1.155
+EURIBOR1W_365	2011-10-06	1.171
+EURIBOR2W	2011-10-06	1.223
+EURIBOR2W_365	2011-10-06	1.240
+EURIBOR3W	2011-10-06	1.289
+EURIBOR3W_365	2011-10-06	1.307
+EURIBOR1M	2011-10-06	1.353
+EURIBOR1M_365	2011-10-06	1.372
+EURIBOR2M	2011-10-06	1.425
+EURIBOR2M_365	2011-10-06	1.445
+EURIBOR3M	2011-10-06	1.556
+EURIBOR3M_365	2011-10-06	1.578
+EURIBOR4M	2011-10-06	1.611
+EURIBOR4M_365	2011-10-06	1.633
+EURIBOR5M	2011-10-06	1.675
+EURIBOR5M_365	2011-10-06	1.698
+EURIBOR6M	2011-10-06	1.755
+EURIBOR6M_365	2011-10-06	1.779
+EURIBOR7M	2011-10-06	1.813
+EURIBOR7M_365	2011-10-06	1.838
+EURIBOR8M	2011-10-06	1.861
+EURIBOR8M_365	2011-10-06	1.887
+EURIBOR9M	2011-10-06	1.918
+EURIBOR9M_365	2011-10-06	1.945
+EURIBOR10M	2011-10-06	1.966
+EURIBOR10M_365	2011-10-06	1.993
+EURIBOR11M	2011-10-06	2.034
+EURIBOR11M_365	2011-10-06	2.062
+EURIBOR12M	2011-10-06	2.082
+EURIBOR12M_365	2011-10-06	2.111
+EUREPO1W	2011-10-06	0.687
+EUREPO2W	2011-10-06	0.658
+EUREPO1M	2011-10-06	0.626
+EUREPO3M	2011-10-06	0.568
+EUREPO6M	2011-10-06	0.518
+EUREPO12M	2011-10-06	0.501
+EOF
+
+## dcal.9.dt ends here