mirror of
				https://github.com/binwiederhier/ntfy.git
				synced 2025-10-31 21:12:36 +01:00 
			
		
		
		
	Lots more tests
This commit is contained in:
		
							parent
							
								
									5ef83a7ba0
								
							
						
					
					
						commit
						e8688fed4b
					
				
					 6 changed files with 186 additions and 98 deletions
				
			
		|  | @ -73,7 +73,7 @@ func parseUnixTime(s string, now time.Time) (time.Time, error) { | |||
| 	} else if int64(t) < now.Unix() { | ||||
| 		return time.Time{}, errUnparsableTime | ||||
| 	} | ||||
| 	return time.Unix(int64(t), 0), nil | ||||
| 	return time.Unix(int64(t), 0).UTC(), nil | ||||
| } | ||||
| 
 | ||||
| func parseNaturalTime(s string, now time.Time) (time.Time, error) { | ||||
|  |  | |||
|  | @ -56,5 +56,5 @@ func TestParseFutureTime_1day(t *testing.T) { | |||
| func TestParseFutureTime_UnixTime(t *testing.T) { | ||||
| 	d, err := ParseFutureTime("1639183911", base) | ||||
| 	require.Nil(t, err) | ||||
| 	require.Equal(t, time.Date(2021, 12, 10, 19, 51, 51, 0, time.Local), d) | ||||
| 	require.Equal(t, time.Date(2021, 12, 11, 0, 51, 51, 0, time.UTC), d) | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Philipp Heckel
						Philipp Heckel