github.com/omniscale/go-osm@v0.3.1/replication/changeset/changeset_test.go (about)

     1  package changeset
     2  
     3  import (
     4  	"time"
     5  
     6  	"testing"
     7  )
     8  
     9  func TestParseYamlState(t *testing.T) {
    10  	state, err := parseYamlState([]byte(`---
    11  last_run: 2016-12-07 19:16:01.500000000 +00:00
    12  sequence: 2139110
    13  `))
    14  	if err != nil {
    15  		t.Fatal(err)
    16  	}
    17  	if state.Sequence != 2139110 {
    18  		t.Error("unexpected sequence", state)
    19  	}
    20  
    21  	expected := time.Date(2016, 12, 07, 19, 16, 01, 500000000, time.UTC)
    22  	if !state.Time.Time.Equal(expected) {
    23  		t.Error("unexpected time", state)
    24  	}
    25  
    26  }