Fossil SCM
Add test for newly added code that checks the datetime format is correct.
Commit
3740d83f39928e2b7a0ca3225746ac2d95be49e1
Parent
f2748b45353c0ed…
1 file changed
+14
+14
| --- test/amend.test | ||
| +++ test/amend.test | ||
| @@ -115,5 +115,19 @@ | ||
| 115 | 115 | test amend-date-1.1 {[string match "*uuid:*$UUID*$datetime*" $RESULT]} |
| 116 | 116 | fossil tag ls --raw $UUID |
| 117 | 117 | test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1} |
| 118 | 118 | fossil timeline -n 1 |
| 119 | 119 | test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]} |
| 120 | +set badformats { | |
| 121 | + "%+" | |
| 122 | + "%Y-%m-%d %H:%M%:%S %Z" | |
| 123 | + "%d/%m/%Y %H:%M%:%S %Z" | |
| 124 | + "%d/%m/%Y %H:%M%:%S" | |
| 125 | + "%d/%m/%Y" | |
| 126 | +} | |
| 127 | +set sc 0 | |
| 128 | +foreach badformat $badformats { | |
| 129 | + incr sc | |
| 130 | + set datetime [clock format $timestamp -format $badformat -gmt 1] | |
| 131 | + fossil amend $UUID -date $datetime | |
| 132 | + test amend-date-2.$sc {[string first "Unsupported date format, use YYYY-MM-DD HH:MM:SS" $RESULT] != -1} | |
| 133 | +} | |
| 120 | 134 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -115,5 +115,19 @@ | |
| 115 | test amend-date-1.1 {[string match "*uuid:*$UUID*$datetime*" $RESULT]} |
| 116 | fossil tag ls --raw $UUID |
| 117 | test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1} |
| 118 | fossil timeline -n 1 |
| 119 | test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]} |
| 120 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -115,5 +115,19 @@ | |
| 115 | test amend-date-1.1 {[string match "*uuid:*$UUID*$datetime*" $RESULT]} |
| 116 | fossil tag ls --raw $UUID |
| 117 | test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1} |
| 118 | fossil timeline -n 1 |
| 119 | test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]} |
| 120 | set badformats { |
| 121 | "%+" |
| 122 | "%Y-%m-%d %H:%M%:%S %Z" |
| 123 | "%d/%m/%Y %H:%M%:%S %Z" |
| 124 | "%d/%m/%Y %H:%M%:%S" |
| 125 | "%d/%m/%Y" |
| 126 | } |
| 127 | set sc 0 |
| 128 | foreach badformat $badformats { |
| 129 | incr sc |
| 130 | set datetime [clock format $timestamp -format $badformat -gmt 1] |
| 131 | fossil amend $UUID -date $datetime |
| 132 | test amend-date-2.$sc {[string first "Unsupported date format, use YYYY-MM-DD HH:MM:SS" $RESULT] != -1} |
| 133 | } |
| 134 |