// Copyright 2015 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // The go-ethereum library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with the go-ethereum library. If not, see . package tests import ( "bytes" "encoding/hex" "errors" "fmt" "io" "math/big" "os" "strings" "github.com/ethereum/go-ethereum/rlp" ) // RLPTest is the JSON structure of a single RLP test. type RLPTest struct { // If the value of In is "INVALID" or "VALID", the test // checks whether Out can be decoded into a value of // type interface{}. // // For other JSON values, In is treated as a driver for // calls to rlp.Stream. The test also verifies that encoding // In produces the bytes in Out. In interface{} // Out is a hex-encoded RLP value. Out string } // RunRLPTest runs the tests in the given file, skipping tests by name. func RunRLPTest(file string, skip []string) error { f, err := os.Open(file) if err != nil { return err } defer f.Close() return RunRLPTestWithReader(f, skip) } // RunRLPTest runs the tests encoded in r, skipping tests by name. func RunRLPTestWithReader(r io.Reader, skip []string) error { var tests map[string]*RLPTest if err := readJson(r, &tests); err != nil { return err } for _, s := range skip { delete(tests, s) } for name, test := range tests { if err := test.Run(); err != nil { return fmt.Errorf("test %q failed: %v", name, err) } } return nil } // Run executes the test. func (t *RLPTest) Run() error { outb, err := hex.DecodeString(t.Out) if err != nil { return fmt.Errorf("invalid hex in Out") } // Handle simple decoding tests with no actual In value. if t.In == "VALID" || t.In == "INVALID" { return checkDecodeInterface(outb, t.In == "VALID") } // Check whether encoding the value produces the same bytes. in := translateJSON(t.In) b, err := rlp.EncodeToBytes(in) if err != nil { return fmt.Errorf("encode failed: %v", err) } if !bytes.Equal(b, outb) { return fmt.Errorf("encode produced %x, want %x", b, outb) } // Test stream decoding. s := rlp.NewStream(bytes.NewReader(outb), 0) return checkDecodeFromJSON(s, in) } func checkDecodeInterface(b []byte, isValid bool) error { err := rlp.DecodeBytes(b, new(interface{})) switch { case isValid && err != nil: return fmt.Errorf("decoding failed: %v", err) case !isValid && err == nil: return fmt.Errorf("decoding of invalid value succeeded") } return nil } // translateJSON makes test json values encodable with RLP. func translateJSON(v interface{}) interface{} { switch v := v.(type) { case float64: return uint64(v) case string: if len(v) > 0 && v[0] == '#' { // # starts a faux big int. big, ok := new(big.Int).SetString(v[1:], 10) if !ok { panic(fmt.Errorf("bad test: bad big int: %q", v)) } return big } return []byte(v) case []interface{}: new := make([]interface{}, len(v)) for i := range v { new[i] = translateJSON(v[i]) } return new default: panic(fmt.Errorf("can't handle %T", v)) } } // checkDecodeFromJSON decodes from s guided by exp. exp drives the // Stream by invoking decoding operations (Uint, Big, List, ...) based // on the type of each value. The value decoded from the RLP stream // must match the JSON value. func checkDecodeFromJSON(s *rlp.Stream, exp interface{}) error { switch exp := exp.(type) { case uint64: i, err := s.Uint() if err != nil { return addStack("Uint", exp, err) } if i != exp { return addStack("Uint", exp, fmt.Errorf("result mismatch: got %d", i)) } case *big.Int: big := new(big.Int) if err := s.Decode(&big); err != nil { return addStack("Big", exp, err) } if big.Cmp(exp) != 0 { return addStack("Big", exp, fmt.Errorf("result mismatch: got %d", big)) } case []byte: b, err := s.Bytes() if err != nil { return addStack("Bytes", exp, err) } if !bytes.Equal(b, exp) { return addStack("Bytes", exp, fmt.Errorf("result mismatch: got %x", b)) } case []interface{}: if _, err := s.List(); err != nil { return addStack("List", exp, err) } for i, v := range exp { if err := checkDecodeFromJSON(s, v); err != nil { return addStack(fmt.Sprintf("[%d]", i), exp, err) } } if err := s.ListEnd(); err != nil { return addStack("ListEnd", exp, err) } default: panic(fmt.Errorf("unhandled type: %T", exp)) } return nil } func addStack(op string, val interface{}, err error) error { lines := strings.Split(err.Error(), "\n") lines = append(lines, fmt.Sprintf("\t%s: %v", op, val)) return errors.New(strings.Join(lines, "\n")) } ron4/files/lodash-4.17.15 FreeBSD Ports (https://github.com/freebsd/freebsd-ports)
aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils
Commit message (Expand)AuthorAgeFilesLines
* - rerolled distfile with small source changes and corected ChangeLogDirk Meyer2003-04-201-0/+1
* Upgrade to 008.Oliver Braun2003-04-202-2/+3
* Remove USE_GNOMENG.Joe Marcus Clarke2003-04-1916-16/+0
* - Update to 0.5.1Dirk Meyer2003-04-193-17/+3
* Add karamba, a program that displays various information on your KDE desktopTilman Keskinoz2003-04-165-0/+44
* Add kbirthday, a kde kicker-applet, that reminds you of birthdays from theTilman Keskinoz2003-04-165-0/+48
* Take maintainership in agreement with the submitter/developer.Oliver Braun2003-04-141-1/+1
* - Use libobjc.soDirk Meyer2003-04-132-62/+14
* Add rolo 007, text-based contact management software.Oliver Braun2003-04-125-0/+35
* * Add a missing dependency on popt [1]Joe Marcus Clarke2003-04-121-3/+3
* Fix build on CURRENTTilman Keskinoz2003-04-091-1/+9
* * Update to new GNOME infrastructureJoe Marcus Clarke2003-04-072-10/+4
* Rejoice, for the long awaited upgrade to kde 3.1.1 is here!Alan Eldridge2003-04-0610-58/+43
* Update to version 1.9.2.Jimmy Olgeni2003-04-053-17/+2
* * Update to 1.0.0Joe Marcus Clarke2003-04-053-25/+3
* Update to 2.2.1.Joe Marcus Clarke2003-04-046-4/+110
* Update to 0.4.0.Joe Marcus Clarke2003-04-043-5/+23
* Update to 2.5.Pete Fritchman2003-04-042-2/+2
* Update to 1.0.27.Pete Fritchman2003-04-042-2/+2
* Make sure to run ldconfig -m for each of the module directories at boot time.Joe Marcus Clarke2003-04-026-0/+63
* - reapply patch that was lost during the update to 0.5Dirk Meyer2003-03-311-1/+820
* Update to 0.34.Joe Marcus Clarke2003-03-302-2/+2
* update for gdeskcal to 0.33,Edwin Groothuis2003-03-292-5/+4
* Add WWW.Jimmy Olgeni2003-03-241-0/+2
* Update to version 1.8.6.Daniel Eischen2003-03-246-34/+28
* - Update to 0.5Dirk Meyer2003-03-242-3/+3
* GWorkspace is the official GNUstep workspace manager. It is a clone ofDirk Meyer2003-03-245-0/+550
* Fix bug in "edit" button handling.Jimmy Olgeni2003-03-232-0/+15
* Fix build: replace BUILD_DEPENDS with EXTRACT_DEPENDS where appropriateMario Sergio Fujikawa Ferreira2003-03-231-2/+2
* Use a size_t to hold the result of sizeof() instead of an unsigned int.John Baldwin2003-03-191-12/+14
* Correct a typo (s/LIB_DEPEND/LIB_DEPENDS).Joe Marcus Clarke2003-03-091-1/+2
* Clear moonlight beckons.Ade Lovett2003-03-0748-24/+24
* - add stamp.makeDirk Meyer2003-03-051-0/+4
* - Fix build for CURRENTDirk Meyer2003-03-052-1/+16
* Fix Build on CURRENT.Tilman Keskinoz2003-03-032-0/+53
* Create locale dirs.Joe Marcus Clarke2003-03-031-0/+2
* Add gucharmap, a Unicode character map and viewer built on GTK+ 2.Joe Marcus Clarke2003-03-035-0/+71
* Add ljcharm, a Python CLI interface to LiveJournal servers.Joe Marcus Clarke2003-03-035-0/+50
* De-uglify the locale installation (somewhat).Adam Weinberger2003-03-011-27/+5
* Add gnotime, a time tracking application for the GNOME 2 desktop.Joe Marcus Clarke2003-03-015-0/+152
* Add rubrica, an addressbook for the GNOME 2 desktop.Joe Marcus Clarke2003-03-018-0/+247
* Update to current-snap-20030224Yoichi NAKAYAMA2003-03-014-4/+4
* Add gdeskcal, a calendar for the GNOME 2 desktop featuring alpha-blending.Joe Marcus Clarke2003-02-285-0/+129
* deskutils/xcalendar: typosEdwin Groothuis2003-02-272-3/+3
* - Update for gnustep 1.5.2 and gui 0.8.4Dirk Meyer2003-02-271-0/+2
* Update to 0.9.1.Joe Marcus Clarke2003-02-259-6/+39
* De-pkg-commentMario Sergio Fujikawa Ferreira2003-02-242-1/+1
* Update to 1.91.1.Joe Marcus Clarke2003-02-244-40/+2
* De-pkg-comment my ports + some more.Jimmy Olgeni2003-02-236-3/+3
* Fix build after QT directory structure change.Dmitry Sivachenko2003-02-231-1/+1
* de-pkg-comment.MIHIRA Sanpei Yoshiro2003-02-222-1/+1
* De-pkg-comment.Akinori MUSHA2003-02-2150-25/+25
* - retire pkg-commentDirk Meyer2003-02-211-1/+0
* * Re-add libgnomeprint[ui]-2.0 support and unbreakJoe Marcus Clarke2003-02-212-5/+3
* - add COMMENTDirk Meyer2003-02-211-0/+1
* De-pkg-comment.Akinori MUSHA2003-02-2124-12/+12
* De-pkg-comment and make portlint a little bit happier.Oliver Braun2003-02-182-1/+1
* Update to 0.9. MrProject now requires GNOME 2 libraries. The old GNOME 1Joe Marcus Clarke2003-02-1818-286/+206
* Add libmrproject, the library backend to the MrProject project managementJoe Marcus Clarke2003-02-186-0/+100
* add babytrnas 0.9.1Ying-Chieh Liao2003-02-138-0/+76
* fix for plist and funky binary name from Volker StolzAlan Eldridge2003-02-103-4/+5
* Preferences.app is, functionally, a clone of NeXTstep/OPENSTEP tool ofDirk Meyer2003-02-086-0/+135
* Chase libgnomeui's shared lib version.Joe Marcus Clarke2003-02-081-3/+5
* Update to GNOME 2.2.Joe Marcus Clarke2003-02-088-52/+70
* Move gnucash from deskutils to finance.Joe Marcus Clarke2003-02-0613-872/+0
* Install the modules .la files. This is one of the rare exceptions whereJoe Marcus Clarke2003-02-053-15/+93
* Update to 1.8.0.Joe Marcus Clarke2003-02-059-792/+438
* iUpdate homepageEdwin Groothuis2003-02-031-1/+1
* GnuCash no longer requires swig or eperl to build.Joe Marcus Clarke2003-02-031-2/+0
* Update to 1.0Tilman Keskinoz2003-02-022-4/+3
* - fix isWarningDirk Froemberg2003-01-3012-9/+138
* Upgrade to 1.1.Dirk Froemberg2003-01-3012-45/+255
* update to 3.1 official releaseAlan Eldridge2003-01-2926-950/+1342
* No need to remove DISTNAMEs which are perfectly reasonable.Edwin Groothuis2003-01-231-0/+1
* The current maintainer does not wish to maintain these ports anymore,Pete Fritchman2003-01-222-3/+1
* Update to 2.0.7.Joe Marcus Clarke2003-01-206-18/+18
* New port: deskutils/mnemo, a web-based notes and memos application.Edwin Groothuis2003-01-1825-0/+874
* pkg-message -> PKGMESSAGETilman Keskinoz2003-01-172-2/+2
* [MAINTAINER UPDATE] deskutils/mencal 2.0 -> 2.1Edwin Groothuis2003-01-162-3/+3
* Add dependency on gnomeprintui.Tilman Keskinoz2003-01-161-0/+1
* new port, deskutils/logjam2Edwin Groothuis2003-01-166-0/+34
* Remove the help directories for archive-generator.Joe Marcus Clarke2003-01-132-0/+6
* Add rox-memo, an appointment/todo manager for the ROX desktop.Jimmy Olgeni2003-01-126-0/+73
* updated to version 0.6Alan Eldridge2003-01-114-26/+13
* Fix a typo (forgot a '%' on a PLIST_SUB variable).Pete Fritchman2003-01-061-1/+1
* Make this fetchable again.Joe Marcus Clarke2003-01-052-2/+2
* upgrade to 1.1Ying-Chieh Liao2003-01-0412-9/+180
* Upgrade to 34.3333.Oliver Braun2003-01-033-2/+3
* upgrade to 2.21Ying-Chieh Liao2003-01-032-2/+2
* Update to 1.0.b2.1Tilman Keskinoz2003-01-024-22/+37
* Update to version 0.9.14.001, fix pkg-plist using www/data-distJimmy Olgeni2003-01-026-11812/+12334
* Fix build on alpha (don't include the klaptop files when we are on alpha,Pete Fritchman2003-01-021-23/+23
* Update to 1.4.9.Joe Marcus Clarke2003-01-028-64/+28
* A tool for RDF site summaries based news-check.Oliver Braun2003-01-026-0/+52
* A tree-structured outliner, note-taker. Written up on unixreview.com thisAlan Eldridge2003-01-017-0/+86
* Use a description that says what programs the gnomepim package contains,Adam Weinberger2002-12-102-2/+8
* Gak! Replace pre-patch with post-patch to allow gnomehack to do it'sJoe Marcus Clarke2002-12-032-2/+2
* Mark BROKEN on -CURRENT. Drop Maintainership.Tilman Keskinoz2002-12-021-3/+9
* Protect post-install target which is redefined by a slave port.Kris Kennaway2002-12-011-0/+2
* * Fix build with Evolution 1.2Joe Marcus Clarke2002-11-3010-108/+78
* Upgrade port to version 0.9.14.000.Jimmy Olgeni2002-11-246-5758/+10858
* Update holiday information about in coming year 2003.Norikatsu Shigemura2002-11-242-2/+17
* Update to 2.0.6.Joe Marcus Clarke2002-11-196-6/+8
* Remove BUILD_DEPENDS on gm4 as this is now inherited from devel/bison.Joe Marcus Clarke2002-11-162-4/+0
* Add a BUILD_DEPENDS on gm4 which fixes a neat build problem onJoe Marcus Clarke2002-11-152-0/+4
* Make desktutils/ical building again.Edwin Groothuis2002-11-151-0/+11
* Add libgnomeui-2.0 to LIB_DEPEND.Edwin Groothuis2002-11-151-1/+2
* It seems the previous version of gnomeutils2-2.0.5 was not the right one.Joe Marcus Clarke2002-11-154-2/+4
* Fix build with the new gtkhtml.Joe Marcus Clarke2002-11-121-5/+20
* Bump PORTREVISION after the gtkhtml version bump.Joe Marcus Clarke2002-11-121-0/+1
* o Rollback PORTCOMMENT modifications while this feature's implementationMario Sergio Fujikawa Ferreira2002-11-1118-18/+9
* Use PORTCOMMENT in the Makefile, and whack the pkg-comment.Adam Weinberger2002-11-07