diff -Nru golang-github-beorn7-perks-0.0~git20150223.0.b965b61/debian/changelog golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/debian/changelog --- golang-github-beorn7-perks-0.0~git20150223.0.b965b61/debian/changelog 2016-06-19 18:09:40.000000000 +0000 +++ golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/debian/changelog 2016-11-23 14:06:45.000000000 +0000 @@ -1,3 +1,11 @@ +golang-github-beorn7-perks (0.0~git20160804.0.4c0e845-1) unstable; urgency=medium + + * New upstream snapshot. + * debian/control: Remove golang-go dependency from -dev package. + * debian/control: Replace golang-go with golang-any in Build-Depends. + + -- Martín Ferrari Wed, 23 Nov 2016 15:06:45 +0100 + golang-github-beorn7-perks (0.0~git20150223.0.b965b61-2) unstable; urgency=medium * debian/control: diff -Nru golang-github-beorn7-perks-0.0~git20150223.0.b965b61/debian/control golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/debian/control --- golang-github-beorn7-perks-0.0~git20150223.0.b965b61/debian/control 2016-06-19 18:09:40.000000000 +0000 +++ golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/debian/control 2016-11-23 14:06:45.000000000 +0000 @@ -7,7 +7,7 @@ Martín Ferrari Build-Depends: debhelper (>= 9), dh-golang (>= 1.17~), - golang-go + golang-any, Standards-Version: 3.9.8 Homepage: https://github.com/beorn7/perks Vcs-Browser: https://anonscm.debian.org/cgit/pkg-go/packages/golang-github-beorn7-perks.git @@ -16,9 +16,8 @@ Package: golang-github-beorn7-perks-dev Architecture: all -Depends: ${shlibs:Depends}, - ${misc:Depends}, - golang-go +Depends: ${misc:Depends}, + ${shlibs:Depends}, Description: effective computation of things This is a fork of github.com/bmizerany/perks (now unmaintained). The package contains: diff -Nru golang-github-beorn7-perks-0.0~git20150223.0.b965b61/.gitignore golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/.gitignore --- golang-github-beorn7-perks-0.0~git20150223.0.b965b61/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/.gitignore 2016-08-04 10:47:26.000000000 +0000 @@ -0,0 +1,2 @@ +*.test +*.prof diff -Nru golang-github-beorn7-perks-0.0~git20150223.0.b965b61/LICENSE golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/LICENSE --- golang-github-beorn7-perks-0.0~git20150223.0.b965b61/LICENSE 1970-01-01 00:00:00.000000000 +0000 +++ golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/LICENSE 2016-08-04 10:47:26.000000000 +0000 @@ -0,0 +1,20 @@ +Copyright (C) 2013 Blake Mizerany + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -Nru golang-github-beorn7-perks-0.0~git20150223.0.b965b61/quantile/stream.go golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/quantile/stream.go --- golang-github-beorn7-perks-0.0~git20150223.0.b965b61/quantile/stream.go 2015-11-05 04:59:24.000000000 +0000 +++ golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/quantile/stream.go 2016-08-04 10:47:26.000000000 +0000 @@ -133,7 +133,7 @@ if l == 0 { return 0 } - i := int(float64(l) * q) + i := int(math.Ceil(float64(l) * q)) if i > 0 { i -= 1 } diff -Nru golang-github-beorn7-perks-0.0~git20150223.0.b965b61/quantile/stream_test.go golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/quantile/stream_test.go --- golang-github-beorn7-perks-0.0~git20150223.0.b965b61/quantile/stream_test.go 2015-11-05 04:59:24.000000000 +0000 +++ golang-github-beorn7-perks-0.0~git20160804.0.4c0e845/quantile/stream_test.go 2016-08-04 10:47:26.000000000 +0000 @@ -33,6 +33,9 @@ for quantile, epsilon := range Targets { n := float64(len(a)) k := int(quantile * n) + if k < 1 { + k = 1 + } lower := int((quantile - epsilon) * n) if lower < 1 { lower = 1 @@ -99,6 +102,30 @@ verifyPercsWithAbsoluteEpsilon(t, a, s) } +func TestTargetedQuerySmallSampleSize(t *testing.T) { + rand.Seed(42) + s := NewTargeted(TargetsSmallEpsilon) + a := []float64{1, 2, 3, 4, 5} + for _, v := range a { + s.Insert(v) + } + verifyPercsWithAbsoluteEpsilon(t, a, s) + // If not yet flushed, results should be precise: + if !s.flushed() { + for φ, want := range map[float64]float64{ + 0.01: 1, + 0.10: 1, + 0.50: 3, + 0.90: 5, + 0.99: 5, + } { + if got := s.Query(φ); got != want { + t.Errorf("want %f for φ=%f, got %f", want, φ, got) + } + } + } +} + func TestLowBiasedQuery(t *testing.T) { rand.Seed(42) s := NewLowBiased(RelativeEpsilon)