From 473acc61c8392dc7ae303d91568e179c4f105a76 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 2 Jul 2019 12:12:53 +0200 Subject: add black list --- .../x/text/secure/bidirule/bench_test.go | 54 -- .../golang.org/x/text/secure/bidirule/bidirule.go | 336 ---------- .../x/text/secure/bidirule/bidirule10.0.0.go | 11 - .../x/text/secure/bidirule/bidirule10.0.0_test.go | 694 --------------------- .../x/text/secure/bidirule/bidirule9.0.0.go | 14 - .../x/text/secure/bidirule/bidirule9.0.0_test.go | 668 -------------------- .../x/text/secure/bidirule/bidirule_test.go | 168 ----- 7 files changed, 1945 deletions(-) delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bench_test.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0_test.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0_test.go delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule_test.go (limited to 'vendor/golang.org/x/text/secure/bidirule') diff --git a/vendor/golang.org/x/text/secure/bidirule/bench_test.go b/vendor/golang.org/x/text/secure/bidirule/bench_test.go deleted file mode 100644 index 2db922b..0000000 --- a/vendor/golang.org/x/text/secure/bidirule/bench_test.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package bidirule - -import ( - "testing" - - "golang.org/x/text/internal/testtext" -) - -var benchData = []struct{ name, data string }{ - {"ascii", "Scheveningen"}, - {"arabic", "دبي"}, - {"hangul", "다음과"}, -} - -func doBench(b *testing.B, fn func(b *testing.B, data string)) { - for _, d := range benchData { - testtext.Bench(b, d.name, func(b *testing.B) { fn(b, d.data) }) - } -} - -func BenchmarkSpan(b *testing.B) { - r := New() - doBench(b, func(b *testing.B, str string) { - b.SetBytes(int64(len(str))) - data := []byte(str) - for i := 0; i < b.N; i++ { - r.Reset() - r.Span(data, true) - } - }) -} - -func BenchmarkDirectionASCII(b *testing.B) { - doBench(b, func(b *testing.B, str string) { - b.SetBytes(int64(len(str))) - data := []byte(str) - for i := 0; i < b.N; i++ { - Direction(data) - } - }) -} - -func BenchmarkDirectionStringASCII(b *testing.B) { - doBench(b, func(b *testing.B, str string) { - b.SetBytes(int64(len(str))) - for i := 0; i < b.N; i++ { - DirectionString(str) - } - }) -} diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule.go b/vendor/golang.org/x/text/secure/bidirule/bidirule.go deleted file mode 100644 index e2b70f7..0000000 --- a/vendor/golang.org/x/text/secure/bidirule/bidirule.go +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package bidirule implements the Bidi Rule defined by RFC 5893. -// -// This package is under development. The API may change without notice and -// without preserving backward compatibility. -package bidirule - -import ( - "errors" - "unicode/utf8" - - "golang.org/x/text/transform" - "golang.org/x/text/unicode/bidi" -) - -// This file contains an implementation of RFC 5893: Right-to-Left Scripts for -// Internationalized Domain Names for Applications (IDNA) -// -// A label is an individual component of a domain name. Labels are usually -// shown separated by dots; for example, the domain name "www.example.com" is -// composed of three labels: "www", "example", and "com". -// -// An RTL label is a label that contains at least one character of class R, AL, -// or AN. An LTR label is any label that is not an RTL label. -// -// A "Bidi domain name" is a domain name that contains at least one RTL label. -// -// The following guarantees can be made based on the above: -// -// o In a domain name consisting of only labels that satisfy the rule, -// the requirements of Section 3 are satisfied. Note that even LTR -// labels and pure ASCII labels have to be tested. -// -// o In a domain name consisting of only LDH labels (as defined in the -// Definitions document [RFC5890]) and labels that satisfy the rule, -// the requirements of Section 3 are satisfied as long as a label -// that starts with an ASCII digit does not come after a -// right-to-left label. -// -// No guarantee is given for other combinations. - -// ErrInvalid indicates a label is invalid according to the Bidi Rule. -var ErrInvalid = errors.New("bidirule: failed Bidi Rule") - -type ruleState uint8 - -const ( - ruleInitial ruleState = iota - ruleLTR - ruleLTRFinal - ruleRTL - ruleRTLFinal - ruleInvalid -) - -type ruleTransition struct { - next ruleState - mask uint16 -} - -var transitions = [...][2]ruleTransition{ - // [2.1] The first character must be a character with Bidi property L, R, or - // AL. If it has the R or AL property, it is an RTL label; if it has the L - // property, it is an LTR label. - ruleInitial: { - {ruleLTRFinal, 1 << bidi.L}, - {ruleRTLFinal, 1< 0 { - return - } - - r := New() - src := []byte(tc.in) - - n, err := r.Span(src[:tc.pSrc], tc.pSrc == len(tc.in)) - if err != tc.err0 { - t.Errorf("err0 was %v; want %v", err, tc.err0) - } - if n != tc.nSrc { - t.Fatalf("nSrc was %d; want %d", n, tc.nSrc) - } - - n, err = r.Span(src[n:], true) - if err != tc.err { - t.Errorf("error was %v; want %v", err, tc.err) - } - if got := n + tc.nSrc; got != tc.n { - t.Errorf("n was %d; want %d", got, tc.n) - } - }) -} - -func TestTransform(t *testing.T) { - doTests(t, func(t *testing.T, tc ruleTest) { - r := New() - - src := []byte(tc.in) - dst := make([]byte, len(tc.in)) - if tc.szDst > 0 { - dst = make([]byte, tc.szDst) - } - - // First transform operates on a zero-length string for most tests. - nDst, nSrc, err := r.Transform(dst, src[:tc.pSrc], tc.pSrc == len(tc.in)) - if err != tc.err0 { - t.Errorf("err0 was %v; want %v", err, tc.err0) - } - if nDst != nSrc { - t.Fatalf("nDst (%d) and nSrc (%d) should match", nDst, nSrc) - } - if nSrc != tc.nSrc { - t.Fatalf("nSrc was %d; want %d", nSrc, tc.nSrc) - } - - dst1 := make([]byte, len(tc.in)) - copy(dst1, dst[:nDst]) - - nDst, nSrc, err = r.Transform(dst1[nDst:], src[nSrc:], true) - if err != tc.err { - t.Errorf("error was %v; want %v", err, tc.err) - } - if nDst != nSrc { - t.Fatalf("nDst (%d) and nSrc (%d) should match", nDst, nSrc) - } - n := nSrc + tc.nSrc - if n != tc.n { - t.Fatalf("n was %d; want %d", n, tc.n) - } - if got, want := string(dst1[:n]), tc.in[:tc.n]; got != want { - t.Errorf("got %+q; want %+q", got, want) - } - }) -} -- cgit v1.2.3