Fossil

Check-in [3740d83f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add test for newly added code that checks the datetime format is correct.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | check-in-edit
Files: files | file ages | folders
SHA1: 3740d83f39928e2b7a0ca3225746ac2d95be49e1
User & Date: andybradford 2015-08-01 01:47:47
Context
2015-08-01
06:40
Make -close and -hide no-ops if the checkin already has those tags. check-in: 1c8fdd25 user: andybradford tags: check-in-edit
01:47
Add test for newly added code that checks the datetime format is correct. check-in: 3740d83f user: andybradford tags: check-in-edit
2015-07-31
07:33
Add test for -date option. check-in: f2748b45 user: andybradford tags: check-in-edit
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/amend.test.

113
114
115
116
117
118
119














set datetime "$date $time"
fossil amend $UUID -date $datetime
test amend-date-1.1 {[string match "*uuid:*$UUID*$datetime*" $RESULT]}
fossil tag ls --raw $UUID
test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1}
fossil timeline -n 1
test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]}





















>
>
>
>
>
>
>
>
>
>
>
>
>
>
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
set datetime "$date $time"
fossil amend $UUID -date $datetime
test amend-date-1.1 {[string match "*uuid:*$UUID*$datetime*" $RESULT]}
fossil tag ls --raw $UUID
test amend-date-1.2 {[string first "date=$datetime" $RESULT] != -1}
fossil timeline -n 1
test amend-date-1.3 {[string match "*Timestamp*$date*$time*" $RESULT]}
set badformats {
  "%+"
  "%Y-%m-%d %H:%M%:%S %Z"
  "%d/%m/%Y %H:%M%:%S %Z"
  "%d/%m/%Y %H:%M%:%S"
  "%d/%m/%Y"
}
set sc 0
foreach badformat $badformats {
  incr sc
  set datetime [clock format $timestamp -format $badformat -gmt 1]
  fossil amend $UUID -date $datetime
  test amend-date-2.$sc {[string first "Unsupported date format, use YYYY-MM-DD HH:MM:SS" $RESULT] != -1}
}