2024-03-12 02:16:02 +00:00
|
|
|
// Copyright Terence J. Boldt (c)2021-2024
|
2023-01-04 04:24:48 +00:00
|
|
|
// Use of this source code is governed by an MIT
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// This file provides tests for conversion to and from ProDOS time format
|
|
|
|
|
2021-06-28 02:30:33 +00:00
|
|
|
package prodos
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestDateTimeToAndFromProDOS(t *testing.T) {
|
|
|
|
now := time.Now().Round(time.Minute)
|
|
|
|
|
|
|
|
got := DateTimeFromProDOS(DateTimeToProDOS(now))
|
|
|
|
if got != now {
|
|
|
|
t.Errorf("DateTimeFromProDOS(DateTimeToProDOS(now)) = %s; want %s", got.String(), now.String())
|
|
|
|
}
|
|
|
|
}
|