- (username (or user-login-name "UNKNOWN_USER"))
- )
- (fset 't-ct (symbol-function 'current-time))
- (unwind-protect
- (progn
- (fset 'current-time (lambda () '(1 2 3)))
- (should (= 77 icalendar--uid-count))
- (should (string= (concat "xxx-123-77-" hash "-" username "-19640630")
- (icalendar--create-uid entry-full contents)))
- (should (= 78 icalendar--uid-count)))
- ;; restore 'current-time
- (fset 'current-time (symbol-function 't-ct)))
+ (username (or user-login-name "UNKNOWN_USER")))
+ (ert-with-function-mocked current-time (lambda () '(1 2 3))
+ (should (= 77 icalendar--uid-count))
+ (should (string= (concat "xxx-123-77-" hash "-" username "-19640630")
+ (icalendar--create-uid entry-full contents)))
+ (should (= 78 icalendar--uid-count)))