File: query_test.go

package info (click to toggle)
aptly 1.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,928 kB
  • sloc: python: 10,398; sh: 252; makefile: 184
file content (23 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package deb

import (
	. "gopkg.in/check.v1"
)

type QuerySuite struct {
}

var _ = Suite(&QuerySuite{})

func (s *QuerySuite) TestVersionCompare(c *C) {
	q := FieldQuery{"Version", VersionLess, "5.0.0.2", nil}

	p100 := Package{}
	p100.Version = "5.0.0.100"

	p1 := Package{}
	p1.Version = "5.0.0.1"

	c.Check(q.Matches(&p100), Equals, false)
	c.Check(q.Matches(&p1), Equals, true)
}