github.com/goki/ki@v1.1.11/nptime/nptime_test.go (about)

     1  // Copyright (c) 2018, The GoKi Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package nptime
     6  
     7  import (
     8  	"testing"
     9  	"time"
    10  )
    11  
    12  func TestTime(t *testing.T) {
    13  	tn := time.Now()
    14  	tp := Time{}
    15  	tp.SetTime(tn)
    16  	tnr := tp.Time()
    17  
    18  	if !tn.Equal(tnr) {
    19  		t.Errorf("time was not reconstructed properly: %v vs. %v\n", tn, tnr)
    20  	}
    21  }