go-hep.org/x/hep@v0.38.1/heppdt/heppdt_test.go (about)

     1  // Copyright ©2018 The go-hep 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 heppdt_test
     6  
     7  import (
     8  	"testing"
     9  
    10  	"go-hep.org/x/hep/heppdt"
    11  )
    12  
    13  func TestDefaultTable(t *testing.T) {
    14  	if got, want := heppdt.Name(), "particle.tbl"; got != want {
    15  		t.Fatalf("invalid table name. got=%q, want=%q", got, want)
    16  	}
    17  
    18  	if got, want := heppdt.Len(), 534; got != want {
    19  		t.Fatalf("invalid table length. got=%d, want=%d", got, want)
    20  	}
    21  
    22  	particles := heppdt.PDT()
    23  	if got, want := particles[1].Name, "d"; got != want {
    24  		t.Fatalf("invalid particle for pid=1. got=%q, want=%q", got, want)
    25  	}
    26  }