projects
/
lightning.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump slice-numpy memory.
[lightning.git]
/
taglib_test.go
diff --git
a/taglib_test.go
b/taglib_test.go
index c023ab5fccc52a15422829cf1e8e44c0d5259379..bd9361482fae7c4eabe337407249567ed0f8e27b 100644
(file)
--- a/
taglib_test.go
+++ b/
taglib_test.go
@@
-1,4
+1,8
@@
-package main
+// Copyright (C) The Lightning Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package lightning
import (
"bufio"
import (
"bufio"
@@
-19,6
+23,12
@@
type taglibSuite struct{}
var _ = check.Suite(&taglibSuite{})
var _ = check.Suite(&taglibSuite{})
+type tagMatch struct {
+ id tagID
+ pos int
+ taglen int
+}
+
func (s *taglibSuite) TestFindAllTinyData(c *check.C) {
pr, pw, err := os.Pipe()
c.Assert(err, check.IsNil)
func (s *taglibSuite) TestFindAllTinyData(c *check.C) {
pr, pw, err := os.Pipe()
c.Assert(err, check.IsNil)
@@
-35,10
+45,10
@@
gactctagcagagtggccagccac
c.Assert(err, check.IsNil)
haystack := []byte(`ggagaactgtgctccgccttcagaccccccccccccccccccccacacatgctagcgcgtcggggtgggggggggggggggggggggggggggactctagcagagtggccagccac`)
var matches []tagMatch
c.Assert(err, check.IsNil)
haystack := []byte(`ggagaactgtgctccgccttcagaccccccccccccccccccccacacatgctagcgcgtcggggtgggggggggggggggggggggggggggactctagcagagtggccagccac`)
var matches []tagMatch
- taglib.FindAll(haystack, func(id tagID, pos int) {
- matches = append(matches, tagMatch{id, pos})
+ taglib.FindAll(haystack, func(id tagID, pos
, taglen
int) {
+ matches = append(matches, tagMatch{id, pos
, taglen
})
})
})
- c.Check(matches, check.DeepEquals, []tagMatch{{0, 0
}, {1, 44}, {2, 92
}})
+ c.Check(matches, check.DeepEquals, []tagMatch{{0, 0
, 24}, {1, 44, 24}, {2, 92, 24
}})
}
func (s *taglibSuite) TestFindAllRealisticSize(c *check.C) {
}
func (s *taglibSuite) TestFindAllRealisticSize(c *check.C) {
@@
-80,10
+90,10
@@
func (s *taglibSuite) TestFindAllRealisticSize(c *check.C) {
c.Assert(err, check.IsNil)
c.Logf("@%v find tags in input", time.Since(start))
var matches []tagMatch
c.Assert(err, check.IsNil)
c.Logf("@%v find tags in input", time.Since(start))
var matches []tagMatch
- taglib.FindAll(haystack, func(id tagID, pos int) {
- matches = append(matches, tagMatch{id, pos})
+ taglib.FindAll(haystack, func(id tagID, pos
, taglen
int) {
+ matches = append(matches, tagMatch{id, pos
, taglen
})
})
c.Logf("@%v done", time.Since(start))
})
c.Logf("@%v done", time.Since(start))
- c.Check(matches[0], check.Equals, tagMatch{0, 0})
+ c.Check(matches[0], check.Equals, tagMatch{0, 0
, tagsize
})
c.Check(matches[1].id, check.Equals, tagID(1))
}
c.Check(matches[1].id, check.Equals, tagID(1))
}