File: csi_test.go

package info (click to toggle)
golang-github-brentp-bix 0.0~git20250701.000f089%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 548 kB
  • sloc: python: 42; makefile: 10
file content (39 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package bix

import (
	"compress/gzip"
	"os"
	"testing"

	. "gopkg.in/check.v1"
)

func Test(t *testing.T) { TestingT(t) }

type BixSuite struct{}

var _ = Suite(&BixSuite{})

func (s *BixSuite) TestReadCSI(c *C) {
	f, err := os.Open("tests/csitest.bed.gz.csi")
	if err != nil {
		c.Fatal(err)
	}
	g, err := gzip.NewReader(f)
	if err != nil {
		c.Fatal(err)
	}

	cs, err := NewCSI(g)
	if err != nil {
		c.Fatal(err)
	}
	c.Check(cs.NameColumn(), Equals, 1)
	c.Check(cs.BeginColumn(), Equals, 2)
	c.Check(cs.EndColumn(), Equals, 3)
	c.Check(cs.Skip(), Equals, 0)
	c.Check(cs.NumRefs(), Equals, len(cs.chroms))
	c.Check(cs.MetaChar(), Equals, '#')
	c.Check(cs.chroms, DeepEquals, []string{"1", "2", "3", "4", "5", "6", "9"})

}