...

Source file src/github.com/pelletier/go-toml/position_test.go

Documentation: github.com/pelletier/go-toml

     1  // Testing support for go-toml
     2  
     3  package toml
     4  
     5  import (
     6  	"testing"
     7  )
     8  
     9  func TestPositionString(t *testing.T) {
    10  	p := Position{123, 456}
    11  	expected := "(123, 456)"
    12  	value := p.String()
    13  
    14  	if value != expected {
    15  		t.Errorf("Expected %v, got %v instead", expected, value)
    16  	}
    17  }
    18  
    19  func TestInvalid(t *testing.T) {
    20  	for i, v := range []Position{
    21  		{0, 1234},
    22  		{1234, 0},
    23  		{0, 0},
    24  	} {
    25  		if !v.Invalid() {
    26  			t.Errorf("Position at %v is valid: %v", i, v)
    27  		}
    28  	}
    29  }
    30  

View as plain text