Added two more test dates; pleased v vet
							parent
							
								
									1116fee3fc
								
							
						
					
					
						commit
						5ce431aa4a
					
				|  | @ -12,6 +12,7 @@ pub: | |||
| 	base_image string = 'archlinux:base-devel' | ||||
| } | ||||
| 
 | ||||
| // cmd returns the cli module that handles the cron daemon. | ||||
| pub fn cmd() cli.Command { | ||||
| 	return cli.Command{ | ||||
| 		name: 'cron' | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ fn (r1 ScheduledBuild) < (r2 ScheduledBuild) bool { | |||
| 	return r1.timestamp < r2.timestamp | ||||
| } | ||||
| 
 | ||||
| // cron starts a cron daemon & starts periodically scheduling builds. | ||||
| pub fn cron(conf Config) ? { | ||||
| 	ce := parse_expression('0 3') ? | ||||
| 	t := time.parse('2002-01-01 00:00:00') ? | ||||
|  |  | |||
|  | @ -25,4 +25,10 @@ fn test_next_simple() ? { | |||
| 	util_test_time('0 3', '2002-01-01 04:00:00', '2002-01-02 03:00:00') ? | ||||
| 
 | ||||
| 	util_test_time('0 3/4', '2002-01-01 04:00:00', '2002-01-01 07:00:00') ? | ||||
| 
 | ||||
| 	// Overlap to next month | ||||
| 	util_test_time('0 3', '2002-11-31 04:00:00', '2002-12-01 03:00:00') ? | ||||
| 
 | ||||
| 	// Overlap to next year | ||||
| 	util_test_time('0 3', '2002-12-31 04:00:00', '2003-01-01 03:00:00') ? | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue