From 4c305fa5d2e2dd1b911095fafa3f5f25ec1a665e Mon Sep 17 00:00:00 2001 From: Dr Nic Williams Date: Mon, 26 Aug 2019 13:24:16 +1000 Subject: [PATCH 1/5] move to go modules --- .envrc | 5 +- .gitignore | 15 +- bin/supply | 9 +- go.mod | 12 + go.sum | 63 + scripts/build.sh | 2 +- scripts/integration.sh | 11 +- sha.yml | 35 - src/imagemagick/supply/cli/main.go | 4 +- .../Masterminds/semver/benchmark_test.go | 157 - .../Masterminds/semver/collection_test.go | 46 - .../Masterminds/semver/constraints_test.go | 465 - .../Masterminds/semver/version_test.go | 490 - .../github.com/blang/semver/.gx/lastpubver | 1 - .../github.com/blang/semver/examples/main.go | 84 - .../vendor/github.com/blang/semver/go.mod | 1 - .../github.com/blang/semver/json_test.go | 49 - .../github.com/blang/semver/range_test.go | 581 - .../github.com/blang/semver/semver_test.go | 518 - .../github.com/blang/semver/sort_test.go | 30 - .../github.com/blang/semver/sql_test.go | 38 - .../libbuildpack/ansicleaner/buffer.go | 20 - .../libbuildpack/bratshelper/data.go | 89 - .../libbuildpack/bratshelper/language.go | 40 - .../libbuildpack/bratshelper/modify.go | 137 - .../libbuildpack/bratshelper/tests.go | 399 - .../libbuildpack/bratshelper/utils.go | 28 - .../libbuildpack/checksum/checksum.go | 78 - .../checksum/checksum_suite_test.go | 13 - .../libbuildpack/checksum/checksum_test.go | 94 - .../cloudfoundry/libbuildpack/command_test.go | 87 - .../libbuildpack/cutlass/docker.go | 124 - .../libbuildpack/cutlass/proxy.go | 33 - .../libbuildpack/fixtures/copydir/source.txt | 1 - .../fixtures/copydir/standard/manifest.yml | 141 - .../fixtures/copydir_symlinks/source.txt | 1 - .../copydir_symlinks/standard/manifest.yml | 141 - .../fixtures/copydir_symlinks/sym_source.txt | 1 - .../fixtures/copydir_symlinks/sym_standard | 1 - .../fixtures/maliciousGlobalSymlink.tar.gz | Bin 137 -> 0 bytes .../fixtures/manifest/duplicate/manifest.yml | 10 - .../fixtures/manifest/fetch/manifest.yml | 119 - .../manifest/fetch_cached/manifest.yml | 101 - .../fixtures/manifest/no-deps/manifest.yml | 3 - .../manifest/packaged-with-stack/VERSION | 1 - .../manifest/packaged-with-stack/manifest.yml | 108 - .../fixtures/manifest/stacks/manifest.yml | 23 - .../fixtures/manifest/standard/VERSION | 1 - .../fixtures/manifest/standard/manifest.yml | 141 - .../libbuildpack/fixtures/path_traversal.tgz | Bin 139 -> 0 bytes .../libbuildpack/fixtures/source.txt | 1 - .../libbuildpack/fixtures/symlink.tgz | Bin 251 -> 0 bytes .../libbuildpack/fixtures/thing.tgz | Bin 251 -> 0 bytes .../cloudfoundry/libbuildpack/hooks_test.go | 70 - .../libbuildpack/installer_test.go | 944 - .../cloudfoundry/libbuildpack/json_test.go | 105 - .../libbuildpack/libbuildpack_suite_test.go | 22 - .../cloudfoundry/libbuildpack/logger_test.go | 64 - .../libbuildpack/manifest_test.go | 580 - .../libbuildpack/mocks_hooks_test.go | 59 - .../libbuildpack/packager/bin/filename | 1 - .../packager/buildpack-packager/main.go | 209 - .../packager/fixtures/bad/VERSION | 1 - .../packager/fixtures/bad/bin/filename | 1 - .../packager/fixtures/bad/bin/ignoredfile | 1 - .../libbuildpack/packager/fixtures/bad/hi.sh | 3 - .../packager/fixtures/bad/manifest.yml | 15 - .../packager/fixtures/bad/otherfile | 1 - .../packager/fixtures/good/VERSION | 1 - .../packager/fixtures/good/bin/filename | 1 - .../packager/fixtures/good/bin/ignoredfile | 1 - .../libbuildpack/packager/fixtures/good/hi.sh | 3 - .../packager/fixtures/good/manifest.yml | 24 - .../packager/fixtures/good/otherfile | 1 - .../fixtures/missing_default_fs3/manifest.yml | 20 - .../fixtures/missing_included_files/VERSION | 1 - .../missing_included_files/bin/filename | 1 - .../fixtures/missing_included_files/hi.sh | 3 - .../missing_included_files/manifest.yml | 16 - .../packager/fixtures/modified/manifest.yml | 16 - .../packager/fixtures/modified/sha.yml | 5 - .../modified/src/mylanguage/Gopkg.lock | 145 - .../modified/src/mylanguage/Gopkg.toml | 20 - .../modified/src/mylanguage/supply/supply.go | 3 - .../src/mylanguage/supply/supply_test.go | 5 - .../packager/fixtures/modules/manifest.yml | 19 - .../fixtures/no_dependencies/manifest.yml | 3 - .../packager/fixtures/prepackaged/VERSION | 1 - .../fixtures/prepackaged/bin/filename | 1 - .../fixtures/prepackaged/bin/ignoredfile | 0 .../fixtures/prepackaged/manifest.yml | 16 - .../packager/fixtures/prepackaged/otherfile | 0 .../packager/fixtures/symlink_dir/VERSION | 1 - .../fixtures/symlink_dir/bin/filename | 1 - .../fixtures/symlink_dir/bin/ignoredfile | 1 - .../packager/fixtures/symlink_dir/hi.sh | 3 - .../fixtures/symlink_dir/manifest.yml | 20 - .../packager/fixtures/symlink_dir/otherfile | 1 - .../fixtures/symlink_dir/random_dir/.gitkeep | 0 .../packager/fixtures/symlink_dir/sym_dir | 1 - .../libbuildpack/packager/models_test.go | 36 - .../packager/packager_suite_test.go | 48 - .../libbuildpack/packager/packager_test.go | 368 - .../libbuildpack/packager/scaffold/.envrc | 3 - .../libbuildpack/packager/scaffold/.gitignore | 3 - .../libbuildpack/packager/scaffold/README.md | 70 - .../libbuildpack/packager/scaffold/VERSION | 1 - .../packager/scaffold/bin/compile | 19 - .../libbuildpack/packager/scaffold/bin/detect | 8 - .../packager/scaffold/bin/finalize | 19 - .../packager/scaffold/bin/release | 5 - .../libbuildpack/packager/scaffold/bin/supply | 17 - .../packager/scaffold/fixtures/.gitkeep | 0 .../fixtures/simple_test/some_file.txt | 1 - .../packager/scaffold/manifest.yml | 16 - .../packager/scaffold/scripts/brats.sh | 16 - .../packager/scaffold/scripts/build.sh | 8 - .../packager/scaffold/scripts/install_go.sh | 39 - .../scaffold/scripts/install_tools.sh | 12 - .../packager/scaffold/scripts/integration.sh | 18 - .../packager/scaffold/scripts/unit.sh | 11 - .../packager/scaffold/src/LANGUAGE/Gopkg.toml | 24 - .../src/LANGUAGE/finalize/_finalize.go | 48 - .../LANGUAGE/finalize/_finalize_suite_test.go | 13 - .../src/LANGUAGE/finalize/_finalize_test.go | 14 - .../LANGUAGE/finalize/cli/_cli_suite_test.go | 13 - .../src/LANGUAGE/finalize/cli/_main.go | 61 - .../src/LANGUAGE/hooks/_hooks_debug.go | 33 - .../src/LANGUAGE/hooks/_hooks_suite_test.go | 13 - .../integration/_integration_suite_test.go | 164 - .../src/LANGUAGE/integration/_simple_test.go | 28 - .../scaffold/src/LANGUAGE/supply/_supply.go | 49 - .../src/LANGUAGE/supply/_supply_suite_test.go | 13 - .../src/LANGUAGE/supply/_supply_test.go | 15 - .../LANGUAGE/supply/cli/_cli_suite_test.go | 13 - .../scaffold/src/LANGUAGE/supply/cli/_main.go | 85 - .../libbuildpack/packager/scaffold_test.go | 166 - .../libbuildpack/packager/summary_test.go | 65 - .../libbuildpack/shims/cmd/detect/main.go | 81 - .../libbuildpack/shims/cmd/finalize/main.go | 117 - .../libbuildpack/shims/cmd/release/main.go | 38 - .../libbuildpack/shims/cmd/supply/main.go | 80 - .../libbuildpack/shims/detector.go | 55 - .../libbuildpack/shims/detector_test.go | 75 - .../libbuildpack/shims/finalizer.go | 367 - .../libbuildpack/shims/finalizer_test.go | 706 - .../libbuildpack/shims/installer.go | 115 - .../libbuildpack/shims/installer_test.go | 92 - .../shims/mocks_detector_shims_test.go | 62 - .../libbuildpack/shims/mocks_shims_test.go | 48 - .../libbuildpack/shims/releaser.go | 53 - .../libbuildpack/shims/releaser_test.go | 53 - .../libbuildpack/shims/shims_suite_test.go | 22 - .../libbuildpack/shims/supplier.go | 154 - .../libbuildpack/shims/supplier_test.go | 147 - .../shims/testdata/buildpack/VERSION | 1 - .../shims/testdata/buildpack/bpA.tgz | Bin 147 -> 0 bytes .../shims/testdata/buildpack/bpB.tgz | Bin 147 -> 0 bytes .../testdata/buildpack/lifecycle-bundle.tgz | Bin 262 -> 0 bytes .../shims/testdata/buildpack/manifest.yml | 31 - .../shims/testdata/buildpack/order.toml | 7 - .../cloudfoundry/libbuildpack/shims/utils.go | 94 - .../libbuildpack/snapshot/mocks_test.go | 48 - .../libbuildpack/snapshot/snapshot.go | 129 - .../snapshot/snapshot_suite_test.go | 13 - .../libbuildpack/snapshot/snapshot_test.go | 219 - .../cloudfoundry/libbuildpack/stager_test.go | 662 - .../libbuildpack/umask_unix_test.go | 9 - .../libbuildpack/umask_windows_test.go | 7 - .../cloudfoundry/libbuildpack/util_test.go | 425 - .../libbuildpack/versions_test.go | 111 - .../cloudfoundry/libbuildpack/yaml_test.go | 91 - .../elazarl/goproxy/certs/openssl-gen.sh | 8 - .../elazarl/goproxy/certs/openssl.cnf | 39 - .../elazarl/goproxy/counterecryptor_test.go | 99 - .../goproxy/examples/goproxy-basic/README.md | 29 - .../goproxy/examples/goproxy-basic/main.go | 17 - .../goproxy/examples/goproxy-customca/cert.go | 75 - .../goproxy/examples/goproxy-customca/main.go | 20 - .../examples/goproxy-eavesdropper/main.go | 56 - .../examples/goproxy-httpdump/README.md | 30 - .../examples/goproxy-httpdump/httpdump.go | 285 - .../examples/goproxy-jquery-version/README.md | 31 - .../goproxy-jquery-version/jquery1.html | 8 - .../goproxy-jquery-version/jquery2.html | 8 - .../jquery_homepage.html | 233 - .../goproxy-jquery-version/jquery_test.go | 118 - .../examples/goproxy-jquery-version/main.go | 64 - .../goproxy-jquery-version/php_man.html | 323 - .../goproxy-jquery-version/w3schools.html | 1610 - .../goproxy-no-reddit-at-worktime/README.md | 21 - .../goproxy-no-reddit-at-worktime/noreddit.go | 25 - .../goproxy-sokeepalive/sokeepalive.go | 25 - .../examples/goproxy-sslstrip/sslstrip.go | 24 - .../goproxy/examples/goproxy-stats/README.md | 43 - .../goproxy/examples/goproxy-stats/main.go | 66 - .../examples/goproxy-transparent/README.md | 17 - .../examples/goproxy-transparent/proxy.sh | 29 - .../goproxy-transparent/transparent.go | 148 - .../goproxy-upside-down-ternet/main.go | 26 - .../examples/goproxy-yui-minify/yui.go | 91 - .../elazarl/goproxy/ext/auth/basic.go | 76 - .../elazarl/goproxy/ext/auth/basic_test.go | 175 - .../elazarl/goproxy/ext/html/cp1255.html | 585 - .../elazarl/goproxy/ext/html/cp1255.txt | 1 - .../elazarl/goproxy/ext/html/html.go | 104 - .../elazarl/goproxy/ext/html/html_test.go | 60 - .../elazarl/goproxy/ext/image/image.go | 78 - .../github.com/elazarl/goproxy/proxy_test.go | 836 - .../goproxy/regretable/regretreader.go | 97 - .../goproxy/regretable/regretreader_test.go | 174 - .../github.com/elazarl/goproxy/signer_test.go | 87 - .../elazarl/goproxy/test_data/baby.jpg | Bin 2571 -> 0 bytes .../elazarl/goproxy/test_data/football.png | Bin 3712 -> 0 bytes .../elazarl/goproxy/test_data/panda.png | Bin 11226 -> 0 bytes .../elazarl/goproxy/transport/roundtripper.go | 19 - .../elazarl/goproxy/transport/transport.go | 789 - .../elazarl/goproxy/transport/util.go | 15 - .../google/subcommands/CONTRIBUTING | 27 - .../github.com/google/subcommands/LICENSE | 202 - .../github.com/google/subcommands/README.md | 67 - .../github.com/google/subcommands/go.mod | 1 - .../google/subcommands/subcommands.go | 440 - .../hpcloud/tail/Godeps/Godeps.json | 15 - .../github.com/hpcloud/tail/Godeps/Readme | 5 - .../hpcloud/tail/cmd/gotail/.gitignore | 1 - .../hpcloud/tail/cmd/gotail/Makefile | 4 - .../hpcloud/tail/cmd/gotail/gotail.go | 66 - .../tail/ratelimiter/leakybucket_test.go | 73 - .../github.com/hpcloud/tail/tail_test.go | 521 - .../onsi/ginkgo/extensions/table/table.go | 98 - .../ginkgo/extensions/table/table_entry.go | 81 - .../extensions/table/table_suite_test.go | 13 - .../ginkgo/extensions/table/table_test.go | 64 - .../onsi/ginkgo/ginkgo/bootstrap_command.go | 202 - .../onsi/ginkgo/ginkgo/build_command.go | 68 - .../ginkgo/ginkgo/convert/ginkgo_ast_nodes.go | 123 - .../onsi/ginkgo/ginkgo/convert/import.go | 91 - .../ginkgo/ginkgo/convert/package_rewriter.go | 127 - .../onsi/ginkgo/ginkgo/convert/test_finder.go | 56 - .../ginkgo/convert/testfile_rewriter.go | 163 - .../ginkgo/convert/testing_t_rewriter.go | 130 - .../onsi/ginkgo/ginkgo/convert_command.go | 45 - .../onsi/ginkgo/ginkgo/generate_command.go | 173 - .../onsi/ginkgo/ginkgo/help_command.go | 31 - .../interrupthandler/interrupt_handler.go | 52 - .../sigquit_swallower_unix.go | 14 - .../sigquit_swallower_windows.go | 7 - .../github.com/onsi/ginkgo/ginkgo/main.go | 302 - .../onsi/ginkgo/ginkgo/nodot/nodot.go | 194 - .../ginkgo/ginkgo/nodot/nodot_suite_test.go | 92 - .../onsi/ginkgo/ginkgo/nodot/nodot_test.go | 82 - .../onsi/ginkgo/ginkgo/nodot_command.go | 77 - .../onsi/ginkgo/ginkgo/notifications.go | 141 - .../onsi/ginkgo/ginkgo/run_command.go | 275 - .../run_watch_and_build_command_flags.go | 169 - .../onsi/ginkgo/ginkgo/suite_runner.go | 173 - .../ginkgo/ginkgo/testrunner/build_args.go | 7 - .../ginkgo/testrunner/build_args_old.go | 7 - .../ginkgo/ginkgo/testrunner/log_writer.go | 52 - .../ginkgo/ginkgo/testrunner/run_result.go | 27 - .../ginkgo/ginkgo/testrunner/test_runner.go | 558 - .../ginkgo/testrunner/test_runner_test.go | 64 - .../ginkgo/ginkgo/testsuite/test_suite.go | 115 - .../ginkgo/testsuite/testsuite_suite_test.go | 13 - .../ginkgo/ginkgo/testsuite/testsuite_test.go | 212 - .../ginkgo/testsuite/vendor_check_go15.go | 16 - .../testsuite/vendor_check_go15_test.go | 201 - .../ginkgo/testsuite/vendor_check_go16.go | 15 - .../onsi/ginkgo/ginkgo/unfocus_command.go | 61 - .../onsi/ginkgo/ginkgo/version_command.go | 24 - .../onsi/ginkgo/ginkgo/watch/delta.go | 22 - .../onsi/ginkgo/ginkgo/watch/delta_tracker.go | 75 - .../onsi/ginkgo/ginkgo/watch/dependencies.go | 91 - .../onsi/ginkgo/ginkgo/watch/package_hash.go | 104 - .../ginkgo/ginkgo/watch/package_hashes.go | 85 - .../onsi/ginkgo/ginkgo/watch/suite.go | 87 - .../onsi/ginkgo/ginkgo/watch_command.go | 175 - .../first_package/coverage.go | 21 - .../coverage_fixture_suite_test.go | 13 - .../first_package/coverage_fixture_test.go | 31 - .../external_coverage.go | 9 - .../second_package/coverage.go | 21 - .../coverage_fixture_suite_test.go | 13 - .../second_package/coverage_fixture_test.go | 29 - .../convert_fixtures/extra_functions_test.go | 14 - .../convert_fixtures/nested/nested_test.go | 10 - .../subpackage/nested_subpackage_test.go | 9 - .../convert_fixtures/outside_package_test.go | 16 - .../_fixtures/convert_fixtures/xunit_test.go | 41 - .../extra_functions_test.go | 17 - .../fixtures_suite_test.go | 13 - .../nested_subpackage_test.go | 11 - .../convert_goldmasters/nested_suite_test.go | 13 - .../convert_goldmasters/nested_test.go | 13 - .../outside_package_test.go | 19 - .../convert_goldmasters/suite_test.go | 13 - .../convert_goldmasters/xunit_test.go | 44 - .../_fixtures/coverage_fixture/coverage.go | 25 - .../coverage_fixture_suite_test.go | 13 - .../coverage_fixture/coverage_fixture_test.go | 31 - .../external_coverage.go | 9 - .../debug_parallel_fixture_suite_test.go | 13 - .../debug_parallel_fixture_test.go | 18 - .../does_not_compile_suite_test.go | 13 - .../does_not_compile/does_not_compile_test.go | 11 - .../eventually_failing_suite_test.go | 13 - .../eventually_failing_test.go | 29 - ...ing_synchronized_setup_tests_suite_test.go | 35 - .../fail_fixture/fail_fixture_suite_test.go | 13 - .../fail_fixture/fail_fixture_test.go | 103 - .../failing_after_suite_suite_test.go | 22 - .../failing_after_suite_test.go | 15 - .../failing_before_suite_suite_test.go | 22 - .../failing_before_suite_test.go | 15 - .../failing_ginkgo_tests.go | 5 - .../failing_ginkgo_tests_suite_test.go | 13 - .../failing_ginkgo_tests_test.go | 17 - .../_fixtures/flags_tests/flags.go | 9 - .../_fixtures/flags_tests/flags_suite_test.go | 13 - .../_fixtures/flags_tests/flags_test.go | 97 - .../_fixtures/focused_fixture/README.md | 1 - .../focused_fixture_suite_test.go | 13 - .../focused_fixture/focused_fixture_test.go | 73 - .../focused_fixture_suite_test.go | 13 - .../focused_fixture_test.go | 73 - .../hanging_suite/hanging_suite_suite_test.go | 13 - .../hanging_suite/hanging_suite_test.go | 30 - .../more_ginkgo_tests/more_ginkgo_tests.go | 5 - .../more_ginkgo_tests_suite_test.go | 13 - .../more_ginkgo_tests_test.go | 17 - .../_fixtures/no_test_fn/no_test_fn.go | 5 - .../_fixtures/no_test_fn/no_test_fn_test.go | 13 - .../_fixtures/no_tests/no_tests.go | 4 - .../passing_ginkgo_tests.go | 9 - .../passing_ginkgo_tests_suite_test.go | 13 - .../passing_ginkgo_tests_test.go | 30 - .../passing_suite_setup_suite_test.go | 26 - .../passing_suite_setup/passing_suite_test.go | 28 - .../progress_fixture_suite_test.go | 13 - .../progress_fixture/progress_fixture_test.go | 49 - .../skip_fixture/skip_fixture_suite_test.go | 13 - .../skip_fixture/skip_fixture_test.go | 71 - .../suite_command_tests/suite_command.go | 9 - .../suite_command_suite_test.go | 13 - .../suite_command_tests/suite_command_test.go | 18 - .../synchronized_setup_tests_suite_test.go | 43 - .../_fixtures/tags_tests/ignored_test.go | 17 - .../tags_tests/tags_tests_suite_test.go | 13 - .../_fixtures/tags_tests/tags_tests_test.go | 11 - .../test_description_suite_test.go | 13 - .../test_description/test_description_test.go | 23 - .../_fixtures/watch_fixtures/A/A.go | 7 - .../watch_fixtures/A/A_suite_test.go | 13 - .../_fixtures/watch_fixtures/A/A_test.go | 14 - .../_fixtures/watch_fixtures/B/B.go | 7 - .../watch_fixtures/B/B_suite_test.go | 13 - .../_fixtures/watch_fixtures/B/B_test.go | 14 - .../_fixtures/watch_fixtures/C/C.go | 5 - .../_fixtures/watch_fixtures/C/C.json | 3 - .../watch_fixtures/C/C_suite_test.go | 13 - .../_fixtures/watch_fixtures/C/C_test.go | 14 - .../_fixtures/watch_fixtures/D/D.go | 7 - .../watch_fixtures/D/D_suite_test.go | 13 - .../_fixtures/watch_fixtures/D/D_test.go | 14 - .../_fixtures/xunit_tests/xunit_tests.go | 5 - .../_fixtures/xunit_tests/xunit_tests_test.go | 11 - .../onsi/ginkgo/integration/convert_test.go | 121 - .../onsi/ginkgo/integration/coverage_test.go | 147 - .../onsi/ginkgo/integration/fail_test.go | 55 - .../onsi/ginkgo/integration/flags_test.go | 237 - .../onsi/ginkgo/integration/integration.go | 1 - .../integration/integration_suite_test.go | 129 - .../onsi/ginkgo/integration/interrupt_test.go | 51 - .../ginkgo/integration/precompiled_test.go | 53 - .../onsi/ginkgo/integration/progress_test.go | 94 - .../onsi/ginkgo/integration/run_test.go | 483 - .../onsi/ginkgo/integration/skip_test.go | 43 - .../ginkgo/integration/subcommand_test.go | 434 - .../ginkgo/integration/suite_command_test.go | 63 - .../ginkgo/integration/suite_setup_test.go | 178 - .../onsi/ginkgo/integration/tags_test.go | 27 - .../integration/test_description_test.go | 25 - .../integration/verbose_and_succinct_test.go | 90 - .../onsi/ginkgo/integration/watch_test.go | 275 - .../codelocation/code_location_suite_test.go | 13 - .../codelocation/code_location_test.go | 80 - .../container_node_suite_test.go | 13 - .../containernode/container_node_test.go | 213 - .../internal/failer/failer_suite_test.go | 13 - .../ginkgo/internal/failer/failer_test.go | 141 - .../ginkgo/internal/leafnodes/it_node_test.go | 22 - .../leafnodes/leaf_node_suite_test.go | 13 - .../internal/leafnodes/measure_node_test.go | 155 - .../internal/leafnodes/setup_nodes_test.go | 48 - .../internal/leafnodes/shared_runner_test.go | 353 - .../internal/leafnodes/suite_nodes_test.go | 230 - .../synchronized_after_suite_node_test.go | 199 - .../synchronized_before_suite_node_test.go | 446 - .../ginkgo/internal/remote/aggregator_test.go | 315 - .../remote/fake_output_interceptor_test.go | 22 - .../internal/remote/fake_poster_test.go | 33 - .../remote/forwarding_reporter_test.go | 181 - .../internal/remote/remote_suite_test.go | 13 - .../ginkgo/internal/remote/server_test.go | 269 - .../ginkgo/internal/spec/spec_suite_test.go | 13 - .../onsi/ginkgo/internal/spec/spec_test.go | 739 - .../onsi/ginkgo/internal/spec/specs_test.go | 287 - .../spec_iterator/index_computer_test.go | 149 - .../parallel_spec_iterator_test.go | 112 - .../serial_spec_iterator_test.go | 64 - .../sharded_parallel_spec_iterator_test.go | 62 - .../spec_iterator/spec_iterator_suite_test.go | 13 - .../specrunner/spec_runner_suite_test.go | 13 - .../internal/specrunner/spec_runner_test.go | 785 - .../ginkgo/internal/suite/suite_suite_test.go | 35 - .../onsi/ginkgo/internal/suite/suite_test.go | 385 - .../internal/writer/writer_suite_test.go | 13 - .../ginkgo/internal/writer/writer_test.go | 75 - .../ginkgo/reporters/default_reporter_test.go | 433 - .../ginkgo/reporters/junit_reporter_test.go | 258 - .../ginkgo/reporters/reporters_suite_test.go | 13 - .../reporters/stenographer/support/README.md | 6 - .../reporters/teamcity_reporter_test.go | 214 - .../onsi/ginkgo/types/types_suite_test.go | 13 - .../onsi/ginkgo/types/types_test.go | 99 - .../onsi/gomega/format/format_suite_test.go | 13 - .../onsi/gomega/format/format_test.go | 642 - .../github.com/onsi/gomega/gbytes/buffer.go | 245 - .../onsi/gomega/gbytes/buffer_test.go | 205 - .../onsi/gomega/gbytes/gbuffer_suite_test.go | 13 - .../onsi/gomega/gbytes/io_wrappers.go | 85 - .../onsi/gomega/gbytes/io_wrappers_test.go | 188 - .../onsi/gomega/gbytes/say_matcher.go | 106 - .../onsi/gomega/gbytes/say_matcher_test.go | 169 - .../gomega/gexec/_fixture/firefly/main.go | 36 - .../github.com/onsi/gomega/gexec/build.go | 114 - .../onsi/gomega/gexec/build_test.go | 112 - .../onsi/gomega/gexec/exit_matcher.go | 88 - .../onsi/gomega/gexec/exit_matcher_test.go | 114 - .../onsi/gomega/gexec/gexec_suite_test.go | 26 - .../onsi/gomega/gexec/prefixed_writer.go | 55 - .../onsi/gomega/gexec/prefixed_writer_test.go | 43 - .../github.com/onsi/gomega/gexec/session.go | 306 - .../onsi/gomega/gexec/session_test.go | 338 - .../github.com/onsi/gomega/ghttp/handlers.go | 324 - .../onsi/gomega/ghttp/protobuf/protobuf.go | 3 - .../ghttp/protobuf/simple_message.pb.go | 55 - .../ghttp/protobuf/simple_message.proto | 9 - .../onsi/gomega/ghttp/test_server.go | 425 - .../gomega/ghttp/test_server_suite_test.go | 13 - .../onsi/gomega/ghttp/test_server_test.go | 1129 - .../onsi/gomega/gstruct/elements.go | 161 - .../onsi/gomega/gstruct/elements_test.go | 144 - .../gomega/gstruct/errors/nested_types.go | 72 - .../github.com/onsi/gomega/gstruct/fields.go | 165 - .../onsi/gomega/gstruct/fields_test.go | 101 - .../gstruct/gstruct_tests_suite_test.go | 13 - .../github.com/onsi/gomega/gstruct/ignore.go | 39 - .../onsi/gomega/gstruct/ignore_test.go | 23 - .../github.com/onsi/gomega/gstruct/keys.go | 126 - .../onsi/gomega/gstruct/keys_test.go | 101 - .../github.com/onsi/gomega/gstruct/pointer.go | 58 - .../onsi/gomega/gstruct/pointer_test.go | 33 - .../github.com/onsi/gomega/gstruct/types.go | 15 - .../assertion/assertion_suite_test.go | 13 - .../internal/assertion/assertion_test.go | 258 - .../async_assertion_suite_test.go | 13 - .../asyncassertion/async_assertion_test.go | 351 - .../internal/fakematcher/fake_matcher.go | 23 - .../testingtsupport/testing_t_support_test.go | 92 - .../onsi/gomega/matchers/and_test.go | 103 - .../assignable_to_type_of_matcher_test.go | 46 - .../gomega/matchers/be_a_directory_test.go | 40 - .../gomega/matchers/be_a_regular_file_test.go | 40 - .../matchers/be_an_existing_file_test.go | 40 - .../gomega/matchers/be_closed_matcher_test.go | 70 - .../matchers/be_element_of_matcher_test.go | 66 - .../gomega/matchers/be_empty_matcher_test.go | 52 - .../matchers/be_equivalent_to_matcher_test.go | 50 - .../gomega/matchers/be_false_matcher_test.go | 20 - .../gomega/matchers/be_identical_to_test.go | 61 - .../gomega/matchers/be_nil_matcher_test.go | 28 - .../matchers/be_numerically_matcher_test.go | 172 - .../gomega/matchers/be_sent_matcher_test.go | 107 - .../matchers/be_temporally_matcher_test.go | 99 - .../gomega/matchers/be_true_matcher_test.go | 20 - .../gomega/matchers/be_zero_matcher_test.go | 40 - .../onsi/gomega/matchers/consist_of_test.go | 75 - .../matchers/contain_element_matcher_test.go | 76 - .../contain_substring_matcher_test.go | 36 - .../gomega/matchers/equal_matcher_test.go | 80 - .../gomega/matchers/have_cap_matcher_test.go | 50 - .../gomega/matchers/have_key_matcher_test.go | 73 - .../have_key_with_value_matcher_test.go | 82 - .../gomega/matchers/have_len_matcher_test.go | 53 - .../matchers/have_occurred_matcher_test.go | 59 - .../matchers/have_prefix_matcher_test.go | 50 - .../matchers/have_suffix_matcher_test.go | 50 - .../matchers/match_error_matcher_test.go | 121 - .../matchers/match_json_matcher_test.go | 110 - .../matchers/match_regexp_matcher_test.go | 58 - .../gomega/matchers/match_xml_matcher_test.go | 111 - .../matchers/match_yaml_matcher_test.go | 101 - .../matchers/matcher_tests_suite_test.go | 50 - .../onsi/gomega/matchers/not_test.go | 64 - .../onsi/gomega/matchers/or_test.go | 92 - .../gomega/matchers/panic_matcher_test.go | 52 - .../gomega/matchers/receive_matcher_test.go | 304 - .../gomega/matchers/succeed_matcher_test.go | 72 - .../matchers/support/goraph/MIT.LICENSE | 20 - .../matchers/test_data/xml/sample_01.xml | 6 - .../matchers/test_data/xml/sample_02.xml | 9 - .../matchers/test_data/xml/sample_03.xml | 1 - .../matchers/test_data/xml/sample_04.xml | 6 - .../matchers/test_data/xml/sample_05.xml | 211 - .../matchers/test_data/xml/sample_06.xml | 13 - .../matchers/test_data/xml/sample_07.xml | 13 - .../matchers/test_data/xml/sample_08.xml | 13 - .../matchers/test_data/xml/sample_09.xml | 4 - .../matchers/test_data/xml/sample_10.xml | 4 - .../matchers/test_data/xml/sample_11.xml | 7 - .../gomega/matchers/with_transform_test.go | 102 - .../github.com/tidwall/gjson/gjson_ngae.go | 81 - .../github.com/tidwall/gjson/gjson_test.go | 1506 - .../github.com/tidwall/match/match_test.go | 429 - .../github.com/tidwall/pretty/.travis.yml | 1 - .../vendor/github.com/tidwall/pretty/LICENSE | 20 - .../github.com/tidwall/pretty/README.md | 124 - .../github.com/tidwall/pretty/pretty.go | 432 - .../github.com/tidwall/pretty/pretty_test.go | 432 - .../vendor/golang.org/x/net/.gitattributes | 10 - .../vendor/golang.org/x/net/.gitignore | 2 - .../vendor/golang.org/x/net/CONTRIBUTING.md | 26 - .../vendor/golang.org/x/net/README.md | 16 - .../vendor/golang.org/x/net/bpf/asm.go | 41 - .../vendor/golang.org/x/net/bpf/constants.go | 222 - .../vendor/golang.org/x/net/bpf/doc.go | 82 - .../golang.org/x/net/bpf/instructions.go | 726 - .../golang.org/x/net/bpf/instructions_test.go | 593 - .../vendor/golang.org/x/net/bpf/setter.go | 10 - .../x/net/bpf/testdata/all_instructions.bpf | 1 - .../x/net/bpf/testdata/all_instructions.txt | 88 - .../vendor/golang.org/x/net/bpf/vm.go | 150 - .../golang.org/x/net/bpf/vm_aluop_test.go | 512 - .../golang.org/x/net/bpf/vm_bpf_test.go | 199 - .../golang.org/x/net/bpf/vm_extension_test.go | 49 - .../golang.org/x/net/bpf/vm_instructions.go | 182 - .../golang.org/x/net/bpf/vm_jump_test.go | 726 - .../golang.org/x/net/bpf/vm_load_test.go | 258 - .../golang.org/x/net/bpf/vm_ret_test.go | 115 - .../golang.org/x/net/bpf/vm_scratch_test.go | 247 - .../vendor/golang.org/x/net/bpf/vm_test.go | 144 - .../vendor/golang.org/x/net/codereview.cfg | 1 - .../golang.org/x/net/context/context.go | 56 - .../golang.org/x/net/context/context_test.go | 583 - .../x/net/context/ctxhttp/ctxhttp.go | 71 - .../x/net/context/ctxhttp/ctxhttp_test.go | 117 - .../vendor/golang.org/x/net/context/go17.go | 72 - .../vendor/golang.org/x/net/context/go19.go | 20 - .../golang.org/x/net/context/pre_go17.go | 300 - .../golang.org/x/net/context/pre_go19.go | 109 - .../x/net/context/withtimeout_test.go | 31 - .../vendor/golang.org/x/net/dict/dict.go | 210 - .../x/net/dns/dnsmessage/example_test.go | 132 - .../x/net/dns/dnsmessage/message.go | 2606 - .../x/net/dns/dnsmessage/message_test.go | 1451 - .../vendor/golang.org/x/net/go.mod | 9 - .../vendor/golang.org/x/net/go.sum | 6 - .../golang.org/x/net/html/atom/atom_test.go | 109 - .../golang.org/x/net/html/atom/table_test.go | 376 - .../x/net/html/charset/charset_test.go | 237 - .../html/charset/testdata/HTTP-charset.html | 48 - .../charset/testdata/HTTP-vs-UTF-8-BOM.html | 48 - .../testdata/HTTP-vs-meta-charset.html | 49 - .../testdata/HTTP-vs-meta-content.html | 49 - .../testdata/No-encoding-declaration.html | 47 - .../x/net/html/charset/testdata/README | 9 - .../html/charset/testdata/UTF-16BE-BOM.html | Bin 2670 -> 0 bytes .../html/charset/testdata/UTF-16LE-BOM.html | Bin 2682 -> 0 bytes .../testdata/UTF-8-BOM-vs-meta-charset.html | 49 - .../testdata/UTF-8-BOM-vs-meta-content.html | 48 - .../testdata/meta-charset-attribute.html | 48 - .../testdata/meta-content-attribute.html | 48 - .../golang.org/x/net/html/entity_test.go | 29 - .../golang.org/x/net/html/escape_test.go | 97 - .../golang.org/x/net/html/example_test.go | 40 - .../vendor/golang.org/x/net/html/node_test.go | 146 - .../golang.org/x/net/html/parse_test.go | 423 - .../golang.org/x/net/html/render_test.go | 156 - .../issue_30600_parse_panics_in_cell_mode.dat | 12 - ...e_30961_error_nested_unknown_tag_types.dat | 11 - .../x/net/html/testdata/go/select.dat | 12 - .../x/net/html/testdata/go/template.dat | 62 - .../golang.org/x/net/html/testdata/go1.html | 2237 - .../x/net/html/testdata/webkit/README | 28 - .../x/net/html/testdata/webkit/adoption01.dat | 194 - .../x/net/html/testdata/webkit/adoption02.dat | 31 - .../x/net/html/testdata/webkit/comments01.dat | 135 - .../x/net/html/testdata/webkit/doctype01.dat | 370 - .../x/net/html/testdata/webkit/entities01.dat | 603 - .../x/net/html/testdata/webkit/entities02.dat | 249 - .../html/testdata/webkit/html5test-com.dat | 246 - .../x/net/html/testdata/webkit/inbody01.dat | 43 - .../x/net/html/testdata/webkit/isindex.dat | 40 - ...pending-spec-changes-plain-text-unsafe.dat | Bin 115 -> 0 bytes .../testdata/webkit/pending-spec-changes.dat | 52 - .../testdata/webkit/plain-text-unsafe.dat | Bin 4166 -> 0 bytes .../x/net/html/testdata/webkit/ruby.dat | 298 - .../net/html/testdata/webkit/scriptdata01.dat | 308 - .../testdata/webkit/scripted/adoption01.dat | 15 - .../testdata/webkit/scripted/webkit01.dat | 28 - .../x/net/html/testdata/webkit/tables01.dat | 212 - .../x/net/html/testdata/webkit/template.dat | 1326 - .../x/net/html/testdata/webkit/tests1.dat | 1952 - .../x/net/html/testdata/webkit/tests10.dat | 799 - .../x/net/html/testdata/webkit/tests11.dat | 482 - .../x/net/html/testdata/webkit/tests12.dat | 62 - .../x/net/html/testdata/webkit/tests14.dat | 74 - .../x/net/html/testdata/webkit/tests15.dat | 208 - .../x/net/html/testdata/webkit/tests16.dat | 2299 - .../x/net/html/testdata/webkit/tests17.dat | 153 - .../x/net/html/testdata/webkit/tests18.dat | 269 - .../x/net/html/testdata/webkit/tests19.dat | 1237 - .../x/net/html/testdata/webkit/tests2.dat | 763 - .../x/net/html/testdata/webkit/tests20.dat | 455 - .../x/net/html/testdata/webkit/tests21.dat | 221 - .../x/net/html/testdata/webkit/tests22.dat | 157 - .../x/net/html/testdata/webkit/tests23.dat | 155 - .../x/net/html/testdata/webkit/tests24.dat | 79 - .../x/net/html/testdata/webkit/tests25.dat | 219 - .../x/net/html/testdata/webkit/tests26.dat | 313 - .../x/net/html/testdata/webkit/tests3.dat | 305 - .../x/net/html/testdata/webkit/tests4.dat | 59 - .../x/net/html/testdata/webkit/tests5.dat | 191 - .../x/net/html/testdata/webkit/tests6.dat | 663 - .../x/net/html/testdata/webkit/tests7.dat | 390 - .../x/net/html/testdata/webkit/tests8.dat | 148 - .../x/net/html/testdata/webkit/tests9.dat | 457 - .../testdata/webkit/tests_innerHTML_1.dat | 741 - .../x/net/html/testdata/webkit/tricky01.dat | 261 - .../x/net/html/testdata/webkit/webkit01.dat | 610 - .../x/net/html/testdata/webkit/webkit02.dat | 159 - .../golang.org/x/net/html/token_test.go | 748 - .../golang.org/x/net/http/httpguts/guts.go | 50 - .../golang.org/x/net/http/httpguts/httplex.go | 346 - .../x/net/http/httpguts/httplex_test.go | 119 - .../x/net/http/httpproxy/export_test.go | 13 - .../x/net/http/httpproxy/go19_test.go | 13 - .../golang.org/x/net/http/httpproxy/proxy.go | 370 - .../x/net/http/httpproxy/proxy_test.go | 351 - .../vendor/golang.org/x/net/http2/.gitignore | 2 - .../vendor/golang.org/x/net/http2/Dockerfile | 51 - .../vendor/golang.org/x/net/http2/Makefile | 3 - .../vendor/golang.org/x/net/http2/README | 20 - .../vendor/golang.org/x/net/http2/ciphers.go | 641 - .../golang.org/x/net/http2/ciphers_test.go | 309 - .../x/net/http2/client_conn_pool.go | 282 - .../golang.org/x/net/http2/databuffer.go | 146 - .../golang.org/x/net/http2/databuffer_test.go | 155 - .../vendor/golang.org/x/net/http2/errors.go | 133 - .../golang.org/x/net/http2/errors_test.go | 24 - .../vendor/golang.org/x/net/http2/flow.go | 50 - .../golang.org/x/net/http2/flow_test.go | 87 - .../vendor/golang.org/x/net/http2/frame.go | 1614 - .../golang.org/x/net/http2/frame_test.go | 1235 - .../vendor/golang.org/x/net/http2/go111.go | 29 - .../vendor/golang.org/x/net/http2/gotrack.go | 170 - .../golang.org/x/net/http2/gotrack_test.go | 33 - .../vendor/golang.org/x/net/http2/h2c/h2c.go | 495 - .../golang.org/x/net/http2/h2c/h2c_test.go | 58 - .../golang.org/x/net/http2/h2demo/.gitignore | 6 - .../golang.org/x/net/http2/h2demo/Dockerfile | 37 - .../golang.org/x/net/http2/h2demo/Makefile | 33 - .../golang.org/x/net/http2/h2demo/README | 16 - .../x/net/http2/h2demo/deployment-prod.yaml | 28 - .../golang.org/x/net/http2/h2demo/go.mod | 13 - .../golang.org/x/net/http2/h2demo/go.sum | 103 - .../golang.org/x/net/http2/h2demo/h2demo.go | 565 - .../golang.org/x/net/http2/h2demo/rootCA.key | 27 - .../golang.org/x/net/http2/h2demo/rootCA.pem | 26 - .../golang.org/x/net/http2/h2demo/rootCA.srl | 1 - .../golang.org/x/net/http2/h2demo/server.crt | 20 - .../golang.org/x/net/http2/h2demo/server.key | 27 - .../x/net/http2/h2demo/service.yaml | 17 - .../golang.org/x/net/http2/h2demo/tmpl.go | 1991 - .../golang.org/x/net/http2/h2i/README.md | 97 - .../vendor/golang.org/x/net/http2/h2i/h2i.go | 522 - .../golang.org/x/net/http2/headermap.go | 88 - .../golang.org/x/net/http2/hpack/encode.go | 240 - .../x/net/http2/hpack/encode_test.go | 386 - .../golang.org/x/net/http2/hpack/hpack.go | 504 - .../x/net/http2/hpack/hpack_test.go | 770 - .../golang.org/x/net/http2/hpack/huffman.go | 222 - .../golang.org/x/net/http2/hpack/tables.go | 479 - .../x/net/http2/hpack/tables_test.go | 214 - .../vendor/golang.org/x/net/http2/http2.go | 384 - .../golang.org/x/net/http2/http2_test.go | 290 - .../golang.org/x/net/http2/not_go111.go | 20 - .../vendor/golang.org/x/net/http2/pipe.go | 163 - .../golang.org/x/net/http2/pipe_test.go | 130 - .../vendor/golang.org/x/net/http2/server.go | 2931 - .../x/net/http2/server_push_test.go | 519 - .../golang.org/x/net/http2/server_test.go | 3922 - .../testdata/draft-ietf-httpbis-http2.xml | 5021 -- .../golang.org/x/net/http2/transport.go | 2610 - .../golang.org/x/net/http2/transport_test.go | 4321 - .../vendor/golang.org/x/net/http2/write.go | 365 - .../golang.org/x/net/http2/writesched.go | 242 - .../x/net/http2/writesched_priority.go | 452 - .../x/net/http2/writesched_priority_test.go | 541 - .../x/net/http2/writesched_random.go | 72 - .../x/net/http2/writesched_random_test.go | 44 - .../golang.org/x/net/http2/writesched_test.go | 125 - .../golang.org/x/net/http2/z_spec_test.go | 356 - .../vendor/golang.org/x/net/icmp/diag_test.go | 299 - .../golang.org/x/net/icmp/dstunreach.go | 59 - .../vendor/golang.org/x/net/icmp/echo.go | 173 - .../vendor/golang.org/x/net/icmp/endpoint.go | 113 - .../golang.org/x/net/icmp/example_test.go | 63 - .../vendor/golang.org/x/net/icmp/extension.go | 170 - .../golang.org/x/net/icmp/extension_test.go | 332 - .../golang.org/x/net/icmp/helper_posix.go | 75 - .../vendor/golang.org/x/net/icmp/interface.go | 322 - .../vendor/golang.org/x/net/icmp/ipv4.go | 69 - .../vendor/golang.org/x/net/icmp/ipv4_test.go | 75 - .../vendor/golang.org/x/net/icmp/ipv6.go | 23 - .../golang.org/x/net/icmp/listen_posix.go | 100 - .../golang.org/x/net/icmp/listen_stub.go | 33 - .../vendor/golang.org/x/net/icmp/message.go | 162 - .../golang.org/x/net/icmp/message_test.go | 343 - .../golang.org/x/net/icmp/messagebody.go | 52 - .../vendor/golang.org/x/net/icmp/mpls.go | 77 - .../vendor/golang.org/x/net/icmp/multipart.go | 129 - .../golang.org/x/net/icmp/multipart_test.go | 567 - .../golang.org/x/net/icmp/packettoobig.go | 43 - .../vendor/golang.org/x/net/icmp/paramprob.go | 72 - .../golang.org/x/net/icmp/sys_freebsd.go | 11 - .../golang.org/x/net/icmp/timeexceeded.go | 57 - .../golang.org/x/net/idna/example_test.go | 70 - .../golang.org/x/net/idna/idna10.0.0.go | 734 - .../vendor/golang.org/x/net/idna/idna9.0.0.go | 682 - .../vendor/golang.org/x/net/idna/idna_test.go | 108 - .../vendor/golang.org/x/net/idna/punycode.go | 203 - .../golang.org/x/net/idna/punycode_test.go | 198 - .../golang.org/x/net/idna/tables10.0.0.go | 4559 - .../golang.org/x/net/idna/tables11.0.0.go | 4653 - .../golang.org/x/net/idna/tables9.0.0.go | 4486 - .../vendor/golang.org/x/net/idna/trie.go | 72 - .../vendor/golang.org/x/net/idna/trieval.go | 119 - .../golang.org/x/net/internal/iana/const.go | 223 - .../golang.org/x/net/internal/iana/gen.go | 383 - .../x/net/internal/socket/cmsghdr.go | 11 - .../x/net/internal/socket/cmsghdr_bsd.go | 13 - .../internal/socket/cmsghdr_linux_32bit.go | 14 - .../internal/socket/cmsghdr_linux_64bit.go | 14 - .../internal/socket/cmsghdr_solaris_64bit.go | 14 - .../x/net/internal/socket/cmsghdr_stub.go | 17 - .../x/net/internal/socket/defs_aix.go | 39 - .../x/net/internal/socket/defs_darwin.go | 36 - .../x/net/internal/socket/defs_dragonfly.go | 36 - .../x/net/internal/socket/defs_freebsd.go | 36 - .../x/net/internal/socket/defs_linux.go | 41 - .../x/net/internal/socket/defs_netbsd.go | 39 - .../x/net/internal/socket/defs_openbsd.go | 36 - .../x/net/internal/socket/defs_solaris.go | 36 - .../golang.org/x/net/internal/socket/empty.s | 7 - .../x/net/internal/socket/error_unix.go | 31 - .../x/net/internal/socket/error_windows.go | 26 - .../x/net/internal/socket/iovec_32bit.go | 19 - .../x/net/internal/socket/iovec_64bit.go | 19 - .../internal/socket/iovec_solaris_64bit.go | 19 - .../x/net/internal/socket/iovec_stub.go | 11 - .../x/net/internal/socket/mmsghdr_stub.go | 21 - .../x/net/internal/socket/mmsghdr_unix.go | 42 - .../x/net/internal/socket/msghdr_bsd.go | 39 - .../x/net/internal/socket/msghdr_bsdvar.go | 16 - .../x/net/internal/socket/msghdr_linux.go | 36 - .../net/internal/socket/msghdr_linux_32bit.go | 24 - .../net/internal/socket/msghdr_linux_64bit.go | 24 - .../x/net/internal/socket/msghdr_openbsd.go | 14 - .../internal/socket/msghdr_solaris_64bit.go | 36 - .../x/net/internal/socket/msghdr_stub.go | 14 - .../x/net/internal/socket/rawconn.go | 64 - .../x/net/internal/socket/rawconn_mmsg.go | 73 - .../x/net/internal/socket/rawconn_msg.go | 76 - .../x/net/internal/socket/rawconn_nommsg.go | 15 - .../x/net/internal/socket/rawconn_nomsg.go | 15 - .../x/net/internal/socket/socket.go | 288 - .../x/net/internal/socket/socket_test.go | 298 - .../golang.org/x/net/internal/socket/sys.go | 33 - .../x/net/internal/socket/sys_bsd.go | 15 - .../x/net/internal/socket/sys_bsdvar.go | 23 - .../x/net/internal/socket/sys_const_unix.go | 17 - .../x/net/internal/socket/sys_darwin.go | 7 - .../x/net/internal/socket/sys_dragonfly.go | 7 - .../net/internal/socket/sys_go1_11_darwin.go | 33 - .../x/net/internal/socket/sys_linkname.go | 42 - .../x/net/internal/socket/sys_linux.go | 27 - .../x/net/internal/socket/sys_linux_386.go | 55 - .../x/net/internal/socket/sys_linux_386.s | 11 - .../x/net/internal/socket/sys_linux_amd64.go | 10 - .../x/net/internal/socket/sys_linux_arm.go | 10 - .../x/net/internal/socket/sys_linux_arm64.go | 10 - .../x/net/internal/socket/sys_linux_mips.go | 10 - .../x/net/internal/socket/sys_linux_mips64.go | 10 - .../net/internal/socket/sys_linux_mips64le.go | 10 - .../x/net/internal/socket/sys_linux_mipsle.go | 10 - .../x/net/internal/socket/sys_linux_ppc64.go | 10 - .../net/internal/socket/sys_linux_ppc64le.go | 10 - .../net/internal/socket/sys_linux_riscv64.go | 12 - .../x/net/internal/socket/sys_linux_s390x.go | 55 - .../x/net/internal/socket/sys_linux_s390x.s | 11 - .../x/net/internal/socket/sys_netbsd.go | 25 - .../x/net/internal/socket/sys_posix.go | 183 - .../x/net/internal/socket/sys_solaris.go | 70 - .../x/net/internal/socket/sys_solaris_amd64.s | 11 - .../x/net/internal/socket/sys_stub.go | 63 - .../x/net/internal/socket/sys_unix.go | 33 - .../x/net/internal/socket/sys_windows.go | 71 - .../x/net/internal/socket/zsys_aix_ppc64.go | 61 - .../x/net/internal/socket/zsys_darwin_386.go | 51 - .../net/internal/socket/zsys_darwin_amd64.go | 53 - .../x/net/internal/socket/zsys_darwin_arm.go | 51 - .../net/internal/socket/zsys_darwin_arm64.go | 53 - .../internal/socket/zsys_dragonfly_amd64.go | 53 - .../x/net/internal/socket/zsys_freebsd_386.go | 51 - .../net/internal/socket/zsys_freebsd_amd64.go | 53 - .../x/net/internal/socket/zsys_freebsd_arm.go | 51 - .../x/net/internal/socket/zsys_linux_386.go | 55 - .../x/net/internal/socket/zsys_linux_amd64.go | 58 - .../x/net/internal/socket/zsys_linux_arm.go | 55 - .../x/net/internal/socket/zsys_linux_arm64.go | 58 - .../x/net/internal/socket/zsys_linux_mips.go | 55 - .../net/internal/socket/zsys_linux_mips64.go | 58 - .../internal/socket/zsys_linux_mips64le.go | 58 - .../net/internal/socket/zsys_linux_mipsle.go | 55 - .../x/net/internal/socket/zsys_linux_ppc64.go | 58 - .../net/internal/socket/zsys_linux_ppc64le.go | 58 - .../net/internal/socket/zsys_linux_riscv64.go | 59 - .../x/net/internal/socket/zsys_linux_s390x.go | 58 - .../x/net/internal/socket/zsys_netbsd_386.go | 57 - .../net/internal/socket/zsys_netbsd_amd64.go | 60 - .../x/net/internal/socket/zsys_netbsd_arm.go | 57 - .../net/internal/socket/zsys_netbsd_arm64.go | 60 - .../x/net/internal/socket/zsys_openbsd_386.go | 51 - .../net/internal/socket/zsys_openbsd_amd64.go | 53 - .../x/net/internal/socket/zsys_openbsd_arm.go | 51 - .../net/internal/socket/zsys_solaris_amd64.go | 52 - .../golang.org/x/net/internal/socks/client.go | 168 - .../x/net/internal/socks/dial_test.go | 170 - .../golang.org/x/net/internal/socks/socks.go | 317 - .../x/net/internal/sockstest/server.go | 241 - .../x/net/internal/sockstest/server_test.go | 103 - .../x/net/internal/timeseries/timeseries.go | 525 - .../internal/timeseries/timeseries_test.go | 170 - .../vendor/golang.org/x/net/ipv4/batch.go | 194 - .../vendor/golang.org/x/net/ipv4/bpf_test.go | 93 - .../vendor/golang.org/x/net/ipv4/control.go | 144 - .../golang.org/x/net/ipv4/control_bsd.go | 40 - .../golang.org/x/net/ipv4/control_pktinfo.go | 39 - .../golang.org/x/net/ipv4/control_stub.go | 13 - .../golang.org/x/net/ipv4/control_test.go | 21 - .../golang.org/x/net/ipv4/control_unix.go | 73 - .../golang.org/x/net/ipv4/control_windows.go | 12 - .../vendor/golang.org/x/net/ipv4/defs_aix.go | 39 - .../golang.org/x/net/ipv4/defs_darwin.go | 77 - .../golang.org/x/net/ipv4/defs_dragonfly.go | 38 - .../golang.org/x/net/ipv4/defs_freebsd.go | 75 - .../golang.org/x/net/ipv4/defs_linux.go | 122 - .../golang.org/x/net/ipv4/defs_netbsd.go | 37 - .../golang.org/x/net/ipv4/defs_openbsd.go | 37 - .../golang.org/x/net/ipv4/defs_solaris.go | 84 - .../vendor/golang.org/x/net/ipv4/dgramopt.go | 264 - .../vendor/golang.org/x/net/ipv4/doc.go | 244 - .../vendor/golang.org/x/net/ipv4/endpoint.go | 186 - .../golang.org/x/net/ipv4/example_test.go | 224 - .../vendor/golang.org/x/net/ipv4/gen.go | 199 - .../golang.org/x/net/ipv4/genericopt.go | 55 - .../vendor/golang.org/x/net/ipv4/header.go | 173 - .../golang.org/x/net/ipv4/header_test.go | 259 - .../vendor/golang.org/x/net/ipv4/helper.go | 80 - .../x/net/ipv4/helper_posix_test.go | 31 - .../golang.org/x/net/ipv4/helper_stub_test.go | 11 - .../vendor/golang.org/x/net/ipv4/iana.go | 38 - .../vendor/golang.org/x/net/ipv4/icmp.go | 57 - .../golang.org/x/net/ipv4/icmp_linux.go | 25 - .../vendor/golang.org/x/net/ipv4/icmp_stub.go | 25 - .../vendor/golang.org/x/net/ipv4/icmp_test.go | 95 - .../golang.org/x/net/ipv4/multicast_test.go | 338 - .../x/net/ipv4/multicastlistener_test.go | 265 - .../x/net/ipv4/multicastsockopt_test.go | 199 - .../vendor/golang.org/x/net/ipv4/packet.go | 117 - .../vendor/golang.org/x/net/ipv4/payload.go | 23 - .../golang.org/x/net/ipv4/payload_cmsg.go | 84 - .../golang.org/x/net/ipv4/payload_nocmsg.go | 39 - .../golang.org/x/net/ipv4/readwrite_test.go | 517 - .../vendor/golang.org/x/net/ipv4/sockopt.go | 44 - .../golang.org/x/net/ipv4/sockopt_posix.go | 71 - .../golang.org/x/net/ipv4/sockopt_stub.go | 42 - .../vendor/golang.org/x/net/ipv4/sys_aix.go | 38 - .../golang.org/x/net/ipv4/sys_asmreq.go | 119 - .../golang.org/x/net/ipv4/sys_asmreq_stub.go | 25 - .../golang.org/x/net/ipv4/sys_asmreqn.go | 42 - .../golang.org/x/net/ipv4/sys_asmreqn_stub.go | 21 - .../vendor/golang.org/x/net/ipv4/sys_bpf.go | 23 - .../golang.org/x/net/ipv4/sys_bpf_stub.go | 16 - .../vendor/golang.org/x/net/ipv4/sys_bsd.go | 37 - .../golang.org/x/net/ipv4/sys_darwin.go | 65 - .../golang.org/x/net/ipv4/sys_dragonfly.go | 35 - .../golang.org/x/net/ipv4/sys_freebsd.go | 76 - .../vendor/golang.org/x/net/ipv4/sys_linux.go | 59 - .../golang.org/x/net/ipv4/sys_solaris.go | 57 - .../golang.org/x/net/ipv4/sys_ssmreq.go | 52 - .../golang.org/x/net/ipv4/sys_ssmreq_stub.go | 21 - .../vendor/golang.org/x/net/ipv4/sys_stub.go | 13 - .../golang.org/x/net/ipv4/sys_windows.go | 67 - .../golang.org/x/net/ipv4/unicast_test.go | 244 - .../x/net/ipv4/unicastsockopt_test.go | 147 - .../golang.org/x/net/ipv4/zsys_aix_ppc64.go | 33 - .../golang.org/x/net/ipv4/zsys_darwin.go | 99 - .../golang.org/x/net/ipv4/zsys_dragonfly.go | 31 - .../golang.org/x/net/ipv4/zsys_freebsd_386.go | 93 - .../x/net/ipv4/zsys_freebsd_amd64.go | 95 - .../golang.org/x/net/ipv4/zsys_freebsd_arm.go | 95 - .../golang.org/x/net/ipv4/zsys_linux_386.go | 148 - .../golang.org/x/net/ipv4/zsys_linux_amd64.go | 150 - .../golang.org/x/net/ipv4/zsys_linux_arm.go | 148 - .../golang.org/x/net/ipv4/zsys_linux_arm64.go | 150 - .../golang.org/x/net/ipv4/zsys_linux_mips.go | 148 - .../x/net/ipv4/zsys_linux_mips64.go | 150 - .../x/net/ipv4/zsys_linux_mips64le.go | 150 - .../x/net/ipv4/zsys_linux_mipsle.go | 148 - .../golang.org/x/net/ipv4/zsys_linux_ppc.go | 148 - .../golang.org/x/net/ipv4/zsys_linux_ppc64.go | 150 - .../x/net/ipv4/zsys_linux_ppc64le.go | 150 - .../x/net/ipv4/zsys_linux_riscv64.go | 151 - .../golang.org/x/net/ipv4/zsys_linux_s390x.go | 150 - .../golang.org/x/net/ipv4/zsys_netbsd.go | 30 - .../golang.org/x/net/ipv4/zsys_openbsd.go | 30 - .../golang.org/x/net/ipv4/zsys_solaris.go | 100 - .../vendor/golang.org/x/net/ipv6/batch.go | 116 - .../vendor/golang.org/x/net/ipv6/bpf_test.go | 97 - .../vendor/golang.org/x/net/ipv6/control.go | 187 - .../x/net/ipv6/control_rfc2292_unix.go | 48 - .../x/net/ipv6/control_rfc3542_unix.go | 94 - .../golang.org/x/net/ipv6/control_stub.go | 13 - .../golang.org/x/net/ipv6/control_test.go | 21 - .../golang.org/x/net/ipv6/control_unix.go | 55 - .../golang.org/x/net/ipv6/control_windows.go | 12 - .../vendor/golang.org/x/net/ipv6/defs_aix.go | 82 - .../golang.org/x/net/ipv6/defs_darwin.go | 112 - .../golang.org/x/net/ipv6/defs_dragonfly.go | 84 - .../golang.org/x/net/ipv6/defs_freebsd.go | 105 - .../golang.org/x/net/ipv6/defs_linux.go | 147 - .../golang.org/x/net/ipv6/defs_netbsd.go | 80 - .../golang.org/x/net/ipv6/defs_openbsd.go | 89 - .../golang.org/x/net/ipv6/defs_solaris.go | 114 - .../vendor/golang.org/x/net/ipv6/dgramopt.go | 301 - .../vendor/golang.org/x/net/ipv6/doc.go | 243 - .../vendor/golang.org/x/net/ipv6/endpoint.go | 127 - .../golang.org/x/net/ipv6/example_test.go | 216 - .../vendor/golang.org/x/net/ipv6/gen.go | 199 - .../golang.org/x/net/ipv6/genericopt.go | 56 - .../vendor/golang.org/x/net/ipv6/header.go | 55 - .../golang.org/x/net/ipv6/header_test.go | 55 - .../vendor/golang.org/x/net/ipv6/helper.go | 59 - .../x/net/ipv6/helper_posix_test.go | 31 - .../golang.org/x/net/ipv6/helper_stub_test.go | 20 - .../golang.org/x/net/ipv6/helper_unix_test.go | 25 - .../x/net/ipv6/helper_windows_test.go | 9 - .../vendor/golang.org/x/net/ipv6/iana.go | 86 - .../vendor/golang.org/x/net/ipv6/icmp.go | 60 - .../vendor/golang.org/x/net/ipv6/icmp_bsd.go | 29 - .../golang.org/x/net/ipv6/icmp_linux.go | 27 - .../golang.org/x/net/ipv6/icmp_solaris.go | 27 - .../vendor/golang.org/x/net/ipv6/icmp_stub.go | 23 - .../vendor/golang.org/x/net/ipv6/icmp_test.go | 96 - .../golang.org/x/net/ipv6/icmp_windows.go | 22 - .../x/net/ipv6/mocktransponder_test.go | 34 - .../golang.org/x/net/ipv6/multicast_test.go | 264 - .../x/net/ipv6/multicastlistener_test.go | 261 - .../x/net/ipv6/multicastsockopt_test.go | 161 - .../vendor/golang.org/x/net/ipv6/payload.go | 23 - .../golang.org/x/net/ipv6/payload_cmsg.go | 70 - .../golang.org/x/net/ipv6/payload_nocmsg.go | 38 - .../golang.org/x/net/ipv6/readwrite_test.go | 509 - .../vendor/golang.org/x/net/ipv6/sockopt.go | 43 - .../golang.org/x/net/ipv6/sockopt_posix.go | 89 - .../golang.org/x/net/ipv6/sockopt_stub.go | 46 - .../golang.org/x/net/ipv6/sockopt_test.go | 131 - .../vendor/golang.org/x/net/ipv6/sys_aix.go | 77 - .../golang.org/x/net/ipv6/sys_asmreq.go | 24 - .../golang.org/x/net/ipv6/sys_asmreq_stub.go | 17 - .../vendor/golang.org/x/net/ipv6/sys_bpf.go | 23 - .../golang.org/x/net/ipv6/sys_bpf_stub.go | 16 - .../vendor/golang.org/x/net/ipv6/sys_bsd.go | 57 - .../golang.org/x/net/ipv6/sys_darwin.go | 78 - .../golang.org/x/net/ipv6/sys_freebsd.go | 92 - .../vendor/golang.org/x/net/ipv6/sys_linux.go | 74 - .../golang.org/x/net/ipv6/sys_solaris.go | 74 - .../golang.org/x/net/ipv6/sys_ssmreq.go | 54 - .../golang.org/x/net/ipv6/sys_ssmreq_stub.go | 21 - .../vendor/golang.org/x/net/ipv6/sys_stub.go | 13 - .../golang.org/x/net/ipv6/sys_windows.go | 75 - .../golang.org/x/net/ipv6/unicast_test.go | 184 - .../x/net/ipv6/unicastsockopt_test.go | 122 - .../golang.org/x/net/ipv6/zsys_aix_ppc64.go | 103 - .../golang.org/x/net/ipv6/zsys_darwin.go | 131 - .../golang.org/x/net/ipv6/zsys_dragonfly.go | 88 - .../golang.org/x/net/ipv6/zsys_freebsd_386.go | 122 - .../x/net/ipv6/zsys_freebsd_amd64.go | 124 - .../golang.org/x/net/ipv6/zsys_freebsd_arm.go | 124 - .../golang.org/x/net/ipv6/zsys_linux_386.go | 170 - .../golang.org/x/net/ipv6/zsys_linux_amd64.go | 172 - .../golang.org/x/net/ipv6/zsys_linux_arm.go | 170 - .../golang.org/x/net/ipv6/zsys_linux_arm64.go | 172 - .../golang.org/x/net/ipv6/zsys_linux_mips.go | 170 - .../x/net/ipv6/zsys_linux_mips64.go | 172 - .../x/net/ipv6/zsys_linux_mips64le.go | 172 - .../x/net/ipv6/zsys_linux_mipsle.go | 170 - .../golang.org/x/net/ipv6/zsys_linux_ppc.go | 170 - .../golang.org/x/net/ipv6/zsys_linux_ppc64.go | 172 - .../x/net/ipv6/zsys_linux_ppc64le.go | 172 - .../x/net/ipv6/zsys_linux_riscv64.go | 173 - .../golang.org/x/net/ipv6/zsys_linux_s390x.go | 172 - .../golang.org/x/net/ipv6/zsys_netbsd.go | 84 - .../golang.org/x/net/ipv6/zsys_openbsd.go | 93 - .../golang.org/x/net/ipv6/zsys_solaris.go | 131 - .../vendor/golang.org/x/net/lif/address.go | 105 - .../golang.org/x/net/lif/address_test.go | 123 - .../vendor/golang.org/x/net/lif/binary.go | 115 - .../golang.org/x/net/lif/defs_solaris.go | 90 - .../vendor/golang.org/x/net/lif/lif.go | 43 - .../vendor/golang.org/x/net/lif/link.go | 126 - .../vendor/golang.org/x/net/lif/link_test.go | 63 - .../vendor/golang.org/x/net/lif/sys.go | 21 - .../golang.org/x/net/lif/sys_solaris_amd64.s | 8 - .../vendor/golang.org/x/net/lif/syscall.go | 28 - .../x/net/lif/zsys_solaris_amd64.go | 103 - .../golang.org/x/net/nettest/conntest.go | 464 - .../golang.org/x/net/nettest/conntest_test.go | 74 - .../golang.org/x/net/nettest/nettest.go | 345 - .../golang.org/x/net/nettest/nettest_stub.go | 11 - .../golang.org/x/net/nettest/nettest_unix.go | 21 - .../x/net/nettest/nettest_windows.go | 26 - .../x/net/netutil/helper_stub_test.go | 11 - .../x/net/netutil/helper_unix_test.go | 17 - .../x/net/netutil/helper_windows_test.go | 9 - .../vendor/golang.org/x/net/netutil/listen.go | 74 - .../golang.org/x/net/netutil/listen_test.go | 147 - .../vendor/golang.org/x/net/proxy/dial.go | 54 - .../golang.org/x/net/proxy/dial_test.go | 131 - .../vendor/golang.org/x/net/proxy/direct.go | 31 - .../vendor/golang.org/x/net/proxy/per_host.go | 155 - .../golang.org/x/net/proxy/per_host_test.go | 76 - .../vendor/golang.org/x/net/proxy/proxy.go | 149 - .../golang.org/x/net/proxy/proxy_test.go | 159 - .../vendor/golang.org/x/net/proxy/socks5.go | 42 - .../x/net/publicsuffix/example_test.go | 93 - .../golang.org/x/net/publicsuffix/gen.go | 717 - .../golang.org/x/net/publicsuffix/list.go | 181 - .../x/net/publicsuffix/list_test.go | 509 - .../golang.org/x/net/publicsuffix/table.go | 9829 -- .../x/net/publicsuffix/table_test.go | 17434 ---- .../vendor/golang.org/x/net/route/address.go | 425 - .../x/net/route/address_darwin_test.go | 63 - .../golang.org/x/net/route/address_test.go | 103 - .../vendor/golang.org/x/net/route/binary.go | 90 - .../golang.org/x/net/route/defs_darwin.go | 114 - .../golang.org/x/net/route/defs_dragonfly.go | 113 - .../golang.org/x/net/route/defs_freebsd.go | 337 - .../golang.org/x/net/route/defs_netbsd.go | 112 - .../golang.org/x/net/route/defs_openbsd.go | 116 - .../vendor/golang.org/x/net/route/empty.s | 7 - .../golang.org/x/net/route/interface.go | 64 - .../x/net/route/interface_announce.go | 32 - .../x/net/route/interface_classic.go | 66 - .../x/net/route/interface_freebsd.go | 78 - .../x/net/route/interface_multicast.go | 30 - .../x/net/route/interface_openbsd.go | 90 - .../vendor/golang.org/x/net/route/message.go | 72 - .../x/net/route/message_darwin_test.go | 34 - .../x/net/route/message_freebsd_test.go | 88 - .../golang.org/x/net/route/message_test.go | 238 - .../vendor/golang.org/x/net/route/route.go | 123 - .../golang.org/x/net/route/route_classic.go | 75 - .../golang.org/x/net/route/route_openbsd.go | 65 - .../golang.org/x/net/route/route_test.go | 390 - .../vendor/golang.org/x/net/route/sys.go | 39 - .../golang.org/x/net/route/sys_darwin.go | 87 - .../golang.org/x/net/route/sys_dragonfly.go | 76 - .../golang.org/x/net/route/sys_freebsd.go | 163 - .../golang.org/x/net/route/sys_netbsd.go | 71 - .../golang.org/x/net/route/sys_openbsd.go | 80 - .../vendor/golang.org/x/net/route/syscall.go | 28 - .../x/net/route/syscall_go1_11_darwin.go | 28 - .../x/net/route/syscall_go1_12_darwin.go | 12 - .../golang.org/x/net/route/zsys_darwin.go | 99 - .../golang.org/x/net/route/zsys_dragonfly.go | 98 - .../x/net/route/zsys_freebsd_386.go | 126 - .../x/net/route/zsys_freebsd_amd64.go | 123 - .../x/net/route/zsys_freebsd_arm.go | 123 - .../x/net/route/zsys_freebsd_arm64.go | 123 - .../golang.org/x/net/route/zsys_netbsd.go | 97 - .../golang.org/x/net/route/zsys_openbsd.go | 101 - .../vendor/golang.org/x/net/trace/events.go | 532 - .../golang.org/x/net/trace/histogram.go | 365 - .../golang.org/x/net/trace/histogram_test.go | 325 - .../vendor/golang.org/x/net/trace/trace.go | 1130 - .../golang.org/x/net/trace/trace_test.go | 178 - .../vendor/golang.org/x/net/webdav/file.go | 795 - .../golang.org/x/net/webdav/file_test.go | 1183 - .../vendor/golang.org/x/net/webdav/if.go | 173 - .../vendor/golang.org/x/net/webdav/if_test.go | 322 - .../x/net/webdav/internal/xml/README | 11 - .../x/net/webdav/internal/xml/atom_test.go | 56 - .../x/net/webdav/internal/xml/example_test.go | 151 - .../x/net/webdav/internal/xml/marshal.go | 1223 - .../x/net/webdav/internal/xml/marshal_test.go | 1939 - .../x/net/webdav/internal/xml/read.go | 692 - .../x/net/webdav/internal/xml/read_test.go | 744 - .../x/net/webdav/internal/xml/typeinfo.go | 371 - .../x/net/webdav/internal/xml/xml.go | 1998 - .../x/net/webdav/internal/xml/xml_test.go | 752 - .../x/net/webdav/litmus_test_server.go | 94 - .../vendor/golang.org/x/net/webdav/lock.go | 445 - .../golang.org/x/net/webdav/lock_test.go | 731 - .../vendor/golang.org/x/net/webdav/prop.go | 469 - .../golang.org/x/net/webdav/prop_test.go | 716 - .../vendor/golang.org/x/net/webdav/webdav.go | 706 - .../golang.org/x/net/webdav/webdav_test.go | 349 - .../vendor/golang.org/x/net/webdav/xml.go | 519 - .../golang.org/x/net/webdav/xml_test.go | 906 - .../golang.org/x/net/websocket/client.go | 106 - .../vendor/golang.org/x/net/websocket/dial.go | 24 - .../golang.org/x/net/websocket/dial_test.go | 43 - .../x/net/websocket/exampledial_test.go | 31 - .../x/net/websocket/examplehandler_test.go | 26 - .../vendor/golang.org/x/net/websocket/hybi.go | 583 - .../golang.org/x/net/websocket/hybi_test.go | 608 - .../golang.org/x/net/websocket/server.go | 113 - .../golang.org/x/net/websocket/websocket.go | 451 - .../x/net/websocket/websocket_test.go | 665 - .../vendor/golang.org/x/net/xsrftoken/xsrf.go | 94 - .../golang.org/x/net/xsrftoken/xsrf_test.go | 83 - .../vendor/golang.org/x/sys/.gitattributes | 10 - .../vendor/golang.org/x/sys/.gitignore | 2 - .../vendor/golang.org/x/sys/CONTRIBUTING.md | 26 - .../vendor/golang.org/x/sys/README.md | 18 - .../vendor/golang.org/x/sys/codereview.cfg | 1 - .../vendor/golang.org/x/sys/cpu/byteorder.go | 30 - .../vendor/golang.org/x/sys/cpu/cpu.go | 126 - .../golang.org/x/sys/cpu/cpu_aix_ppc64.go | 34 - .../vendor/golang.org/x/sys/cpu/cpu_arm.go | 9 - .../golang.org/x/sys/cpu/cpu_gc_s390x.go | 21 - .../vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 16 - .../vendor/golang.org/x/sys/cpu/cpu_gccgo.c | 43 - .../vendor/golang.org/x/sys/cpu/cpu_gccgo.go | 26 - .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 22 - .../vendor/golang.org/x/sys/cpu/cpu_linux.go | 59 - .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 67 - .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 33 - .../golang.org/x/sys/cpu/cpu_linux_s390x.go | 161 - .../golang.org/x/sys/cpu/cpu_mips64x.go | 11 - .../vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 11 - .../golang.org/x/sys/cpu/cpu_other_arm64.go | 11 - .../vendor/golang.org/x/sys/cpu/cpu_s390x.s | 57 - .../vendor/golang.org/x/sys/cpu/cpu_test.go | 74 - .../vendor/golang.org/x/sys/cpu/cpu_wasm.go | 15 - .../vendor/golang.org/x/sys/cpu/cpu_x86.go | 59 - .../vendor/golang.org/x/sys/cpu/cpu_x86.s | 27 - .../x/sys/cpu/syscall_aix_ppc64_gc.go | 36 - .../vendor/golang.org/x/sys/go.mod | 3 - .../vendor/golang.org/x/sys/plan9/asm.s | 8 - .../golang.org/x/sys/plan9/asm_plan9_386.s | 30 - .../golang.org/x/sys/plan9/asm_plan9_amd64.s | 30 - .../golang.org/x/sys/plan9/asm_plan9_arm.s | 25 - .../golang.org/x/sys/plan9/const_plan9.go | 70 - .../golang.org/x/sys/plan9/dir_plan9.go | 212 - .../golang.org/x/sys/plan9/env_plan9.go | 31 - .../golang.org/x/sys/plan9/errors_plan9.go | 50 - .../vendor/golang.org/x/sys/plan9/mkall.sh | 150 - .../vendor/golang.org/x/sys/plan9/mkerrors.sh | 246 - .../golang.org/x/sys/plan9/mksyscall.go | 393 - .../golang.org/x/sys/plan9/mksysnum_plan9.sh | 23 - .../golang.org/x/sys/plan9/pwd_go15_plan9.go | 21 - .../golang.org/x/sys/plan9/pwd_plan9.go | 23 - .../vendor/golang.org/x/sys/plan9/race.go | 30 - .../vendor/golang.org/x/sys/plan9/race0.go | 25 - .../vendor/golang.org/x/sys/plan9/str.go | 22 - .../vendor/golang.org/x/sys/plan9/syscall.go | 77 - .../golang.org/x/sys/plan9/syscall_plan9.go | 349 - .../golang.org/x/sys/plan9/syscall_test.go | 33 - .../x/sys/plan9/zsyscall_plan9_386.go | 284 - .../x/sys/plan9/zsyscall_plan9_amd64.go | 284 - .../x/sys/plan9/zsyscall_plan9_arm.go | 284 - .../golang.org/x/sys/plan9/zsysnum_plan9.go | 49 - .../golang.org/x/sys/unix/asm_aix_ppc64.s | 17 - .../golang.org/x/sys/unix/asm_linux_riscv64.s | 54 - .../golang.org/x/sys/unix/asm_openbsd_arm64.s | 29 - .../golang.org/x/sys/unix/creds_test.go | 134 - .../golang.org/x/sys/unix/darwin_test.go | 210 - .../golang.org/x/sys/unix/dev_linux_test.go | 56 - .../x/sys/unix/example_exec_test.go | 19 - .../x/sys/unix/example_flock_test.go | 25 - .../golang.org/x/sys/unix/export_test.go | 9 - .../golang.org/x/sys/unix/linux/Dockerfile | 53 - .../golang.org/x/sys/unix/linux/mkall.go | 775 - .../golang.org/x/sys/unix/linux/mksysnum.go | 143 - .../golang.org/x/sys/unix/linux/types.go | 1993 - .../golang.org/x/sys/unix/mksysctl_openbsd.go | 355 - .../golang.org/x/sys/unix/mmap_unix_test.go | 41 - .../golang.org/x/sys/unix/openbsd_test.go | 113 - .../golang.org/x/sys/unix/sendfile_test.go | 98 - .../x/sys/unix/syscall_aix_ppc64.go | 81 - .../golang.org/x/sys/unix/syscall_aix_test.go | 168 - .../golang.org/x/sys/unix/syscall_bsd_test.go | 89 - .../x/sys/unix/syscall_darwin_test.go | 72 - .../x/sys/unix/syscall_freebsd_test.go | 312 - .../x/sys/unix/syscall_linux_test.go | 613 - .../x/sys/unix/syscall_netbsd_test.go | 51 - .../x/sys/unix/syscall_openbsd_test.go | 58 - .../x/sys/unix/syscall_solaris_test.go | 55 - .../golang.org/x/sys/unix/syscall_test.go | 74 - .../x/sys/unix/syscall_unix_test.go | 760 - .../golang.org/x/sys/unix/timestruct_test.go | 54 - .../golang.org/x/sys/unix/xattr_test.go | 207 - .../x/sys/unix/zerrors_openbsd_arm64.go | 1789 - .../x/sys/unix/zsyscall_openbsd_arm64.go | 1692 - .../x/sys/unix/zsysctl_openbsd_arm64.go | 275 - .../x/sys/unix/zsysnum_linux_386.go | 426 - .../x/sys/unix/zsysnum_linux_arm.go | 390 - .../x/sys/unix/zsysnum_linux_mips.go | 411 - .../x/sys/unix/zsysnum_linux_mipsle.go | 411 - .../x/sys/unix/zsysnum_openbsd_arm64.go | 217 - .../x/sys/unix/ztypes_openbsd_arm64.go | 564 - .../golang.org/x/sys/windows/aliases.go | 13 - .../x/sys/windows/asm_windows_386.s | 13 - .../x/sys/windows/asm_windows_amd64.s | 13 - .../x/sys/windows/asm_windows_arm.s | 11 - .../golang.org/x/sys/windows/dll_windows.go | 378 - .../golang.org/x/sys/windows/env_windows.go | 61 - .../golang.org/x/sys/windows/eventlog.go | 20 - .../golang.org/x/sys/windows/exec_windows.go | 97 - .../x/sys/windows/memory_windows.go | 26 - .../golang.org/x/sys/windows/mkerrors.bash | 63 - .../golang.org/x/sys/windows/mksyscall.go | 9 - .../vendor/golang.org/x/sys/windows/race.go | 30 - .../vendor/golang.org/x/sys/windows/race0.go | 25 - .../x/sys/windows/registry/export_test.go | 11 - .../golang.org/x/sys/windows/registry/key.go | 198 - .../x/sys/windows/registry/mksyscall.go | 9 - .../x/sys/windows/registry/registry_test.go | 756 - .../x/sys/windows/registry/syscall.go | 32 - .../x/sys/windows/registry/value.go | 387 - .../sys/windows/registry/zsyscall_windows.go | 120 - .../x/sys/windows/security_windows.go | 854 - .../golang.org/x/sys/windows/service.go | 225 - .../vendor/golang.org/x/sys/windows/str.go | 22 - .../golang.org/x/sys/windows/svc/debug/log.go | 56 - .../x/sys/windows/svc/debug/service.go | 45 - .../golang.org/x/sys/windows/svc/event.go | 48 - .../x/sys/windows/svc/eventlog/install.go | 80 - .../x/sys/windows/svc/eventlog/log.go | 70 - .../x/sys/windows/svc/eventlog/log_test.go | 51 - .../x/sys/windows/svc/example/beep.go | 22 - .../x/sys/windows/svc/example/install.go | 92 - .../x/sys/windows/svc/example/main.go | 76 - .../x/sys/windows/svc/example/manage.go | 62 - .../x/sys/windows/svc/example/service.go | 87 - .../golang.org/x/sys/windows/svc/go12.c | 24 - .../golang.org/x/sys/windows/svc/go12.go | 11 - .../golang.org/x/sys/windows/svc/go13.go | 31 - .../x/sys/windows/svc/mgr/config.go | 154 - .../golang.org/x/sys/windows/svc/mgr/mgr.go | 203 - .../x/sys/windows/svc/mgr/mgr_test.go | 282 - .../x/sys/windows/svc/mgr/recovery.go | 135 - .../x/sys/windows/svc/mgr/service.go | 75 - .../golang.org/x/sys/windows/svc/security.go | 62 - .../golang.org/x/sys/windows/svc/service.go | 364 - .../golang.org/x/sys/windows/svc/svc_test.go | 134 - .../golang.org/x/sys/windows/svc/sys_386.s | 69 - .../golang.org/x/sys/windows/svc/sys_amd64.s | 44 - .../golang.org/x/sys/windows/svc/sys_arm.s | 38 - .../golang.org/x/sys/windows/syscall.go | 74 - .../golang.org/x/sys/windows/syscall_test.go | 64 - .../x/sys/windows/syscall_windows.go | 1284 - .../x/sys/windows/syscall_windows_test.go | 198 - .../golang.org/x/sys/windows/types_windows.go | 1632 - .../x/sys/windows/types_windows_386.go | 22 - .../x/sys/windows/types_windows_amd64.go | 22 - .../x/sys/windows/types_windows_arm.go | 22 - .../x/sys/windows/zerrors_windows.go | 6853 -- .../x/sys/windows/zsyscall_windows.go | 3278 - .../vendor/golang.org/x/text/.gitattributes | 10 - .../vendor/golang.org/x/text/.gitignore | 6 - .../vendor/golang.org/x/text/CONTRIBUTING.md | 26 - .../vendor/golang.org/x/text/README.md | 93 - .../vendor/golang.org/x/text/cases/cases.go | 162 - .../vendor/golang.org/x/text/cases/context.go | 376 - .../golang.org/x/text/cases/context_test.go | 438 - .../golang.org/x/text/cases/example_test.go | 53 - .../vendor/golang.org/x/text/cases/fold.go | 34 - .../golang.org/x/text/cases/fold_test.go | 51 - .../vendor/golang.org/x/text/cases/gen.go | 833 - .../golang.org/x/text/cases/gen_trieval.go | 218 - .../vendor/golang.org/x/text/cases/icu.go | 61 - .../golang.org/x/text/cases/icu_test.go | 210 - .../vendor/golang.org/x/text/cases/info.go | 82 - .../vendor/golang.org/x/text/cases/map.go | 816 - .../golang.org/x/text/cases/map_test.go | 950 - .../golang.org/x/text/cases/tables10.0.0.go | 2255 - .../x/text/cases/tables10.0.0_test.go | 1160 - .../golang.org/x/text/cases/tables11.0.0.go | 2316 - .../x/text/cases/tables11.0.0_test.go | 1183 - .../golang.org/x/text/cases/tables9.0.0.go | 2215 - .../x/text/cases/tables9.0.0_test.go | 1156 - .../vendor/golang.org/x/text/cases/trieval.go | 214 - .../golang.org/x/text/cmd/gotext/common.go | 49 - .../golang.org/x/text/cmd/gotext/doc.go | 63 - .../cmd/gotext/examples/extract/catalog.go | 84 - .../extract/locales/de/messages.gotext.json | 186 - .../extract/locales/de/out.gotext.json | 137 - .../locales/en-US/messages.gotext.json | 82 - .../extract/locales/en-US/out.gotext.json | 154 - .../extract/locales/zh/messages.gotext.json | 203 - .../extract/locales/zh/out.gotext.json | 137 - .../text/cmd/gotext/examples/extract/main.go | 86 - .../examples/extract_http/catalog_gen.go | 57 - .../extract_http/locales/de/out.gotext.json | 39 - .../locales/en-US/out.gotext.json | 39 - .../extract_http/locales/en/out.gotext.json | 39 - .../extract_http/locales/zh/out.gotext.json | 35 - .../cmd/gotext/examples/extract_http/main.go | 17 - .../text/cmd/gotext/examples/rewrite/main.go | 37 - .../cmd/gotext/examples/rewrite/printer.go | 16 - .../golang.org/x/text/cmd/gotext/extract.go | 40 - .../golang.org/x/text/cmd/gotext/generate.go | 31 - .../golang.org/x/text/cmd/gotext/main.go | 375 - .../golang.org/x/text/cmd/gotext/rewrite.go | 56 - .../golang.org/x/text/cmd/gotext/update.go | 52 - .../vendor/golang.org/x/text/codereview.cfg | 1 - .../x/text/collate/build/builder.go | 702 - .../x/text/collate/build/builder_test.go | 290 - .../x/text/collate/build/colelem.go | 294 - .../x/text/collate/build/colelem_test.go | 215 - .../x/text/collate/build/contract.go | 309 - .../x/text/collate/build/contract_test.go | 266 - .../golang.org/x/text/collate/build/order.go | 393 - .../x/text/collate/build/order_test.go | 229 - .../golang.org/x/text/collate/build/table.go | 81 - .../golang.org/x/text/collate/build/trie.go | 290 - .../x/text/collate/build/trie_test.go | 107 - .../golang.org/x/text/collate/collate.go | 403 - .../golang.org/x/text/collate/collate_test.go | 482 - .../golang.org/x/text/collate/export_test.go | 51 - .../vendor/golang.org/x/text/collate/index.go | 32 - .../golang.org/x/text/collate/maketables.go | 553 - .../golang.org/x/text/collate/option.go | 239 - .../golang.org/x/text/collate/option_test.go | 209 - .../golang.org/x/text/collate/reg_test.go | 230 - .../vendor/golang.org/x/text/collate/sort.go | 81 - .../golang.org/x/text/collate/sort_test.go | 55 - .../golang.org/x/text/collate/table_test.go | 291 - .../golang.org/x/text/collate/tables.go | 73789 --------------- .../x/text/collate/tools/colcmp/Makefile | 7 - .../x/text/collate/tools/colcmp/chars.go | 1156 - .../x/text/collate/tools/colcmp/col.go | 97 - .../x/text/collate/tools/colcmp/colcmp.go | 529 - .../x/text/collate/tools/colcmp/darwin.go | 111 - .../x/text/collate/tools/colcmp/gen.go | 183 - .../x/text/collate/tools/colcmp/icu.go | 209 - .../golang.org/x/text/currency/common.go | 67 - .../golang.org/x/text/currency/currency.go | 185 - .../x/text/currency/currency_test.go | 172 - .../x/text/currency/example_test.go | 27 - .../golang.org/x/text/currency/format.go | 214 - .../golang.org/x/text/currency/format_test.go | 70 - .../vendor/golang.org/x/text/currency/gen.go | 401 - .../golang.org/x/text/currency/gen_common.go | 71 - .../golang.org/x/text/currency/query.go | 152 - .../golang.org/x/text/currency/query_test.go | 107 - .../golang.org/x/text/currency/tables.go | 2629 - .../golang.org/x/text/currency/tables_test.go | 93 - .../golang.org/x/text/date/data_test.go | 335 - .../vendor/golang.org/x/text/date/gen.go | 329 - .../vendor/golang.org/x/text/date/gen_test.go | 242 - .../vendor/golang.org/x/text/date/tables.go | 75291 ---------------- .../vendor/golang.org/x/text/doc.go | 16 - .../x/text/encoding/charmap/charmap_test.go | 258 - .../x/text/encoding/encoding_test.go | 290 - .../x/text/encoding/example_test.go | 42 - .../text/encoding/htmlindex/htmlindex_test.go | 144 - .../x/text/encoding/ianaindex/example_test.go | 27 - .../x/text/encoding/ianaindex/gen.go | 192 - .../x/text/encoding/ianaindex/ianaindex.go | 209 - .../text/encoding/ianaindex/ianaindex_test.go | 192 - .../x/text/encoding/ianaindex/tables.go | 2348 - .../text/encoding/internal/enctest/enctest.go | 180 - .../x/text/encoding/japanese/all_test.go | 248 - .../x/text/encoding/korean/all_test.go | 94 - .../encoding/simplifiedchinese/all_test.go | 143 - .../encoding/testdata/candide-gb18030.txt | 510 - .../encoding/testdata/candide-utf-16le.txt | Bin 51932 -> 0 bytes .../encoding/testdata/candide-utf-32be.txt | Bin 103864 -> 0 bytes .../text/encoding/testdata/candide-utf-8.txt | 510 - .../testdata/candide-windows-1252.txt | 510 - .../encoding/testdata/rashomon-euc-jp.txt | 178 - .../testdata/rashomon-iso-2022-jp.txt | 178 - .../encoding/testdata/rashomon-shift-jis.txt | 178 - .../text/encoding/testdata/rashomon-utf-8.txt | 178 - ...nzi-bingfa-gb-levels-1-and-2-hz-gb2312.txt | 107 - .../sunzi-bingfa-gb-levels-1-and-2-utf-8.txt | 107 - .../testdata/sunzi-bingfa-simplified-gbk.txt | 107 - .../sunzi-bingfa-simplified-utf-8.txt | 107 - .../sunzi-bingfa-traditional-big5.txt | 106 - .../sunzi-bingfa-traditional-utf-8.txt | 106 - .../testdata/unsu-joh-eun-nal-euc-kr.txt | 175 - .../testdata/unsu-joh-eun-nal-utf-8.txt | 175 - .../encoding/traditionalchinese/all_test.go | 114 - .../x/text/encoding/unicode/unicode_test.go | 499 - .../x/text/encoding/unicode/utf32/utf32.go | 296 - .../text/encoding/unicode/utf32/utf32_test.go | 248 - .../x/text/feature/plural/common.go | 70 - .../x/text/feature/plural/data_test.go | 197 - .../x/text/feature/plural/example_test.go | 46 - .../golang.org/x/text/feature/plural/gen.go | 525 - .../x/text/feature/plural/gen_common.go | 74 - .../x/text/feature/plural/message.go | 244 - .../x/text/feature/plural/message_test.go | 197 - .../x/text/feature/plural/plural.go | 261 - .../x/text/feature/plural/plural_test.go | 216 - .../x/text/feature/plural/tables.go | 552 - .../vendor/golang.org/x/text/gen.go | 301 - .../vendor/golang.org/x/text/go.mod | 3 - .../vendor/golang.org/x/text/go.sum | 2 - .../x/text/internal/catmsg/catmsg.go | 415 - .../x/text/internal/catmsg/catmsg_test.go | 327 - .../x/text/internal/catmsg/codec.go | 407 - .../x/text/internal/catmsg/varint.go | 62 - .../x/text/internal/catmsg/varint_test.go | 123 - .../x/text/internal/cldrtree/cldrtree.go | 353 - .../x/text/internal/cldrtree/cldrtree_test.go | 457 - .../x/text/internal/cldrtree/generate.go | 208 - .../x/text/internal/cldrtree/option.go | 86 - .../testdata/test1/common/main/root.xml | 89 - .../cldrtree/testdata/test1/output.go | 353 - .../testdata/test2/common/main/en.xml | 171 - .../testdata/test2/common/main/en_001.xml | 60 - .../testdata/test2/common/main/en_GB.xml | 63 - .../testdata/test2/common/main/root.xml | 646 - .../cldrtree/testdata/test2/output.go | 892 - .../x/text/internal/cldrtree/tree.go | 181 - .../x/text/internal/cldrtree/type.go | 139 - .../x/text/internal/colltab/collate_test.go | 121 - .../x/text/internal/colltab/collelem.go | 371 - .../x/text/internal/colltab/collelem_test.go | 183 - .../x/text/internal/colltab/colltab.go | 105 - .../x/text/internal/colltab/colltab_test.go | 66 - .../x/text/internal/colltab/contract.go | 145 - .../x/text/internal/colltab/contract_test.go | 131 - .../x/text/internal/colltab/iter.go | 178 - .../x/text/internal/colltab/iter_test.go | 63 - .../x/text/internal/colltab/numeric.go | 236 - .../x/text/internal/colltab/numeric_test.go | 159 - .../x/text/internal/colltab/table.go | 275 - .../x/text/internal/colltab/trie.go | 159 - .../x/text/internal/colltab/trie_test.go | 106 - .../x/text/internal/colltab/weighter.go | 31 - .../x/text/internal/colltab/weighter_test.go | 42 - .../golang.org/x/text/internal/export/README | 4 - .../text/internal/export/idna/common_test.go | 55 - .../internal/export/idna/conformance_test.go | 70 - .../text/internal/export/idna/example_test.go | 68 - .../x/text/internal/export/idna/gen.go | 276 - .../internal/export/idna/gen10.0.0_test.go | 93 - .../internal/export/idna/gen9.0.0_test.go | 84 - .../x/text/internal/export/idna/gen_common.go | 59 - .../text/internal/export/idna/gen_trieval.go | 123 - .../x/text/internal/export/idna/idna10.0.0.go | 733 - .../internal/export/idna/idna10.0.0_test.go | 140 - .../x/text/internal/export/idna/idna9.0.0.go | 681 - .../internal/export/idna/idna9.0.0_test.go | 136 - .../x/text/internal/export/idna/idna_test.go | 114 - .../x/text/internal/export/idna/punycode.go | 201 - .../internal/export/idna/punycode_test.go | 198 - .../text/internal/export/idna/tables10.0.0.go | 4559 - .../text/internal/export/idna/tables11.0.0.go | 4653 - .../text/internal/export/idna/tables9.0.0.go | 4486 - .../x/text/internal/export/idna/trie.go | 70 - .../x/text/internal/export/idna/trieval.go | 119 - .../x/text/internal/export/unicode/doc.go | 13 - .../x/text/internal/export/unicode/gen.go | 1029 - .../internal/export/unicode/unicode_test.go | 28 - .../x/text/internal/format/format.go | 41 - .../x/text/internal/format/parser.go | 358 - .../x/text/internal/format/parser_test.go | 32 - .../x/text/internal/gen/bitfield/bitfield.go | 226 - .../internal/gen/bitfield/bitfield_test.go | 230 - .../x/text/internal/gen/bitfield/gen1_test.go | 26 - .../x/text/internal/gen/bitfield/gen2_test.go | 26 - .../golang.org/x/text/internal/gen/code.go | 375 - .../golang.org/x/text/internal/gen/gen.go | 347 - .../golang.org/x/text/internal/internal.go | 49 - .../x/text/internal/internal_test.go | 38 - .../x/text/internal/language/compact.go | 29 - .../text/internal/language/compact/compact.go | 61 - .../x/text/internal/language/compact/gen.go | 64 - .../internal/language/compact/gen_index.go | 113 - .../internal/language/compact/gen_parents.go | 54 - .../internal/language/compact/gen_test.go | 38 - .../internal/language/compact/language.go | 260 - .../language/compact/language_test.go | 236 - .../text/internal/language/compact/parents.go | 120 - .../internal/language/compact/parse_test.go | 196 - .../text/internal/language/compact/tables.go | 1015 - .../x/text/internal/language/compact/tags.go | 91 - .../x/text/internal/language/compose.go | 167 - .../x/text/internal/language/compose_test.go | 67 - .../x/text/internal/language/coverage.go | 28 - .../x/text/internal/language/language.go | 596 - .../x/text/internal/language/language_test.go | 736 - .../x/text/internal/language/lookup_test.go | 457 - .../x/text/internal/language/match.go | 226 - .../x/text/internal/language/match_test.go | 161 - .../x/text/internal/language/parse_test.go | 364 - .../x/text/internal/language/tags.go | 48 - .../golang.org/x/text/internal/match.go | 67 - .../golang.org/x/text/internal/match_test.go | 56 - .../x/text/internal/number/common.go | 55 - .../x/text/internal/number/decimal.go | 498 - .../x/text/internal/number/decimal_test.go | 329 - .../x/text/internal/number/format.go | 535 - .../x/text/internal/number/format_test.go | 522 - .../golang.org/x/text/internal/number/gen.go | 458 - .../x/text/internal/number/gen_common.go | 59 - .../x/text/internal/number/number.go | 152 - .../x/text/internal/number/number_test.go | 104 - .../x/text/internal/number/pattern.go | 485 - .../x/text/internal/number/pattern_test.go | 438 - .../internal/number/roundingmode_string.go | 30 - .../x/text/internal/number/tables.go | 1219 - .../x/text/internal/number/tables_test.go | 126 - .../x/text/internal/stringset/set.go | 86 - .../x/text/internal/stringset/set_test.go | 53 - .../x/text/internal/tag/tag_test.go | 67 - .../x/text/internal/testtext/codesize.go | 53 - .../x/text/internal/testtext/flag.go | 22 - .../golang.org/x/text/internal/testtext/gc.go | 14 - .../x/text/internal/testtext/gccgo.go | 11 - .../x/text/internal/testtext/go1_6.go | 23 - .../x/text/internal/testtext/go1_7.go | 17 - .../x/text/internal/testtext/text.go | 105 - .../x/text/internal/triegen/compact.go | 58 - .../x/text/internal/triegen/data_test.go | 875 - .../internal/triegen/example_compact_test.go | 71 - .../x/text/internal/triegen/example_test.go | 148 - .../x/text/internal/triegen/gen_test.go | 68 - .../x/text/internal/triegen/print.go | 251 - .../x/text/internal/triegen/triegen.go | 494 - .../x/text/internal/ucd/example_test.go | 81 - .../golang.org/x/text/internal/ucd/ucd.go | 371 - .../x/text/internal/ucd/ucd_test.go | 105 - .../x/text/language/coverage_test.go | 156 - .../x/text/language/display/dict.go | 92 - .../x/text/language/display/dict_test.go | 39 - .../x/text/language/display/display.go | 420 - .../x/text/language/display/display_test.go | 714 - .../x/text/language/display/examples_test.go | 116 - .../x/text/language/display/lookup.go | 251 - .../x/text/language/display/maketables.go | 602 - .../x/text/language/display/tables.go | 53114 ----------- .../x/text/language/examples_test.go | 413 - .../vendor/golang.org/x/text/language/gen.go | 305 - .../x/text/language/httpexample_test.go | 48 - .../golang.org/x/text/language/language.go | 601 - .../x/text/language/language_test.go | 773 - .../golang.org/x/text/language/lookup_test.go | 281 - .../golang.org/x/text/language/match_test.go | 359 - .../golang.org/x/text/language/parse.go | 228 - .../golang.org/x/text/language/parse_test.go | 390 - .../golang.org/x/text/language/tables.go | 298 - .../vendor/golang.org/x/text/language/tags.go | 145 - .../testdata/CLDRLocaleMatcherTest.txt | 389 - .../language/testdata/GoLocaleMatcherTest.txt | 231 - .../golang.org/x/text/message/catalog.go | 36 - .../x/text/message/catalog/catalog.go | 370 - .../x/text/message/catalog/catalog_test.go | 296 - .../golang.org/x/text/message/catalog/dict.go | 129 - .../golang.org/x/text/message/catalog/go19.go | 15 - .../x/text/message/catalog/gopre19.go | 23 - .../golang.org/x/text/message/catalog_test.go | 46 - .../vendor/golang.org/x/text/message/doc.go | 101 - .../x/text/message/examples_test.go | 70 - .../golang.org/x/text/message/fmt_test.go | 1871 - .../golang.org/x/text/message/format.go | 510 - .../golang.org/x/text/message/message.go | 193 - .../golang.org/x/text/message/message_test.go | 192 - .../x/text/message/pipeline/extract.go | 814 - .../x/text/message/pipeline/generate.go | 314 - .../x/text/message/pipeline/go19_test.go | 13 - .../x/text/message/pipeline/message.go | 241 - .../x/text/message/pipeline/pipeline.go | 422 - .../x/text/message/pipeline/pipeline_test.go | 130 - .../x/text/message/pipeline/rewrite.go | 268 - .../pipeline/testdata/ssa/catalog_gen.go | 37 - .../testdata/ssa/extracted.gotext.json | 298 - .../text/message/pipeline/testdata/ssa/ssa.go | 202 - .../pipeline/testdata/test1/catalog_gen.go | 85 - .../testdata/test1/catalog_gen.go.want | 85 - .../pipeline/testdata/test1/catalog_test.go | 49 - .../testdata/test1/extracted.gotext.json | 188 - .../testdata/test1/extracted.gotext.json.want | 188 - .../test1/locales/de/messages.gotext.json | 123 - .../testdata/test1/locales/de/out.gotext.json | 137 - .../test1/locales/de/out.gotext.json.want | 137 - .../test1/locales/en-US/messages.gotext.json | 91 - .../test1/locales/en-US/out.gotext.json | 154 - .../test1/locales/en-US/out.gotext.json.want | 154 - .../test1/locales/zh/messages.gotext.json | 135 - .../testdata/test1/locales/zh/out.gotext.json | 137 - .../test1/locales/zh/out.gotext.json.want | 137 - .../message/pipeline/testdata/test1/test1.go | 75 - .../vendor/golang.org/x/text/message/print.go | 984 - .../vendor/golang.org/x/text/number/doc.go | 28 - .../golang.org/x/text/number/examples_test.go | 28 - .../vendor/golang.org/x/text/number/format.go | 122 - .../golang.org/x/text/number/format_test.go | 112 - .../vendor/golang.org/x/text/number/number.go | 77 - .../golang.org/x/text/number/number_test.go | 190 - .../vendor/golang.org/x/text/number/option.go | 177 - .../golang.org/x/text/runes/cond_test.go | 282 - .../golang.org/x/text/runes/example_test.go | 60 - .../golang.org/x/text/runes/runes_test.go | 664 - .../vendor/golang.org/x/text/search/index.go | 35 - .../golang.org/x/text/search/pattern.go | 155 - .../golang.org/x/text/search/pattern_test.go | 357 - .../vendor/golang.org/x/text/search/search.go | 237 - .../vendor/golang.org/x/text/search/tables.go | 12448 --- .../x/text/secure/bidirule/bench_test.go | 54 - .../x/text/secure/bidirule/bidirule.go | 336 - .../x/text/secure/bidirule/bidirule10.0.0.go | 11 - .../secure/bidirule/bidirule10.0.0_test.go | 694 - .../x/text/secure/bidirule/bidirule9.0.0.go | 14 - .../secure/bidirule/bidirule9.0.0_test.go | 668 - .../x/text/secure/bidirule/bidirule_test.go | 168 - .../vendor/golang.org/x/text/secure/doc.go | 6 - .../x/text/secure/precis/benchmark_test.go | 82 - .../golang.org/x/text/secure/precis/class.go | 36 - .../x/text/secure/precis/class_test.go | 50 - .../x/text/secure/precis/context.go | 139 - .../golang.org/x/text/secure/precis/doc.go | 14 - .../text/secure/precis/enforce10.0.0_test.go | 253 - .../x/text/secure/precis/enforce9.0.0_test.go | 253 - .../x/text/secure/precis/enforce_test.go | 162 - .../golang.org/x/text/secure/precis/gen.go | 310 - .../x/text/secure/precis/gen_trieval.go | 68 - .../x/text/secure/precis/nickname.go | 72 - .../x/text/secure/precis/options.go | 157 - .../x/text/secure/precis/profile.go | 412 - .../x/text/secure/precis/profile_test.go | 149 - .../x/text/secure/precis/profiles.go | 78 - .../x/text/secure/precis/tables10.0.0.go | 3889 - .../x/text/secure/precis/tables11.0.0.go | 4016 - .../x/text/secure/precis/tables9.0.0.go | 3790 - .../x/text/secure/precis/tables_test.go | 69 - .../x/text/secure/precis/transformer.go | 32 - .../x/text/secure/precis/trieval.go | 64 - .../x/text/transform/examples_test.go | 37 - .../x/text/transform/transform_test.go | 1317 - .../golang.org/x/text/unicode/bidi/bidi.go | 198 - .../golang.org/x/text/unicode/bidi/bracket.go | 335 - .../golang.org/x/text/unicode/bidi/core.go | 1058 - .../x/text/unicode/bidi/core_test.go | 224 - .../golang.org/x/text/unicode/bidi/gen.go | 133 - .../x/text/unicode/bidi/gen_ranges.go | 57 - .../x/text/unicode/bidi/gen_trieval.go | 64 - .../golang.org/x/text/unicode/bidi/prop.go | 206 - .../x/text/unicode/bidi/ranges_test.go | 53 - .../x/text/unicode/bidi/tables10.0.0.go | 1815 - .../x/text/unicode/bidi/tables11.0.0.go | 1887 - .../x/text/unicode/bidi/tables9.0.0.go | 1781 - .../x/text/unicode/bidi/tables_test.go | 82 - .../golang.org/x/text/unicode/bidi/trieval.go | 60 - .../golang.org/x/text/unicode/cldr/base.go | 105 - .../golang.org/x/text/unicode/cldr/cldr.go | 137 - .../x/text/unicode/cldr/cldr_test.go | 27 - .../golang.org/x/text/unicode/cldr/collate.go | 359 - .../x/text/unicode/cldr/collate_test.go | 275 - .../x/text/unicode/cldr/data_test.go | 186 - .../golang.org/x/text/unicode/cldr/decode.go | 172 - .../x/text/unicode/cldr/examples_test.go | 96 - .../golang.org/x/text/unicode/cldr/makexml.go | 400 - .../golang.org/x/text/unicode/cldr/resolve.go | 602 - .../x/text/unicode/cldr/resolve_test.go | 368 - .../golang.org/x/text/unicode/cldr/slice.go | 144 - .../x/text/unicode/cldr/slice_test.go | 175 - .../golang.org/x/text/unicode/cldr/xml.go | 1494 - .../vendor/golang.org/x/text/unicode/doc.go | 8 - .../x/text/unicode/norm/composition.go | 512 - .../x/text/unicode/norm/composition_test.go | 130 - .../x/text/unicode/norm/data10.0.0_test.go | 7424 -- .../x/text/unicode/norm/data11.0.0_test.go | 7444 -- .../x/text/unicode/norm/data9.0.0_test.go | 7409 -- .../x/text/unicode/norm/example_iter_test.go | 83 - .../x/text/unicode/norm/example_test.go | 27 - .../x/text/unicode/norm/forminfo.go | 278 - .../x/text/unicode/norm/forminfo_test.go | 54 - .../golang.org/x/text/unicode/norm/input.go | 109 - .../golang.org/x/text/unicode/norm/iter.go | 458 - .../x/text/unicode/norm/iter_test.go | 111 - .../x/text/unicode/norm/maketables.go | 986 - .../x/text/unicode/norm/normalize.go | 609 - .../x/text/unicode/norm/normalize_test.go | 1287 - .../x/text/unicode/norm/readwriter.go | 125 - .../x/text/unicode/norm/readwriter_test.go | 56 - .../x/text/unicode/norm/tables10.0.0.go | 7657 -- .../x/text/unicode/norm/tables11.0.0.go | 7693 -- .../x/text/unicode/norm/tables9.0.0.go | 7637 -- .../x/text/unicode/norm/transform.go | 88 - .../x/text/unicode/norm/transform_test.go | 110 - .../golang.org/x/text/unicode/norm/trie.go | 54 - .../golang.org/x/text/unicode/norm/triegen.go | 117 - .../x/text/unicode/norm/ucd_test.go | 275 - .../x/text/unicode/rangetable/gen.go | 115 - .../x/text/unicode/rangetable/merge.go | 260 - .../x/text/unicode/rangetable/merge_test.go | 184 - .../x/text/unicode/rangetable/rangetable.go | 70 - .../unicode/rangetable/rangetable_test.go | 55 - .../x/text/unicode/rangetable/tables10.0.0.go | 6378 -- .../x/text/unicode/rangetable/tables11.0.0.go | 7029 -- .../x/text/unicode/rangetable/tables9.0.0.go | 5737 -- .../x/text/unicode/runenames/example_test.go | 116 - .../x/text/unicode/runenames/gen.go | 162 - .../x/text/unicode/runenames/runenames.go | 48 - .../text/unicode/runenames/runenames_test.go | 52 - .../x/text/unicode/runenames/tables10.0.0.go | 15920 ---- .../x/text/unicode/runenames/tables11.0.0.go | 16234 ---- .../x/text/unicode/runenames/tables9.0.0.go | 15459 ---- .../golang.org/x/text/width/common_test.go | 92 - .../golang.org/x/text/width/example_test.go | 52 - .../vendor/golang.org/x/text/width/gen.go | 115 - .../golang.org/x/text/width/gen_common.go | 96 - .../golang.org/x/text/width/gen_trieval.go | 34 - .../golang.org/x/text/width/kind_string.go | 28 - .../golang.org/x/text/width/runes_test.go | 461 - .../golang.org/x/text/width/tables10.0.0.go | 1318 - .../golang.org/x/text/width/tables11.0.0.go | 1330 - .../golang.org/x/text/width/tables9.0.0.go | 1286 - .../golang.org/x/text/width/tables_test.go | 59 - .../golang.org/x/text/width/transform.go | 239 - .../golang.org/x/text/width/transform_test.go | 701 - .../vendor/golang.org/x/text/width/trieval.go | 30 - .../vendor/golang.org/x/text/width/width.go | 206 - .../fsnotify.v1/.github/ISSUE_TEMPLATE.md | 11 - .../.github/PULL_REQUEST_TEMPLATE.md | 8 - .../gopkg.in/fsnotify.v1/example_test.go | 42 - .../gopkg.in/fsnotify.v1/fsnotify_test.go | 70 - .../fsnotify.v1/inotify_poller_test.go | 229 - .../gopkg.in/fsnotify.v1/inotify_test.go | 449 - .../fsnotify.v1/integration_darwin_test.go | 147 - .../gopkg.in/fsnotify.v1/integration_test.go | 1237 - .../vendor/gopkg.in/tomb.v1/tomb_test.go | 114 - .../vendor/gopkg.in/yaml.v2/decode_test.go | 1334 - .../vendor/gopkg.in/yaml.v2/encode_test.go | 625 - .../gopkg.in/yaml.v2/example_embedded_test.go | 41 - .../vendor/gopkg.in/yaml.v2/suite_test.go | 12 - .../github.com/Masterminds/semver/.travis.yml | 0 .../Masterminds/semver/CHANGELOG.md | 0 .../github.com/Masterminds/semver/LICENSE.txt | 0 .../github.com/Masterminds/semver/Makefile | 0 .../github.com/Masterminds/semver/README.md | 0 .../Masterminds/semver/appveyor.yml | 0 .../Masterminds/semver/collection.go | 0 .../Masterminds/semver/constraints.go | 0 .../github.com/Masterminds/semver/doc.go | 0 .../github.com/Masterminds/semver/version.go | 0 .../github.com/blang/semver/.travis.yml | 14 +- .../github.com/blang/semver/LICENSE | 0 .../github.com/blang/semver/README.md | 6 +- .../github.com/blang/semver/json.go | 0 .../github.com/blang/semver/package.json | 0 .../github.com/blang/semver/range.go | 2 +- .../github.com/blang/semver/semver.go | 45 +- .../github.com/blang/semver/sort.go | 0 .../github.com/blang/semver/sql.go | 2 +- .../cloudfoundry/libbuildpack/LICENSE | 0 .../cloudfoundry/libbuildpack/NOTICE | 0 .../cloudfoundry/libbuildpack/README.md | 0 .../cloudfoundry/libbuildpack/command.go | 0 .../libbuildpack/cutlass/buffer.go | 0 .../cloudfoundry/libbuildpack/cutlass/cf.go | 10 +- .../libbuildpack/cutlass/docker.go | 214 + .../libbuildpack/cutlass/proxy.go | 69 + .../libbuildpack/cutlass/test_helpers.go | 104 +- .../libbuildpack/cutlass/utils.go | 0 .../libbuildpack/error_messages.go | 0 .../cloudfoundry/libbuildpack/go.mod | 1 - .../cloudfoundry/libbuildpack/go.sum | 2 - .../cloudfoundry/libbuildpack/hooks.go | 0 .../cloudfoundry/libbuildpack/installer.go | 6 + .../cloudfoundry/libbuildpack/json.go | 0 .../cloudfoundry/libbuildpack/logger.go | 0 .../cloudfoundry/libbuildpack/manifest.go | 14 +- .../libbuildpack/packager/README.md | 3 +- .../libbuildpack/packager/bindata.go | 0 .../libbuildpack/packager/cfbindata.go | 0 .../libbuildpack/packager/models.go | 0 .../libbuildpack/packager/packager.go | 0 .../libbuildpack/packager/scaffold.go | 0 .../libbuildpack/packager/summary.go | 0 .../cloudfoundry/libbuildpack/stager.go | 0 .../cloudfoundry/libbuildpack/stager_unix.go | 0 .../libbuildpack/stager_windows.go | 0 .../cloudfoundry/libbuildpack/util.go | 13 +- .../cloudfoundry/libbuildpack/versions.go | 0 .../cloudfoundry/libbuildpack/yaml.go | 0 .../github.com/elazarl/goproxy/.gitignore | 0 .../github.com/elazarl/goproxy/LICENSE | 0 .../github.com/elazarl/goproxy/README.md | 30 +- .../github.com/elazarl/goproxy/actions.go | 0 .../github.com/elazarl/goproxy/all.bash | 0 .../github.com/elazarl/goproxy/ca.pem | 0 .../github.com/elazarl/goproxy/certs.go | 0 .../github.com/elazarl/goproxy/chunked.go | 0 .../elazarl/goproxy/counterecryptor.go | 0 .../github.com/elazarl/goproxy/ctx.go | 2 +- .../github.com/elazarl/goproxy/dispatcher.go | 0 .../github.com/elazarl/goproxy/doc.go | 0 .../github.com/elazarl/goproxy/https.go | 12 +- .../github.com/elazarl/goproxy/key.pem | 0 .../github.com/elazarl/goproxy/proxy.go | 18 +- .../github.com/elazarl/goproxy/responses.go | 1 + .../github.com/elazarl/goproxy/signer.go | 3 +- .../github.com/hpcloud/tail/.gitignore | 0 .../github.com/hpcloud/tail/.travis.yml | 0 .../github.com/hpcloud/tail/CHANGES.md | 0 .../github.com/hpcloud/tail/Dockerfile | 0 .../github.com/hpcloud/tail/LICENSE.txt | 0 .../github.com/hpcloud/tail/Makefile | 0 .../github.com/hpcloud/tail/README.md | 0 .../github.com/hpcloud/tail/appveyor.yml | 0 .../hpcloud/tail/ratelimiter/Licence | 0 .../hpcloud/tail/ratelimiter/leakybucket.go | 0 .../hpcloud/tail/ratelimiter/memory.go | 0 .../hpcloud/tail/ratelimiter/storage.go | 0 .../github.com/hpcloud/tail/tail.go | 0 .../github.com/hpcloud/tail/tail_posix.go | 0 .../github.com/hpcloud/tail/tail_windows.go | 0 .../github.com/hpcloud/tail/util/util.go | 0 .../hpcloud/tail/watch/filechanges.go | 0 .../github.com/hpcloud/tail/watch/inotify.go | 0 .../hpcloud/tail/watch/inotify_tracker.go | 0 .../github.com/hpcloud/tail/watch/polling.go | 0 .../github.com/hpcloud/tail/watch/watch.go | 0 .../hpcloud/tail/winfile/winfile.go | 0 .../github.com/onsi/ginkgo/.gitignore | 0 .../github.com/onsi/ginkgo/.travis.yml | 0 .../github.com/onsi/ginkgo/CHANGELOG.md | 15 + .../github.com/onsi/ginkgo/CONTRIBUTING.md | 0 .../github.com/onsi/ginkgo/LICENSE | 0 .../github.com/onsi/ginkgo/README.md | 0 .../github.com/onsi/ginkgo/RELEASING.md | 0 .../github.com/onsi/ginkgo/config/config.go | 10 +- .../github.com/onsi/ginkgo/ginkgo_dsl.go | 2 +- .../internal/codelocation/code_location.go | 0 .../internal/containernode/container_node.go | 0 .../onsi/ginkgo/internal/failer/failer.go | 0 .../ginkgo/internal/leafnodes/benchmarker.go | 2 +- .../ginkgo/internal/leafnodes/interfaces.go | 0 .../onsi/ginkgo/internal/leafnodes/it_node.go | 0 .../ginkgo/internal/leafnodes/measure_node.go | 0 .../onsi/ginkgo/internal/leafnodes/runner.go | 0 .../ginkgo/internal/leafnodes/setup_nodes.go | 0 .../ginkgo/internal/leafnodes/suite_nodes.go | 0 .../synchronized_after_suite_node.go | 0 .../synchronized_before_suite_node.go | 0 .../onsi/ginkgo/internal/remote/aggregator.go | 12 +- .../internal/remote/forwarding_reporter.go | 0 .../internal/remote/output_interceptor.go | 0 .../remote/output_interceptor_unix.go | 0 .../internal/remote/output_interceptor_win.go | 0 .../onsi/ginkgo/internal/remote/server.go | 2 +- .../remote/syscall_dup_linux_arm64.go | 0 .../internal/remote/syscall_dup_solaris.go | 0 .../internal/remote/syscall_dup_unix.go | 0 .../onsi/ginkgo/internal/spec/spec.go | 10 +- .../onsi/ginkgo/internal/spec/specs.go | 4 +- .../internal/spec_iterator/index_computer.go | 0 .../spec_iterator/parallel_spec_iterator.go | 0 .../spec_iterator/serial_spec_iterator.go | 0 .../sharded_parallel_spec_iterator.go | 0 .../internal/spec_iterator/spec_iterator.go | 0 .../ginkgo/internal/specrunner/random_id.go | 0 .../ginkgo/internal/specrunner/spec_runner.go | 2 +- .../onsi/ginkgo/internal/suite/suite.go | 0 .../internal/testingtproxy/testing_t_proxy.go | 0 .../ginkgo/internal/writer/fake_writer.go | 0 .../onsi/ginkgo/internal/writer/writer.go | 0 .../onsi/ginkgo/reporters/default_reporter.go | 3 + .../onsi/ginkgo/reporters/fake_reporter.go | 0 .../onsi/ginkgo/reporters/junit_reporter.go | 25 +- .../onsi/ginkgo/reporters/reporter.go | 0 .../reporters/stenographer/console_logging.go | 0 .../stenographer/fake_stenographer.go | 0 .../reporters/stenographer/stenographer.go | 0 .../stenographer/support/go-colorable/LICENSE | 0 .../support/go-colorable/README.md | 0 .../support/go-colorable/colorable_others.go | 0 .../support/go-colorable/colorable_windows.go | 0 .../support/go-colorable/noncolorable.go | 0 .../stenographer/support/go-isatty/LICENSE | 0 .../stenographer/support/go-isatty/README.md | 0 .../stenographer/support/go-isatty/doc.go | 0 .../support/go-isatty/isatty_appengine.go | 0 .../support/go-isatty/isatty_bsd.go | 0 .../support/go-isatty/isatty_linux.go | 0 .../support/go-isatty/isatty_solaris.go | 0 .../support/go-isatty/isatty_windows.go | 0 .../ginkgo/reporters/teamcity_reporter.go | 9 +- .../onsi/ginkgo/types/code_location.go | 0 .../onsi/ginkgo/types/synchronization.go | 0 .../github.com/onsi/ginkgo/types/types.go | 2 +- .../github.com/onsi/gomega/.gitignore | 0 .../github.com/onsi/gomega/.travis.yml | 0 .../github.com/onsi/gomega/CHANGELOG.md | 24 + .../github.com/onsi/gomega/CONTRIBUTING.md | 0 .../github.com/onsi/gomega/LICENSE | 0 .../github.com/onsi/gomega/Makefile | 0 .../github.com/onsi/gomega/README.md | 0 .../github.com/onsi/gomega/RELEASING.md | 0 .../github.com/onsi/gomega/format/format.go | 6 +- .../github.com/onsi/gomega/go.mod | 0 .../github.com/onsi/gomega/go.sum | 0 .../github.com/onsi/gomega/gomega_dsl.go | 4 +- .../gomega/internal/assertion/assertion.go | 0 .../asyncassertion/async_assertion.go | 0 .../internal/oraclematcher/oracle_matcher.go | 0 .../testingtsupport/testing_t_support.go | 0 .../github.com/onsi/gomega/matchers.go | 0 .../github.com/onsi/gomega/matchers/and.go | 0 .../matchers/assignable_to_type_of_matcher.go | 0 .../onsi/gomega/matchers/attributes_slice.go | 0 .../onsi/gomega/matchers/be_a_directory.go | 0 .../onsi/gomega/matchers/be_a_regular_file.go | 0 .../gomega/matchers/be_an_existing_file.go | 0 .../onsi/gomega/matchers/be_closed_matcher.go | 0 .../gomega/matchers/be_element_of_matcher.go | 0 .../onsi/gomega/matchers/be_empty_matcher.go | 0 .../matchers/be_equivalent_to_matcher.go | 0 .../onsi/gomega/matchers/be_false_matcher.go | 0 .../onsi/gomega/matchers/be_identical_to.go | 0 .../onsi/gomega/matchers/be_nil_matcher.go | 0 .../gomega/matchers/be_numerically_matcher.go | 0 .../onsi/gomega/matchers/be_sent_matcher.go | 0 .../gomega/matchers/be_temporally_matcher.go | 0 .../onsi/gomega/matchers/be_true_matcher.go | 0 .../onsi/gomega/matchers/be_zero_matcher.go | 0 .../onsi/gomega/matchers/consist_of.go | 0 .../matchers/contain_element_matcher.go | 0 .../matchers/contain_substring_matcher.go | 0 .../onsi/gomega/matchers/equal_matcher.go | 0 .../onsi/gomega/matchers/have_cap_matcher.go | 0 .../onsi/gomega/matchers/have_key_matcher.go | 0 .../matchers/have_key_with_value_matcher.go | 0 .../onsi/gomega/matchers/have_len_matcher.go | 0 .../gomega/matchers/have_occurred_matcher.go | 0 .../gomega/matchers/have_prefix_matcher.go | 0 .../gomega/matchers/have_suffix_matcher.go | 0 .../gomega/matchers/match_error_matcher.go | 0 .../gomega/matchers/match_json_matcher.go | 0 .../gomega/matchers/match_regexp_matcher.go | 0 .../onsi/gomega/matchers/match_xml_matcher.go | 0 .../gomega/matchers/match_yaml_matcher.go | 0 .../github.com/onsi/gomega/matchers/not.go | 0 .../github.com/onsi/gomega/matchers/or.go | 0 .../onsi/gomega/matchers/panic_matcher.go | 0 .../onsi/gomega/matchers/receive_matcher.go | 0 .../matchers/semi_structured_data_support.go | 0 .../onsi/gomega/matchers/succeed_matcher.go | 0 .../goraph/bipartitegraph/bipartitegraph.go | 3 +- .../bipartitegraph/bipartitegraphmatching.go | 0 .../matchers/support/goraph/edge/edge.go | 0 .../matchers/support/goraph/node/node.go | 0 .../matchers/support/goraph/util/util.go | 0 .../onsi/gomega/matchers/type_support.go | 0 .../onsi/gomega/matchers/with_transform.go | 0 .../github.com/onsi/gomega/types/types.go | 0 vendor/github.com/pkg/errors/.gitignore | 24 + vendor/github.com/pkg/errors/.travis.yml | 15 + vendor/github.com/pkg/errors/LICENSE | 23 + vendor/github.com/pkg/errors/README.md | 52 + vendor/github.com/pkg/errors/appveyor.yml | 32 + vendor/github.com/pkg/errors/errors.go | 282 + vendor/github.com/pkg/errors/stack.go | 147 + .../github.com/tidwall/gjson/.travis.yml | 0 .../github.com/tidwall/gjson/LICENSE | 0 .../github.com/tidwall/gjson/README.md | 141 +- .../github.com/tidwall/gjson/gjson.go | 218 +- .../github.com/tidwall/gjson/gjson_gae.go | 10 +- vendor/github.com/tidwall/gjson/gjson_ngae.go | 73 + .../github.com/tidwall/gjson/logo.png | Bin .../github.com/tidwall/match/.travis.yml | 0 .../github.com/tidwall/match/LICENSE | 0 .../github.com/tidwall/match/README.md | 0 .../github.com/tidwall/match/match.go | 0 .../golang.org/x/net/AUTHORS | 0 .../golang.org/x/net/CONTRIBUTORS | 0 .../golang.org/x/net/LICENSE | 0 .../golang.org/x/net/PATENTS | 0 .../golang.org/x/net/html/atom/atom.go | 0 .../golang.org/x/net/html/atom/gen.go | 0 .../golang.org/x/net/html/atom/table.go | 0 .../golang.org/x/net/html/charset/charset.go | 0 .../golang.org/x/net/html/const.go | 0 .../golang.org/x/net/html/doc.go | 0 .../golang.org/x/net/html/doctype.go | 0 .../golang.org/x/net/html/entity.go | 0 .../golang.org/x/net/html/escape.go | 0 .../golang.org/x/net/html/foreign.go | 0 .../golang.org/x/net/html/node.go | 0 .../golang.org/x/net/html/parse.go | 0 .../golang.org/x/net/html/render.go | 0 .../golang.org/x/net/html/token.go | 0 .../golang.org/x/sys/AUTHORS | 0 .../golang.org/x/sys/CONTRIBUTORS | 0 .../golang.org/x/sys/LICENSE | 0 .../golang.org/x/sys/PATENTS | 0 .../golang.org/x/sys/unix/.gitignore | 0 .../golang.org/x/sys/unix/README.md | 0 .../golang.org/x/sys/unix/affinity_linux.go | 0 .../golang.org/x/sys/unix/aliases.go | 0 .../golang.org/x/sys/unix}/asm_aix_ppc64.s | 0 .../golang.org/x/sys/unix/asm_darwin_386.s | 0 .../golang.org/x/sys/unix/asm_darwin_amd64.s | 0 .../golang.org/x/sys/unix/asm_darwin_arm.s | 0 .../golang.org/x/sys/unix/asm_darwin_arm64.s | 0 .../x/sys/unix/asm_dragonfly_amd64.s | 0 .../golang.org/x/sys/unix/asm_freebsd_386.s | 0 .../golang.org/x/sys/unix/asm_freebsd_amd64.s | 0 .../golang.org/x/sys/unix/asm_freebsd_arm.s | 0 .../golang.org/x/sys/unix/asm_freebsd_arm64.s | 0 .../golang.org/x/sys/unix/asm_linux_386.s | 0 .../golang.org/x/sys/unix/asm_linux_amd64.s | 0 .../golang.org/x/sys/unix/asm_linux_arm.s | 0 .../golang.org/x/sys/unix/asm_linux_arm64.s | 0 .../golang.org/x/sys/unix/asm_linux_mips64x.s | 0 .../golang.org/x/sys/unix/asm_linux_mipsx.s | 0 .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 0 .../golang.org/x/sys/unix/asm_linux_s390x.s | 0 .../golang.org/x/sys/unix/asm_netbsd_386.s | 0 .../golang.org/x/sys/unix/asm_netbsd_amd64.s | 0 .../golang.org/x/sys/unix/asm_netbsd_arm.s | 0 .../golang.org/x/sys/unix/asm_netbsd_arm64.s | 0 .../golang.org/x/sys/unix/asm_openbsd_386.s | 0 .../golang.org/x/sys/unix/asm_openbsd_amd64.s | 0 .../golang.org/x/sys/unix/asm_openbsd_arm.s | 0 .../golang.org/x/sys/unix/asm_solaris_amd64.s | 0 .../golang.org/x/sys/unix/bluetooth_linux.go | 0 .../golang.org/x/sys/unix/cap_freebsd.go | 0 .../golang.org/x/sys/unix/constants.go | 0 .../golang.org/x/sys/unix/dev_aix_ppc.go | 0 .../golang.org/x/sys/unix/dev_aix_ppc64.go | 0 .../golang.org/x/sys/unix/dev_darwin.go | 0 .../golang.org/x/sys/unix/dev_dragonfly.go | 0 .../golang.org/x/sys/unix/dev_freebsd.go | 0 .../golang.org/x/sys/unix/dev_linux.go | 0 .../golang.org/x/sys/unix/dev_netbsd.go | 0 .../golang.org/x/sys/unix/dev_openbsd.go | 0 .../golang.org/x/sys/unix/dirent.go | 0 .../golang.org/x/sys/unix/endian_big.go | 0 .../golang.org/x/sys/unix/endian_little.go | 0 .../golang.org/x/sys/unix/env_unix.go | 0 .../x/sys/unix/errors_freebsd_386.go | 0 .../x/sys/unix/errors_freebsd_amd64.go | 0 .../x/sys/unix/errors_freebsd_arm.go | 0 .../golang.org/x/sys/unix/fcntl.go | 0 .../golang.org/x/sys/unix/fcntl_darwin.go | 0 .../x/sys/unix/fcntl_linux_32bit.go | 0 .../golang.org/x/sys/unix/gccgo.go | 0 .../golang.org/x/sys/unix/gccgo_c.c | 0 .../x/sys/unix/gccgo_linux_amd64.go | 0 .../golang.org/x/sys/unix/ioctl.go | 0 .../golang.org/x/sys/unix/mkall.sh | 21 +- .../golang.org/x/sys/unix/mkasm_darwin.go | 0 .../golang.org/x/sys/unix/mkerrors.sh | 7 +- .../golang.org/x/sys/unix/mkpost.go | 16 - .../golang.org/x/sys/unix/mksyscall.go | 0 .../x/sys/unix/mksyscall_aix_ppc.go | 0 .../x/sys/unix/mksyscall_aix_ppc64.go | 0 .../x/sys/unix/mksyscall_solaris.go | 0 .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 265 + .../golang.org/x/sys/unix/mksysnum.go | 0 .../golang.org/x/sys/unix/openbsd_pledge.go | 3 + .../golang.org/x/sys/unix/openbsd_unveil.go | 2 + .../golang.org/x/sys/unix/pagesize_unix.go | 0 .../golang.org/x/sys/unix/race.go | 0 .../golang.org/x/sys/unix/race0.go | 0 .../golang.org/x/sys/unix/sockcmsg_linux.go | 0 .../golang.org/x/sys/unix/sockcmsg_unix.go | 8 +- .../golang.org/x/sys/unix/str.go | 0 .../golang.org/x/sys/unix/syscall.go | 1 + .../golang.org/x/sys/unix/syscall_aix.go | 8 +- .../golang.org/x/sys/unix/syscall_aix_ppc.go | 16 - .../x/sys/unix/syscall_aix_ppc64.go | 23 +- .../golang.org/x/sys/unix/syscall_bsd.go | 0 .../golang.org/x/sys/unix/syscall_darwin.go | 0 .../x/sys/unix/syscall_darwin_386.go | 0 .../x/sys/unix/syscall_darwin_amd64.go | 0 .../x/sys/unix/syscall_darwin_arm.go | 0 .../x/sys/unix/syscall_darwin_arm64.go | 0 .../x/sys/unix/syscall_darwin_libSystem.go | 0 .../x/sys/unix/syscall_dragonfly.go | 0 .../x/sys/unix/syscall_dragonfly_amd64.go | 0 .../golang.org/x/sys/unix/syscall_freebsd.go | 32 +- .../x/sys/unix/syscall_freebsd_386.go | 0 .../x/sys/unix/syscall_freebsd_amd64.go | 0 .../x/sys/unix/syscall_freebsd_arm.go | 0 .../x/sys/unix/syscall_freebsd_arm64.go | 0 .../golang.org/x/sys/unix/syscall_linux.go | 75 +- .../x/sys/unix/syscall_linux_386.go | 0 .../x/sys/unix/syscall_linux_amd64.go | 0 .../x/sys/unix/syscall_linux_amd64_gc.go | 0 .../x/sys/unix/syscall_linux_arm.go | 13 - .../x/sys/unix/syscall_linux_arm64.go | 0 .../golang.org/x/sys/unix/syscall_linux_gc.go | 0 .../x/sys/unix/syscall_linux_gc_386.go | 0 .../x/sys/unix/syscall_linux_gccgo_386.go | 0 .../x/sys/unix/syscall_linux_gccgo_arm.go | 0 .../x/sys/unix/syscall_linux_mips64x.go | 0 .../x/sys/unix/syscall_linux_mipsx.go | 0 .../x/sys/unix/syscall_linux_ppc64x.go | 0 .../x/sys/unix/syscall_linux_riscv64.go | 0 .../x/sys/unix/syscall_linux_s390x.go | 0 .../x/sys/unix/syscall_linux_sparc64.go | 0 .../golang.org/x/sys/unix/syscall_netbsd.go | 0 .../x/sys/unix/syscall_netbsd_386.go | 0 .../x/sys/unix/syscall_netbsd_amd64.go | 0 .../x/sys/unix/syscall_netbsd_arm.go | 0 .../x/sys/unix/syscall_netbsd_arm64.go | 0 .../golang.org/x/sys/unix/syscall_openbsd.go | 0 .../x/sys/unix/syscall_openbsd_386.go | 0 .../x/sys/unix/syscall_openbsd_amd64.go | 0 .../x/sys/unix/syscall_openbsd_arm.go | 0 .../golang.org/x/sys/unix/syscall_solaris.go | 0 .../x/sys/unix/syscall_solaris_amd64.go | 0 .../golang.org/x/sys/unix/syscall_unix.go | 0 .../golang.org/x/sys/unix/syscall_unix_gc.go | 0 .../x/sys/unix/syscall_unix_gc_ppc64x.go | 0 .../golang.org/x/sys/unix/timestruct.go | 0 .../golang.org/x/sys/unix/types_aix.go | 27 +- .../golang.org/x/sys/unix/types_darwin.go | 0 .../golang.org/x/sys/unix/types_dragonfly.go | 0 .../golang.org/x/sys/unix/types_freebsd.go | 0 .../golang.org/x/sys/unix/types_netbsd.go | 0 .../golang.org/x/sys/unix/types_openbsd.go | 0 .../golang.org/x/sys/unix/types_solaris.go | 0 .../golang.org/x/sys/unix/xattr_bsd.go | 0 .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 0 .../x/sys/unix/zerrors_aix_ppc64.go | 0 .../x/sys/unix/zerrors_darwin_386.go | 0 .../x/sys/unix/zerrors_darwin_amd64.go | 0 .../x/sys/unix/zerrors_darwin_arm.go | 0 .../x/sys/unix/zerrors_darwin_arm64.go | 0 .../x/sys/unix/zerrors_dragonfly_amd64.go | 0 .../x/sys/unix/zerrors_freebsd_386.go | 0 .../x/sys/unix/zerrors_freebsd_amd64.go | 0 .../x/sys/unix/zerrors_freebsd_arm.go | 0 .../x/sys/unix/zerrors_freebsd_arm64.go | 0 .../x/sys/unix/zerrors_linux_386.go | 110 - .../x/sys/unix/zerrors_linux_amd64.go | 110 - .../x/sys/unix/zerrors_linux_arm.go | 110 - .../x/sys/unix/zerrors_linux_arm64.go | 110 - .../x/sys/unix/zerrors_linux_mips.go | 110 - .../x/sys/unix/zerrors_linux_mips64.go | 110 - .../x/sys/unix/zerrors_linux_mips64le.go | 110 - .../x/sys/unix/zerrors_linux_mipsle.go | 110 - .../x/sys/unix/zerrors_linux_ppc64.go | 110 - .../x/sys/unix/zerrors_linux_ppc64le.go | 110 - .../x/sys/unix/zerrors_linux_riscv64.go | 110 - .../x/sys/unix/zerrors_linux_s390x.go | 110 - .../x/sys/unix/zerrors_linux_sparc64.go | 110 - .../x/sys/unix/zerrors_netbsd_386.go | 0 .../x/sys/unix/zerrors_netbsd_amd64.go | 0 .../x/sys/unix/zerrors_netbsd_arm.go | 0 .../x/sys/unix/zerrors_netbsd_arm64.go | 0 .../x/sys/unix/zerrors_openbsd_386.go | 0 .../x/sys/unix/zerrors_openbsd_amd64.go | 0 .../x/sys/unix/zerrors_openbsd_arm.go | 0 .../x/sys/unix/zerrors_solaris_amd64.go | 0 .../golang.org/x/sys/unix/zptrace386_linux.go | 0 .../golang.org/x/sys/unix/zptracearm_linux.go | 0 .../x/sys/unix/zptracemips_linux.go | 0 .../x/sys/unix/zptracemipsle_linux.go | 0 .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 10 +- .../x/sys/unix/zsyscall_aix_ppc64.go | 10 +- .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 4 +- .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 4 +- .../x/sys/unix/zsyscall_darwin_386.1_11.go | 0 .../x/sys/unix/zsyscall_darwin_386.go | 0 .../x/sys/unix/zsyscall_darwin_386.s | 0 .../x/sys/unix/zsyscall_darwin_amd64.1_11.go | 0 .../x/sys/unix/zsyscall_darwin_amd64.go | 0 .../x/sys/unix/zsyscall_darwin_amd64.s | 0 .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 0 .../x/sys/unix/zsyscall_darwin_arm.go | 0 .../x/sys/unix/zsyscall_darwin_arm.s | 0 .../x/sys/unix/zsyscall_darwin_arm64.1_11.go | 0 .../x/sys/unix/zsyscall_darwin_arm64.go | 0 .../x/sys/unix/zsyscall_darwin_arm64.s | 0 .../x/sys/unix/zsyscall_dragonfly_amd64.go | 0 .../x/sys/unix/zsyscall_freebsd_386.go | 0 .../x/sys/unix/zsyscall_freebsd_amd64.go | 0 .../x/sys/unix/zsyscall_freebsd_arm.go | 0 .../x/sys/unix/zsyscall_freebsd_arm64.go | 0 .../x/sys/unix/zsyscall_linux_386.go | 8 +- .../x/sys/unix/zsyscall_linux_amd64.go | 8 +- .../x/sys/unix/zsyscall_linux_arm.go | 23 +- .../x/sys/unix/zsyscall_linux_arm64.go | 8 +- .../x/sys/unix/zsyscall_linux_mips.go | 8 +- .../x/sys/unix/zsyscall_linux_mips64.go | 8 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 8 +- .../x/sys/unix/zsyscall_linux_mipsle.go | 8 +- .../x/sys/unix/zsyscall_linux_ppc64.go | 8 +- .../x/sys/unix/zsyscall_linux_ppc64le.go | 8 +- .../x/sys/unix/zsyscall_linux_riscv64.go | 8 +- .../x/sys/unix/zsyscall_linux_s390x.go | 8 +- .../x/sys/unix/zsyscall_linux_sparc64.go | 8 +- .../x/sys/unix/zsyscall_netbsd_386.go | 0 .../x/sys/unix/zsyscall_netbsd_amd64.go | 0 .../x/sys/unix/zsyscall_netbsd_arm.go | 0 .../x/sys/unix/zsyscall_netbsd_arm64.go | 0 .../x/sys/unix/zsyscall_openbsd_386.go | 0 .../x/sys/unix/zsyscall_openbsd_amd64.go | 0 .../x/sys/unix/zsyscall_openbsd_arm.go | 0 .../x/sys/unix/zsyscall_solaris_amd64.go | 0 .../x/sys/unix/zsysctl_openbsd_386.go | 2 - .../x/sys/unix/zsysctl_openbsd_amd64.go | 2 +- .../x/sys/unix/zsysctl_openbsd_arm.go | 4 +- .../x/sys/unix/zsysnum_darwin_386.go | 0 .../x/sys/unix/zsysnum_darwin_amd64.go | 0 .../x/sys/unix/zsysnum_darwin_arm.go | 0 .../x/sys/unix/zsysnum_darwin_arm64.go | 0 .../x/sys/unix/zsysnum_dragonfly_amd64.go | 0 .../x/sys/unix/zsysnum_freebsd_386.go | 0 .../x/sys/unix/zsysnum_freebsd_amd64.go | 0 .../x/sys/unix/zsysnum_freebsd_arm.go | 0 .../x/sys/unix/zsysnum_freebsd_arm64.go | 0 .../x/sys/unix/zsysnum_linux_386.go | 392 + .../x/sys/unix/zsysnum_linux_amd64.go | 4 - .../x/sys/unix/zsysnum_linux_arm.go | 364 + .../x/sys/unix/zsysnum_linux_arm64.go | 4 - .../x/sys/unix/zsysnum_linux_mips.go | 377 + .../x/sys/unix/zsysnum_linux_mips64.go | 4 - .../x/sys/unix/zsysnum_linux_mips64le.go | 4 - .../x/sys/unix/zsysnum_linux_mipsle.go | 377 + .../x/sys/unix/zsysnum_linux_ppc64.go | 15 - .../x/sys/unix/zsysnum_linux_ppc64le.go | 15 - .../x/sys/unix/zsysnum_linux_riscv64.go | 4 - .../x/sys/unix/zsysnum_linux_s390x.go | 18 - .../x/sys/unix/zsysnum_linux_sparc64.go | 19 - .../x/sys/unix/zsysnum_netbsd_386.go | 0 .../x/sys/unix/zsysnum_netbsd_amd64.go | 0 .../x/sys/unix/zsysnum_netbsd_arm.go | 0 .../x/sys/unix/zsysnum_netbsd_arm64.go | 0 .../x/sys/unix/zsysnum_openbsd_386.go | 0 .../x/sys/unix/zsysnum_openbsd_amd64.go | 0 .../x/sys/unix/zsysnum_openbsd_arm.go | 0 .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 45 +- .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 46 +- .../x/sys/unix/ztypes_darwin_386.go | 36 +- .../x/sys/unix/ztypes_darwin_amd64.go | 38 +- .../x/sys/unix/ztypes_darwin_arm.go | 36 +- .../x/sys/unix/ztypes_darwin_arm64.go | 38 +- .../x/sys/unix/ztypes_dragonfly_amd64.go | 38 +- .../x/sys/unix/ztypes_freebsd_386.go | 82 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 72 +- .../x/sys/unix/ztypes_freebsd_arm.go | 72 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 72 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 334 - .../x/sys/unix/ztypes_linux_amd64.go | 334 - .../golang.org/x/sys/unix/ztypes_linux_arm.go | 334 - .../x/sys/unix/ztypes_linux_arm64.go | 334 - .../x/sys/unix/ztypes_linux_mips.go | 334 - .../x/sys/unix/ztypes_linux_mips64.go | 334 - .../x/sys/unix/ztypes_linux_mips64le.go | 334 - .../x/sys/unix/ztypes_linux_mipsle.go | 334 - .../x/sys/unix/ztypes_linux_ppc64.go | 334 - .../x/sys/unix/ztypes_linux_ppc64le.go | 334 - .../x/sys/unix/ztypes_linux_riscv64.go | 334 - .../x/sys/unix/ztypes_linux_s390x.go | 334 - .../x/sys/unix/ztypes_linux_sparc64.go | 334 - .../x/sys/unix/ztypes_netbsd_386.go | 34 +- .../x/sys/unix/ztypes_netbsd_amd64.go | 40 +- .../x/sys/unix/ztypes_netbsd_arm.go | 40 +- .../x/sys/unix/ztypes_netbsd_arm64.go | 40 +- .../x/sys/unix/ztypes_openbsd_386.go | 0 .../x/sys/unix/ztypes_openbsd_amd64.go | 0 .../x/sys/unix/ztypes_openbsd_arm.go | 0 .../x/sys/unix/ztypes_solaris_amd64.go | 0 .../golang.org/x/text/AUTHORS | 0 .../golang.org/x/text/CONTRIBUTORS | 0 .../golang.org/x/text/LICENSE | 0 .../golang.org/x/text/PATENTS | 0 .../x/text/encoding/charmap/charmap.go | 0 .../x/text/encoding/charmap/maketables.go | 0 .../x/text/encoding/charmap/tables.go | 0 .../golang.org/x/text/encoding/encoding.go | 2 +- .../x/text/encoding/htmlindex/gen.go | 0 .../x/text/encoding/htmlindex/htmlindex.go | 0 .../x/text/encoding/htmlindex/map.go | 0 .../x/text/encoding/htmlindex/tables.go | 1 - .../text/encoding/internal/identifier/gen.go | 7 +- .../internal/identifier/identifier.go | 2 +- .../text/encoding/internal/identifier/mib.go | 96 +- .../x/text/encoding/internal/internal.go | 0 .../x/text/encoding/japanese/all.go | 0 .../x/text/encoding/japanese/eucjp.go | 0 .../x/text/encoding/japanese/iso2022jp.go | 0 .../x/text/encoding/japanese/maketables.go | 4 +- .../x/text/encoding/japanese/shiftjis.go | 0 .../x/text/encoding/japanese/tables.go | 0 .../x/text/encoding/korean/euckr.go | 0 .../x/text/encoding/korean/maketables.go | 0 .../x/text/encoding/korean/tables.go | 0 .../x/text/encoding/simplifiedchinese/all.go | 0 .../x/text/encoding/simplifiedchinese/gbk.go | 0 .../encoding/simplifiedchinese/hzgb2312.go | 0 .../encoding/simplifiedchinese/maketables.go | 0 .../text/encoding/simplifiedchinese/tables.go | 0 .../text/encoding/traditionalchinese/big5.go | 0 .../encoding/traditionalchinese/maketables.go | 0 .../encoding/traditionalchinese/tables.go | 0 .../x/text/encoding/unicode/override.go | 0 .../x/text/encoding/unicode/unicode.go | 2 +- .../golang.org/x/text/internal/tag/tag.go | 0 .../internal/utf8internal/utf8internal.go | 0 vendor/golang.org/x/text/language/Makefile | 16 + .../golang.org/x/text}/language/common.go | 12 +- .../golang.org/x/text/language/coverage.go | 34 +- .../golang.org/x/text/language/doc.go | 0 .../golang.org/x/text}/language/gen.go | 228 +- .../golang.org/x/text}/language/gen_common.go | 12 +- .../golang.org/x/text/language/gen_index.go | 162 + .../golang.org/x/text/language/go1_1.go | 0 .../golang.org/x/text/language/go1_2.go | 0 vendor/golang.org/x/text/language/index.go | 783 + vendor/golang.org/x/text/language/language.go | 907 + .../golang.org/x/text}/language/lookup.go | 120 +- .../golang.org/x/text/language/match.go | 422 +- .../golang.org/x/text}/language/parse.go | 383 +- .../golang.org/x/text}/language/tables.go | 645 +- vendor/golang.org/x/text/language/tags.go | 143 + .../golang.org/x/text/runes/cond.go | 0 .../golang.org/x/text/runes/runes.go | 0 .../golang.org/x/text/transform/transform.go | 6 +- .../gopkg.in/fsnotify.v1/.editorconfig | 0 .../gopkg.in/fsnotify.v1/.gitignore | 0 .../gopkg.in/fsnotify.v1/.travis.yml | 0 .../gopkg.in/fsnotify.v1/AUTHORS | 0 .../gopkg.in/fsnotify.v1/CHANGELOG.md | 0 .../gopkg.in/fsnotify.v1/CONTRIBUTING.md | 0 .../gopkg.in/fsnotify.v1/LICENSE | 0 .../gopkg.in/fsnotify.v1/README.md | 0 .../gopkg.in/fsnotify.v1/fen.go | 0 .../gopkg.in/fsnotify.v1/fsnotify.go | 0 .../gopkg.in/fsnotify.v1/inotify.go | 0 .../gopkg.in/fsnotify.v1/inotify_poller.go | 0 .../gopkg.in/fsnotify.v1/kqueue.go | 0 .../gopkg.in/fsnotify.v1/open_mode_bsd.go | 0 .../gopkg.in/fsnotify.v1/open_mode_darwin.go | 0 .../gopkg.in/fsnotify.v1/windows.go | 0 .../gopkg.in/tomb.v1/LICENSE | 0 .../gopkg.in/tomb.v1/README.md | 0 .../gopkg.in/tomb.v1/tomb.go | 0 .../gopkg.in/yaml.v2/.travis.yml | 0 .../gopkg.in/yaml.v2/LICENSE | 0 .../gopkg.in/yaml.v2/LICENSE.libyaml | 0 .../vendor => vendor}/gopkg.in/yaml.v2/NOTICE | 0 .../gopkg.in/yaml.v2/README.md | 0 .../gopkg.in/yaml.v2/apic.go | 0 .../gopkg.in/yaml.v2/decode.go | 0 .../gopkg.in/yaml.v2/emitterc.go | 0 .../gopkg.in/yaml.v2/encode.go | 0 .../vendor => vendor}/gopkg.in/yaml.v2/go.mod | 0 .../gopkg.in/yaml.v2/parserc.go | 0 .../gopkg.in/yaml.v2/readerc.go | 0 .../gopkg.in/yaml.v2/resolve.go | 0 .../gopkg.in/yaml.v2/scannerc.go | 0 .../gopkg.in/yaml.v2/sorter.go | 0 .../gopkg.in/yaml.v2/writerc.go | 0 .../gopkg.in/yaml.v2/yaml.go | 0 .../gopkg.in/yaml.v2/yamlh.go | 0 .../gopkg.in/yaml.v2/yamlprivateh.go | 0 vendor/modules.txt | 82 + 2396 files changed, 7125 insertions(+), 736170 deletions(-) create mode 100644 go.mod create mode 100644 go.sum delete mode 100644 sha.yml delete mode 100644 src/imagemagick/vendor/github.com/Masterminds/semver/benchmark_test.go delete mode 100644 src/imagemagick/vendor/github.com/Masterminds/semver/collection_test.go delete mode 100644 src/imagemagick/vendor/github.com/Masterminds/semver/constraints_test.go delete mode 100644 src/imagemagick/vendor/github.com/Masterminds/semver/version_test.go delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/.gx/lastpubver delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/examples/main.go delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/go.mod delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/json_test.go delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/range_test.go delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/semver_test.go delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/sort_test.go delete mode 100644 src/imagemagick/vendor/github.com/blang/semver/sql_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/ansicleaner/buffer.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/data.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/language.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/modify.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/tests.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/utils.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/command_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/docker.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/proxy.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/source.txt delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/standard/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/source.txt delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/standard/manifest.yml delete mode 120000 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_source.txt delete mode 120000 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_standard delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/maliciousGlobalSymlink.tar.gz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/duplicate/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch_cached/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/no-deps/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/stacks/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/path_traversal.tgz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/source.txt delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/symlink.tgz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/thing.tgz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/hooks_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/installer_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/json_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/libbuildpack_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/logger_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/manifest_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/mocks_hooks_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/bin/filename delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager/main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/filename delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/ignoredfile delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/hi.sh delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/otherfile delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/filename delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/ignoredfile delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/hi.sh delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/otherfile delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_default_fs3/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/bin/filename delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/hi.sh delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/sha.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.lock delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.toml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modules/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/no_dependencies/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/filename delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/ignoredfile delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/otherfile delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/filename delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/ignoredfile delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/hi.sh delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/otherfile delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/random_dir/.gitkeep delete mode 120000 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/sym_dir delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/models_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.envrc delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.gitignore delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/README.md delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/VERSION delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/compile delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/detect delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/finalize delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/release delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/supply delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/.gitkeep delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/simple_test/some_file.txt delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/manifest.yml delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/brats.sh delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/build.sh delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_go.sh delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_tools.sh delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/integration.sh delete mode 100755 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/unit.sh delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/Gopkg.toml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_cli_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_debug.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_integration_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_simple_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_cli_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/summary_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/detect/main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/finalize/main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/release/main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/supply/main.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_detector_shims_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_shims_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/shims_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/VERSION delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/bpA.tgz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/bpB.tgz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/lifecycle-bundle.tgz delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/manifest.yml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/order.toml delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/utils.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/mocks_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/stager_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_unix_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_windows_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/util_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/versions_test.go delete mode 100644 src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/yaml_test.go delete mode 100755 src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl-gen.sh delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl.cnf delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/counterecryptor_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/cert.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/main.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/ext/image/image.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/proxy_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/signer_test.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/test_data/baby.jpg delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/test_data/football.png delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/test_data/panda.png delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/transport/roundtripper.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/transport/transport.go delete mode 100644 src/imagemagick/vendor/github.com/elazarl/goproxy/transport/util.go delete mode 100644 src/imagemagick/vendor/github.com/google/subcommands/CONTRIBUTING delete mode 100644 src/imagemagick/vendor/github.com/google/subcommands/LICENSE delete mode 100644 src/imagemagick/vendor/github.com/google/subcommands/README.md delete mode 100644 src/imagemagick/vendor/github.com/google/subcommands/go.mod delete mode 100644 src/imagemagick/vendor/github.com/google/subcommands/subcommands.go delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Godeps.json delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Readme delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/.gitignore delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/Makefile delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/gotail.go delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket_test.go delete mode 100644 src/imagemagick/vendor/github.com/hpcloud/tail/tail_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/build_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/ginkgo_ast_nodes.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/test_finder.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testing_t_rewriter.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/help_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_unix.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_windows.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/main.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/notifications.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args_old.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/log_writer.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/run_result.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go16.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/unfocus_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/version_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta_tracker.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hashes.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/suite.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/convert_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/coverage_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/fail_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/flags_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/progress_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/run_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/skip_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/tags_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/test_description_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/integration/watch_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/format/format_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/format/format_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/gbuffer_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/build.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/build_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/gexec_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/session.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gexec/session_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/handlers.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/gstruct_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/gstruct/types.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/internal/testingtsupport/testing_t_support_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/and_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_directory_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_regular_file_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_an_existing_file_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_closed_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_empty_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_false_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_identical_to_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_nil_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_sent_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_true_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/consist_of_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_element_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/equal_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_cap_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_len_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_prefix_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_suffix_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_error_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_json_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_regexp_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_xml_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/matcher_tests_suite_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/not_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/or_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/panic_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/receive_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/succeed_matcher_test.go delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_01.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_02.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_03.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_04.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_05.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_06.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_07.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_08.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_09.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_10.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_11.xml delete mode 100644 src/imagemagick/vendor/github.com/onsi/gomega/matchers/with_transform_test.go delete mode 100644 src/imagemagick/vendor/github.com/tidwall/gjson/gjson_ngae.go delete mode 100644 src/imagemagick/vendor/github.com/tidwall/gjson/gjson_test.go delete mode 100644 src/imagemagick/vendor/github.com/tidwall/match/match_test.go delete mode 100644 src/imagemagick/vendor/github.com/tidwall/pretty/.travis.yml delete mode 100644 src/imagemagick/vendor/github.com/tidwall/pretty/LICENSE delete mode 100644 src/imagemagick/vendor/github.com/tidwall/pretty/README.md delete mode 100644 src/imagemagick/vendor/github.com/tidwall/pretty/pretty.go delete mode 100644 src/imagemagick/vendor/github.com/tidwall/pretty/pretty_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/.gitattributes delete mode 100644 src/imagemagick/vendor/golang.org/x/net/.gitignore delete mode 100644 src/imagemagick/vendor/golang.org/x/net/CONTRIBUTING.md delete mode 100644 src/imagemagick/vendor/golang.org/x/net/README.md delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/asm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/constants.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/instructions.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/instructions_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/setter.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_aluop_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_bpf_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_extension_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_instructions.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_jump_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_load_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_ret_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_scratch_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/bpf/vm_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/codereview.cfg delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/context.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/context_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/go17.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/go19.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/pre_go17.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/pre_go19.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/context/withtimeout_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/dict/dict.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/go.mod delete mode 100644 src/imagemagick/vendor/golang.org/x/net/go.sum delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/atom/atom_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/atom/table_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/charset_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/README delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/entity_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/escape_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/node_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/parse_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/render_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/go/issue_30600_parse_panics_in_cell_mode.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/go/issue_30961_error_nested_unknown_tag_types.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/go/select.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/go/template.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/go1.html delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/README delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/adoption01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/comments01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/doctype01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/entities01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/entities02.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/html5test-com.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/inbody01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/isindex.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/pending-spec-changes.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/plain-text-unsafe.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/ruby.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/scriptdata01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/scripted/adoption01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/scripted/webkit01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tables01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/template.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests1.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests10.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests11.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests12.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests14.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests15.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests16.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests17.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests18.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests19.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests2.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests20.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests21.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests22.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests23.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests24.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests25.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests26.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests3.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests4.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests5.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests6.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests7.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests8.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests9.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tests_innerHTML_1.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/tricky01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/webkit01.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/testdata/webkit/webkit02.dat delete mode 100644 src/imagemagick/vendor/golang.org/x/net/html/token_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpguts/guts.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpguts/httplex.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpguts/httplex_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpproxy/export_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpproxy/go19_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpproxy/proxy.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http/httpproxy/proxy_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/.gitignore delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/Dockerfile delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/Makefile delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/README delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/ciphers.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/ciphers_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/client_conn_pool.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/databuffer.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/databuffer_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/errors.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/errors_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/flow.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/flow_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/frame.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/frame_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/go111.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/gotrack.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/gotrack_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2c/h2c.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2c/h2c_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/.gitignore delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/Dockerfile delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/Makefile delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/README delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/deployment-prod.yaml delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/go.mod delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/go.sum delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/h2demo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/rootCA.key delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/rootCA.pem delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/rootCA.srl delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/server.crt delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/server.key delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/service.yaml delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2demo/tmpl.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2i/README.md delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/h2i/h2i.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/headermap.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/encode.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/encode_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/hpack.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/hpack_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/huffman.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/hpack/tables_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/http2.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/http2_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/not_go111.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/pipe.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/pipe_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/server.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/server_push_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/server_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/testdata/draft-ietf-httpbis-http2.xml delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/transport.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/transport_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/write.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/writesched.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/writesched_priority.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/writesched_priority_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/writesched_random.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/writesched_random_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/writesched_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/http2/z_spec_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/diag_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/dstunreach.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/echo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/endpoint.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/extension.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/extension_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/helper_posix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/interface.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/ipv4.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/ipv4_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/ipv6.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/listen_posix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/listen_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/message.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/message_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/messagebody.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/mpls.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/multipart.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/multipart_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/packettoobig.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/paramprob.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/sys_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/icmp/timeexceeded.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/idna10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/idna9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/idna_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/punycode.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/punycode_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/trie.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/idna/trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/iana/const.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/iana/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/cmsghdr.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/cmsghdr_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_32bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/cmsghdr_linux_64bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/cmsghdr_solaris_64bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_aix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/defs_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/empty.s delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/error_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/error_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/iovec_32bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/iovec_64bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/iovec_solaris_64bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/iovec_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/mmsghdr_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/mmsghdr_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_bsdvar.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_linux_32bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_linux_64bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_solaris_64bit.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/msghdr_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/rawconn.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/rawconn_mmsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/rawconn_msg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/rawconn_nommsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/socket.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/socket_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_bsdvar.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_const_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_go1_11_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linkname.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_386.s delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_mips.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_mips64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_mips64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_mipsle.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_ppc64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_riscv64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_linux_s390x.s delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_posix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_solaris_amd64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/sys_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socks/client.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socks/dial_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/socks/socks.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/sockstest/server.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/sockstest/server_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/timeseries/timeseries.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/internal/timeseries/timeseries_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/batch.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/bpf_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control_pktinfo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/control_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_aix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/defs_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/dgramopt.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/endpoint.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/genericopt.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/header.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/header_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/helper.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/helper_posix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/helper_stub_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/iana.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/icmp.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/icmp_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/icmp_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/icmp_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/multicast_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/multicastlistener_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/multicastsockopt_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/packet.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/payload.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/payload_cmsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/payload_nocmsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/readwrite_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sockopt.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sockopt_posix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sockopt_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_aix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_asmreq.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_asmreq_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_asmreqn.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_asmreqn_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_bpf.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_bpf_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_ssmreq.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_ssmreq_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/sys_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/unicast_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/unicastsockopt_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_aix_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_freebsd_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_freebsd_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_freebsd_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_mips.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_mips64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_mips64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_mipsle.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_ppc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_ppc64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_riscv64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_linux_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv4/zsys_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/batch.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/bpf_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control_rfc2292_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/control_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_aix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/defs_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/dgramopt.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/endpoint.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/genericopt.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/header.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/header_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/helper.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/helper_posix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/helper_stub_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/helper_unix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/helper_windows_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/iana.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/icmp_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/mocktransponder_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/multicast_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/multicastlistener_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/multicastsockopt_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/payload.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/payload_cmsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/payload_nocmsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/readwrite_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sockopt.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sockopt_posix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sockopt_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sockopt_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_aix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_asmreq.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_asmreq_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_bpf.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_bpf_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_bsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_ssmreq.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/sys_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/unicast_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/unicastsockopt_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_aix_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_freebsd_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_freebsd_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_freebsd_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_mips.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_mips64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_mips64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_ppc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_ppc64le.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_riscv64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_linux_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/ipv6/zsys_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/address.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/address_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/binary.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/defs_solaris.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/lif.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/link.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/link_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/sys.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/sys_solaris_amd64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/syscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/lif/zsys_solaris_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/nettest/conntest.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/nettest/conntest_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/nettest/nettest.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/nettest/nettest_stub.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/nettest/nettest_unix.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/nettest/nettest_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/netutil/helper_stub_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/netutil/helper_unix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/netutil/helper_windows_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/netutil/listen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/netutil/listen_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/dial.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/dial_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/direct.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/per_host.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/per_host_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/proxy.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/proxy_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/proxy/socks5.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/publicsuffix/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/publicsuffix/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/publicsuffix/list.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/publicsuffix/list_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/publicsuffix/table.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/publicsuffix/table_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/address.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/address_darwin_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/address_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/binary.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/defs_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/defs_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/defs_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/defs_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/defs_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/empty.s delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/interface.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/interface_announce.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/interface_classic.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/interface_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/interface_multicast.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/interface_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/message.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/message_darwin_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/message_freebsd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/message_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/route.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/route_classic.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/route_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/route_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/sys.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/sys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/sys_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/sys_freebsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/sys_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/sys_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/syscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/syscall_go1_11_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/syscall_go1_12_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_dragonfly.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_freebsd_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_freebsd_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_freebsd_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_freebsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_netbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/route/zsys_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/trace/events.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/trace/histogram.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/trace/histogram_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/trace/trace.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/trace/trace_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/file.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/file_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/if.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/if_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/README delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/atom_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/marshal.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/marshal_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/read.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/read_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/typeinfo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/xml.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/internal/xml/xml_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/litmus_test_server.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/lock.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/lock_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/prop.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/prop_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/webdav.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/webdav_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/xml.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/webdav/xml_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/client.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/dial.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/dial_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/exampledial_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/examplehandler_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/hybi.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/hybi_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/server.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/websocket.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/websocket/websocket_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/xsrftoken/xsrf.go delete mode 100644 src/imagemagick/vendor/golang.org/x/net/xsrftoken/xsrf_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/.gitattributes delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/.gitignore delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/CONTRIBUTING.md delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/README.md delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/codereview.cfg delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/byteorder.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_gccgo.c delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_gccgo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_linux.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_mips64x.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_mipsx.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_s390x.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_wasm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_x86.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/cpu_x86.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/go.mod delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/asm.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/asm_plan9_386.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/asm_plan9_arm.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/const_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/dir_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/env_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/errors_plan9.go delete mode 100755 src/imagemagick/vendor/golang.org/x/sys/plan9/mkall.sh delete mode 100755 src/imagemagick/vendor/golang.org/x/sys/plan9/mkerrors.sh delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/mksyscall.go delete mode 100755 src/imagemagick/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/pwd_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/race.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/race0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/str.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/syscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/syscall_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/syscall_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/plan9/zsysnum_plan9.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/creds_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/darwin_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/dev_linux_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/example_exec_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/example_flock_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/export_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/linux/Dockerfile delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/linux/mkall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/linux/mksysnum.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/linux/types.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/mmap_unix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/openbsd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/sendfile_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_aix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_bsd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_darwin_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_freebsd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_linux_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_netbsd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_openbsd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_solaris_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/syscall_unix_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/timestruct_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/xattr_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/aliases.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/asm_windows_386.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/asm_windows_amd64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/asm_windows_arm.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/dll_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/env_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/eventlog.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/exec_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/memory_windows.go delete mode 100755 src/imagemagick/vendor/golang.org/x/sys/windows/mkerrors.bash delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/mksyscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/race.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/race0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/export_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/key.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/mksyscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/registry_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/syscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/value.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/security_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/service.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/str.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/debug/log.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/debug/service.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/event.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/eventlog/install.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/eventlog/log.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/eventlog/log_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/example/beep.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/example/install.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/example/main.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/example/manage.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/example/service.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/go12.c delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/go12.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/go13.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/mgr/config.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/mgr/mgr.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/mgr/mgr_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/mgr/recovery.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/mgr/service.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/security.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/service.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/svc_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/sys_386.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/sys_amd64.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/svc/sys_arm.s delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/syscall.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/syscall_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/syscall_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/syscall_windows_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/types_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/types_windows_386.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/types_windows_amd64.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/types_windows_arm.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/zerrors_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/sys/windows/zsyscall_windows.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/.gitattributes delete mode 100644 src/imagemagick/vendor/golang.org/x/text/.gitignore delete mode 100644 src/imagemagick/vendor/golang.org/x/text/CONTRIBUTING.md delete mode 100644 src/imagemagick/vendor/golang.org/x/text/README.md delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/cases.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/context.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/context_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/fold.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/fold_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/gen_trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/icu.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/icu_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/info.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/map.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/map_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/tables10.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/tables11.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/tables9.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cases/trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/catalog.go delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/de/messages.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/de/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/en-US/messages.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/en-US/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/zh/messages.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/locales/zh/out.gotext.json delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract/main.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/catalog_gen.go delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/de/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/en-US/out.gotext.json delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/en/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/locales/zh/out.gotext.json delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/extract_http/main.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/main.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/examples/rewrite/printer.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/extract.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/generate.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/main.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/rewrite.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/cmd/gotext/update.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/codereview.cfg delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/builder.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/builder_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/colelem.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/colelem_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/contract.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/contract_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/order.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/order_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/table.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/trie.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/build/trie_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/collate.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/collate_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/export_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/index.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/maketables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/option.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/option_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/reg_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/sort.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/sort_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/table_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/Makefile delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/chars.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/col.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/colcmp.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/darwin.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/collate/tools/colcmp/icu.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/currency.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/currency_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/format.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/format_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/gen_common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/query.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/query_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/currency/tables_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/date/data_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/date/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/date/gen_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/date/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/charmap/charmap_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/encoding_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/htmlindex/htmlindex_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/ianaindex/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/ianaindex/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/ianaindex/ianaindex.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/ianaindex/ianaindex_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/ianaindex/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/internal/enctest/enctest.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/japanese/all_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/korean/all_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/simplifiedchinese/all_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/candide-gb18030.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/candide-utf-16le.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/candide-utf-32be.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/candide-utf-8.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/candide-windows-1252.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/rashomon-euc-jp.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/rashomon-iso-2022-jp.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/rashomon-shift-jis.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/rashomon-utf-8.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-gb-levels-1-and-2-hz-gb2312.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-gb-levels-1-and-2-utf-8.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-simplified-gbk.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-simplified-utf-8.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-traditional-big5.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/sunzi-bingfa-traditional-utf-8.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/unsu-joh-eun-nal-euc-kr.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/testdata/unsu-joh-eun-nal-utf-8.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/traditionalchinese/all_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/unicode/unicode_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/unicode/utf32/utf32.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/encoding/unicode/utf32/utf32_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/data_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/gen_common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/message.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/message_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/plural.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/plural_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/feature/plural/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/go.mod delete mode 100644 src/imagemagick/vendor/golang.org/x/text/go.sum delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/catmsg/catmsg.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/catmsg/codec.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/catmsg/varint.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/catmsg/varint_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/cldrtree.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/cldrtree_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/generate.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/option.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test1/common/main/root.xml delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test1/output.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test2/common/main/en.xml delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test2/common/main/en_001.xml delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test2/common/main/en_GB.xml delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test2/common/main/root.xml delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/testdata/test2/output.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/tree.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/cldrtree/type.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/collate_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/collelem.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/collelem_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/colltab.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/colltab_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/contract.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/contract_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/iter.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/iter_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/numeric.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/numeric_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/table.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/trie.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/trie_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/weighter.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/colltab/weighter_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/README delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/common_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/conformance_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/gen10.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/gen9.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/gen_common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/gen_trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/idna10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/idna10.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/idna9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/idna9.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/idna_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/punycode.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/punycode_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/trie.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/idna/trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/unicode/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/unicode/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/export/unicode/unicode_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/format/format.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/format/parser.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/format/parser_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/gen/bitfield/bitfield.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/gen/bitfield/bitfield_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/gen/bitfield/gen1_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/gen/bitfield/gen2_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/gen/code.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/gen/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/internal.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/internal_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/compact.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/gen_index.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/gen_parents.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/gen_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/language.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/language_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/parents.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/parse_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compact/tags.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compose.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/compose_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/coverage.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/language.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/language_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/lookup_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/match.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/match_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/parse_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/language/tags.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/match.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/match_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/decimal.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/decimal_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/format.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/format_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/gen_common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/number.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/number_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/pattern.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/pattern_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/roundingmode_string.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/number/tables_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/stringset/set.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/stringset/set_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/tag/tag_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/codesize.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/flag.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/gc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/gccgo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/go1_6.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/go1_7.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/testtext/text.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/compact.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/data_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/example_compact_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/gen_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/print.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/triegen/triegen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/ucd/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/ucd/ucd.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/internal/ucd/ucd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/coverage_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/dict.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/dict_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/display.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/display_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/examples_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/lookup.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/maketables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/display/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/examples_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/httpexample_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/language.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/language_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/lookup_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/match_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/parse.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/parse_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/tags.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/testdata/CLDRLocaleMatcherTest.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog/catalog.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog/catalog_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog/dict.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog/go19.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog/gopre19.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/catalog_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/examples_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/fmt_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/format.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/message.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/message_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/extract.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/generate.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/go19_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/message.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/pipeline.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/pipeline_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/rewrite.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/ssa/catalog_gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/ssa/extracted.gotext.json delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/ssa/ssa.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_gen.go.want delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/catalog_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/extracted.gotext.json delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/extracted.gotext.json.want delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/de/messages.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/de/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/de/out.gotext.json.want delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/en-US/messages.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/en-US/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/en-US/out.gotext.json.want delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/zh/messages.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/zh/out.gotext.json delete mode 100755 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/locales/zh/out.gotext.json.want delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/pipeline/testdata/test1/test1.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/message/print.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/examples_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/format.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/format_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/number.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/number_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/number/option.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/runes/cond_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/runes/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/runes/runes_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/search/index.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/search/pattern.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/search/pattern_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/search/search.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/search/tables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bench_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bidirule.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/bidirule/bidirule_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/benchmark_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/class.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/class_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/context.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/enforce10.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/enforce9.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/enforce_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/gen_trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/nickname.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/options.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/profile.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/profile_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/profiles.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/tables_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/transformer.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/secure/precis/trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/transform/examples_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/transform/transform_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/bidi.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/bracket.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/core.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/core_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/gen_ranges.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/gen_trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/prop.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/ranges_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/tables_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/bidi/trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/base.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/cldr.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/cldr_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/collate.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/collate_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/data_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/decode.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/examples_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/makexml.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/resolve.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/resolve_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/slice.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/slice_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/cldr/xml.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/doc.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/composition.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/composition_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/data10.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/data11.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/data9.0.0_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/example_iter_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/forminfo.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/forminfo_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/input.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/iter.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/iter_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/maketables.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/normalize.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/normalize_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/readwriter.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/readwriter_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/transform.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/transform_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/trie.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/triegen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/norm/ucd_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/merge.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/merge_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/rangetable.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/rangetable_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/rangetable/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/runenames.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/runenames_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/unicode/runenames/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/common_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/example_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/gen.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/gen_common.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/gen_trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/kind_string.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/runes_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/tables10.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/tables11.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/tables9.0.0.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/tables_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/transform.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/transform_test.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/trieval.go delete mode 100644 src/imagemagick/vendor/golang.org/x/text/width/width.go delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/.github/ISSUE_TEMPLATE.md delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/example_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/fsnotify_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/inotify_poller_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/inotify_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/integration_darwin_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/fsnotify.v1/integration_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/tomb.v1/tomb_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/yaml.v2/decode_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/yaml.v2/encode_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/yaml.v2/example_embedded_test.go delete mode 100644 src/imagemagick/vendor/gopkg.in/yaml.v2/suite_test.go rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/CHANGELOG.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/LICENSE.txt (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/Makefile (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/appveyor.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/collection.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/constraints.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/doc.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/Masterminds/semver/version.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/.travis.yml (79%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/README.md (94%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/json.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/package.json (100%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/range.go (99%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/semver.go (89%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/sort.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/blang/semver/sql.go (87%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/NOTICE (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/command.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/cutlass/buffer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/cutlass/cf.go (98%) create mode 100644 vendor/github.com/cloudfoundry/libbuildpack/cutlass/docker.go create mode 100644 vendor/github.com/cloudfoundry/libbuildpack/cutlass/proxy.go rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/cutlass/test_helpers.go (74%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/cutlass/utils.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/error_messages.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/go.mod (92%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/go.sum (95%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/hooks.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/installer.go (97%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/json.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/logger.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/manifest.go (88%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/README.md (79%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/bindata.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/cfbindata.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/models.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/packager.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/scaffold.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/packager/summary.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/stager.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/stager_unix.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/stager_windows.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/util.go (95%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/versions.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/cloudfoundry/libbuildpack/yaml.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/.gitignore (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/README.md (76%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/actions.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/all.bash (100%) mode change 100755 => 100644 rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/ca.pem (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/certs.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/chunked.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/counterecryptor.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/ctx.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/dispatcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/doc.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/https.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/key.pem (100%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/proxy.go (90%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/responses.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/elazarl/goproxy/signer.go (95%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/.gitignore (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/CHANGES.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/Dockerfile (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/LICENSE.txt (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/Makefile (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/appveyor.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/ratelimiter/Licence (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/ratelimiter/leakybucket.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/ratelimiter/memory.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/ratelimiter/storage.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/tail.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/tail_posix.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/tail_windows.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/util/util.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/watch/filechanges.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/watch/inotify.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/watch/inotify_tracker.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/watch/polling.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/watch/watch.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/hpcloud/tail/winfile/winfile.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/.gitignore (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/CHANGELOG.md (96%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/CONTRIBUTING.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/RELEASING.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/config/config.go (95%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/ginkgo_dsl.go (99%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/codelocation/code_location.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/containernode/container_node.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/failer/failer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go (97%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/interfaces.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/it_node.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/measure_node.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/runner.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/aggregator.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/forwarding_reporter.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/output_interceptor.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/output_interceptor_win.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/server.go (99%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec/spec.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec/specs.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec_iterator/index_computer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/specrunner/random_id.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/specrunner/spec_runner.go (99%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/suite/suite.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/testingtproxy/testing_t_proxy.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/writer/fake_writer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/internal/writer/writer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/default_reporter.go (96%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/fake_reporter.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/junit_reporter.go (84%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/reporter.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/console_logging.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/fake_stenographer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/stenographer.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/colorable_others.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/colorable_windows.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/noncolorable.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/doc.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_appengine.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_bsd.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_linux.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_solaris.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_windows.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/reporters/teamcity_reporter.go (91%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/types/code_location.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/types/synchronization.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/ginkgo/types/types.go (99%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/.gitignore (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/CHANGELOG.md (89%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/CONTRIBUTING.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/Makefile (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/RELEASING.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/format/format.go (98%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/go.mod (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/go.sum (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/gomega_dsl.go (99%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/internal/assertion/assertion.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/internal/oraclematcher/oracle_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/internal/testingtsupport/testing_t_support.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/and.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/attributes_slice.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_a_directory.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_a_regular_file.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_an_existing_file.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_closed_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_element_of_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_empty_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_false_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_identical_to.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_nil_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_numerically_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_sent_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_temporally_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_true_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/be_zero_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/consist_of.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/contain_element_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/contain_substring_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/equal_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_cap_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_key_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_key_with_value_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_len_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_occurred_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_prefix_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/have_suffix_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/match_error_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/match_json_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/match_regexp_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/match_xml_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/match_yaml_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/not.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/or.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/panic_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/receive_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/semi_structured_data_support.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/succeed_matcher.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go (86%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraphmatching.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/support/goraph/edge/edge.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/support/goraph/node/node.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/support/goraph/util/util.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/type_support.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/matchers/with_transform.go (100%) rename {src/imagemagick/vendor => vendor}/github.com/onsi/gomega/types/types.go (100%) create mode 100644 vendor/github.com/pkg/errors/.gitignore create mode 100644 vendor/github.com/pkg/errors/.travis.yml create mode 100644 vendor/github.com/pkg/errors/LICENSE create mode 100644 vendor/github.com/pkg/errors/README.md create mode 100644 vendor/github.com/pkg/errors/appveyor.yml create mode 100644 vendor/github.com/pkg/errors/errors.go create mode 100644 vendor/github.com/pkg/errors/stack.go rename {src/imagemagick/vendor => vendor}/github.com/tidwall/gjson/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/gjson/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/gjson/README.md (83%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/gjson/gjson.go (89%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/gjson/gjson_gae.go (58%) create mode 100644 vendor/github.com/tidwall/gjson/gjson_ngae.go rename {src/imagemagick/vendor => vendor}/github.com/tidwall/gjson/logo.png (100%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/match/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/match/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/match/README.md (100%) rename {src/imagemagick/vendor => vendor}/github.com/tidwall/match/match.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/AUTHORS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/CONTRIBUTORS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/PATENTS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/atom/atom.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/atom/gen.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/atom/table.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/charset/charset.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/const.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/doc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/doctype.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/entity.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/escape.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/foreign.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/node.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/parse.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/render.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/net/html/token.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/AUTHORS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/CONTRIBUTORS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/PATENTS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/.gitignore (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/README.md (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/affinity_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/aliases.go (100%) rename {src/imagemagick/vendor/golang.org/x/sys/cpu => vendor/golang.org/x/sys/unix}/asm_aix_ppc64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_darwin_386.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_darwin_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_darwin_arm.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_darwin_arm64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_dragonfly_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_freebsd_386.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_freebsd_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_freebsd_arm.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_freebsd_arm64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_386.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_arm.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_arm64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_mips64x.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_mipsx.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_ppc64x.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_linux_s390x.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_netbsd_386.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_netbsd_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_netbsd_arm.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_netbsd_arm64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_openbsd_386.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_openbsd_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_openbsd_arm.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/asm_solaris_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/bluetooth_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/cap_freebsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/constants.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_aix_ppc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_aix_ppc64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_darwin.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_dragonfly.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_freebsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_netbsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dev_openbsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/dirent.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/endian_big.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/endian_little.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/env_unix.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/errors_freebsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/errors_freebsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/errors_freebsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/fcntl.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/fcntl_darwin.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/fcntl_linux_32bit.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/gccgo.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/gccgo_c.c (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/gccgo_linux_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ioctl.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mkall.sh (90%) mode change 100755 => 100644 rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mkasm_darwin.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mkerrors.sh (98%) mode change 100755 => 100644 rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mkpost.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mksyscall.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mksyscall_aix_ppc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mksyscall_aix_ppc64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mksyscall_solaris.go (100%) create mode 100644 vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/mksysnum.go (100%) rename src/imagemagick/vendor/golang.org/x/sys/unix/pledge_openbsd.go => vendor/golang.org/x/sys/unix/openbsd_pledge.go (98%) rename src/imagemagick/vendor/golang.org/x/sys/unix/unveil_openbsd.go => vendor/golang.org/x/sys/unix/openbsd_unveil.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/pagesize_unix.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/race.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/race0.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/sockcmsg_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/sockcmsg_unix.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/str.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_aix.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_aix_ppc.go (74%) rename src/imagemagick/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go => vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go (51%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_bsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_darwin.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_darwin_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_darwin_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_darwin_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_darwin_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_darwin_libSystem.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_dragonfly.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_dragonfly_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_freebsd.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_freebsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_freebsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_freebsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_freebsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux.go (95%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_amd64_gc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_arm.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_gc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_gc_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_gccgo_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_mips64x.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_mipsx.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_ppc64x.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_riscv64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_s390x.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_linux_sparc64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_netbsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_netbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_netbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_netbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_netbsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_openbsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_openbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_openbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_openbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_solaris.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_solaris_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_unix.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_unix_gc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/timestruct.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_aix.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_darwin.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_dragonfly.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_freebsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_netbsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_openbsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/types_solaris.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/xattr_bsd.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_aix_ppc.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_aix_ppc64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_darwin_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_darwin_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_darwin_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_darwin_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_freebsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_freebsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_freebsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_freebsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_386.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_amd64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_arm.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_arm64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_mips.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_mips64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_mips64le.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_mipsle.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_ppc64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_ppc64le.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_riscv64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_s390x.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_linux_sparc64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_netbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_netbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_netbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_netbsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_openbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_openbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_openbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zerrors_solaris_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zptrace386_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zptracearm_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zptracemips_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zptracemipsle_linux.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_aix_ppc.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_aix_ppc64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_386.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_amd64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_arm.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_darwin_arm64.s (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_freebsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_freebsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_386.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_amd64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_arm.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_arm64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_mips.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_mips64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_mips64le.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_mipsle.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_ppc64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_riscv64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_s390x.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_linux_sparc64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_netbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_netbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_openbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_openbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsyscall_solaris_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysctl_openbsd_386.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysctl_openbsd_arm.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_darwin_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_darwin_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_darwin_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_darwin_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_freebsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_freebsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go (100%) create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_386.go rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_amd64.go (98%) create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_arm64.go (98%) create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_mips64.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_mips64le.go (98%) create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_ppc64.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go (96%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_riscv64.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_s390x.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_linux_sparc64.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_netbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_netbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_openbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/zsysnum_openbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_aix_ppc.go (88%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_aix_ppc64.go (88%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_darwin_386.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_darwin_amd64.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_darwin_arm.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_darwin_arm64.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go (95%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_freebsd_386.go (92%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_freebsd_amd64.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_freebsd_arm.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_freebsd_arm64.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_386.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_amd64.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_arm.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_arm64.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_mips.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_mips64.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_mips64le.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_mipsle.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_ppc64.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_ppc64le.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_riscv64.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_s390x.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_linux_sparc64.go (84%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_netbsd_386.go (94%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_netbsd_amd64.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_netbsd_arm.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_netbsd_arm64.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_openbsd_386.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_openbsd_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_openbsd_arm.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/sys/unix/ztypes_solaris_amd64.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/AUTHORS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/CONTRIBUTORS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/PATENTS (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/charmap/charmap.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/charmap/maketables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/charmap/tables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/encoding.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/htmlindex/gen.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/htmlindex/htmlindex.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/htmlindex/map.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/htmlindex/tables.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/internal/identifier/gen.go (92%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/internal/identifier/identifier.go (98%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/internal/identifier/mib.go (93%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/internal/internal.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/japanese/all.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/japanese/eucjp.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/japanese/iso2022jp.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/japanese/maketables.go (97%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/japanese/shiftjis.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/japanese/tables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/korean/euckr.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/korean/maketables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/korean/tables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/simplifiedchinese/all.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/simplifiedchinese/gbk.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/simplifiedchinese/hzgb2312.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/simplifiedchinese/maketables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/simplifiedchinese/tables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/traditionalchinese/big5.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/traditionalchinese/maketables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/traditionalchinese/tables.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/unicode/override.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/encoding/unicode/unicode.go (99%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/internal/tag/tag.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/internal/utf8internal/utf8internal.go (100%) create mode 100644 vendor/golang.org/x/text/language/Makefile rename {src/imagemagick/vendor/golang.org/x/text/internal => vendor/golang.org/x/text}/language/common.go (50%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/language/coverage.go (87%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/language/doc.go (100%) rename {src/imagemagick/vendor/golang.org/x/text/internal => vendor/golang.org/x/text}/language/gen.go (85%) rename {src/imagemagick/vendor/golang.org/x/text/internal => vendor/golang.org/x/text}/language/gen_common.go (60%) create mode 100644 vendor/golang.org/x/text/language/gen_index.go rename {src/imagemagick/vendor => vendor}/golang.org/x/text/language/go1_1.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/language/go1_2.go (100%) create mode 100644 vendor/golang.org/x/text/language/index.go create mode 100644 vendor/golang.org/x/text/language/language.go rename {src/imagemagick/vendor/golang.org/x/text/internal => vendor/golang.org/x/text}/language/lookup.go (80%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/language/match.go (69%) rename {src/imagemagick/vendor/golang.org/x/text/internal => vendor/golang.org/x/text}/language/parse.go (59%) rename {src/imagemagick/vendor/golang.org/x/text/internal => vendor/golang.org/x/text}/language/tables.go (88%) create mode 100644 vendor/golang.org/x/text/language/tags.go rename {src/imagemagick/vendor => vendor}/golang.org/x/text/runes/cond.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/runes/runes.go (100%) rename {src/imagemagick/vendor => vendor}/golang.org/x/text/transform/transform.go (99%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/.editorconfig (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/.gitignore (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/AUTHORS (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/CHANGELOG.md (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/CONTRIBUTING.md (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/README.md (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/fen.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/fsnotify.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/inotify.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/inotify_poller.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/kqueue.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/open_mode_bsd.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/open_mode_darwin.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/fsnotify.v1/windows.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/tomb.v1/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/tomb.v1/README.md (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/tomb.v1/tomb.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/.travis.yml (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/LICENSE (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/LICENSE.libyaml (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/NOTICE (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/README.md (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/apic.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/decode.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/emitterc.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/encode.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/go.mod (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/parserc.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/readerc.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/resolve.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/scannerc.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/sorter.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/writerc.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/yaml.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/yamlh.go (100%) rename {src/imagemagick/vendor => vendor}/gopkg.in/yaml.v2/yamlprivateh.go (100%) create mode 100644 vendor/modules.txt diff --git a/.envrc b/.envrc index c8e74c3..51410a2 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,2 @@ -export GOPATH=$PWD -export GOBIN=$PWD/.bin -export PATH=$GOBIN:$PATH \ No newline at end of file +export GOBIN=$(pwd)/.bin +export PATH=$GOBIN:$PATH diff --git a/.gitignore b/.gitignore index 75f411d..66b7c3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,15 @@ -pkg -.bin *.zip tmp +*.log +.DS_Store +.anvil/ +.env +.idea +log +repos/* +tmp/ +/.bin/ +/pkg/ +!vendor/** + + diff --git a/bin/supply b/bin/supply index d899425..d0939d3 100755 --- a/bin/supply +++ b/bin/supply @@ -1,7 +1,4 @@ #!/bin/bash -# This script provides dependencies for an app - - set -euo pipefail BUILD_DIR=$1 @@ -12,6 +9,10 @@ DEPS_IDX=$4 export BUILDPACK_DIR=`dirname $(readlink -f ${BASH_SOURCE%/*})` source "$BUILDPACK_DIR/scripts/install_go.sh" output_dir=$(mktemp -d -t supplyXXX) + +pushd $BUILDPACK_DIR echo "-----> Running go build supply" -GOROOT=$GoInstallDir/go GOPATH=$BUILDPACK_DIR $GoInstallDir/go/bin/go build -o $output_dir/supply imagemagick/supply/cli +GOROOT=$GoInstallDir/go $GoInstallDir/go/bin/go build -mod=vendor -o $output_dir/supply ./src/imagemagick/supply/cli +popd + $output_dir/supply "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" "$DEPS_IDX" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8afaba0 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/starkandwayne/imagemagick-buildpack + +go 1.12 + +require ( + github.com/blang/semver v3.5.1+incompatible + github.com/cloudfoundry/libbuildpack v0.0.0-20190805205250-e22ed19132ff + github.com/onsi/ginkgo v1.9.0 + github.com/onsi/gomega v1.6.0 + golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect + golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..147f17e --- /dev/null +++ b/go.sum @@ -0,0 +1,63 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= +github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/cloudfoundry/libbuildpack v0.0.0-20190805205250-e22ed19132ff h1:dSEGS4XUTLL5ZyZ7Jc1bxcjjbGcg1R2Pb8sPA2cQDDk= +github.com/cloudfoundry/libbuildpack v0.0.0-20190805205250-e22ed19132ff/go.mod h1:9dmLtgQ6GrLr2ryO9ioYGpbc5eYL+8JBWtPj0r7HaZY= +github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a h1:A4wNiqeKqU56ZhtnzJCTyPZ1+cyu8jKtIchQ3TtxHgw= +github.com/elazarl/goproxy v0.0.0-20181111060418-2ce16c963a8a/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/subcommands v0.0.0-20181012225330-46f0354f6315/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.9.0 h1:SZjF721BByVj8QH636/8S2DnX4n0Re3SteMmw3N+tzc= +github.com/onsi/ginkgo v1.9.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.6.0 h1:8XTW0fcJZEq9q+Upcyws4JSGua2MFysCL5xkaSgHc+M= +github.com/onsi/gomega v1.6.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/tidwall/gjson v1.1.3 h1:u4mspaByxY+Qk4U1QYYVzGFI8qxN/3jtEV0ZDb2vRic= +github.com/tidwall/gjson v1.1.3/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA= +github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= +github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516 h1:H6trpavCIuipdInWrab8l34Mf+GGVfphniHostMdMaQ= +gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516/go.mod h1:d3R+NllX3X5e0zlG1Rful3uLvsGC/Q3OHut5464DEQw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/scripts/build.sh b/scripts/build.sh index 0fe882f..71422ac 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,4 +4,4 @@ set -exuo pipefail cd "$( dirname "${BASH_SOURCE[0]}" )/.." source .envrc -GOOS=linux go build -ldflags="-s -w" -o bin/supply imagemagick/supply/cli +GOOS=linux go build -mod=vendor -ldflags="-s -w" -o bin/supply ./src/imagemagick/supply/cli diff --git a/scripts/integration.sh b/scripts/integration.sh index f8635bb..34b61d0 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# Runs the integration tests set -euo pipefail cd "$( dirname "${BASH_SOURCE[0]}" )/.." @@ -8,11 +7,17 @@ source .envrc GINKGO_NODES=${GINKGO_NODES:-3} GINKGO_ATTEMPTS=${GINKGO_ATTEMPTS:-2} +export CF_STACK=${CF_STACK:-cflinuxfs3} + +UNCACHED_BUILDPACK_FILE=${UNCACHED_BUILDPACK_FILE:-""} +CACHED_BUILDPACK_FILE=${CACHED_BUILDPACK_FILE:-""} cd src/*/integration # echo "Run Uncached Buildpack" -# ginkgo -r --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached=false +# BUILDPACK_FILE="$UNCACHED_BUILDPACK_FILE" \ +# ginkgo -r -mod=vendor --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached=false echo "Run Cached Buildpack" -ginkgo -r --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached +BUILDPACK_FILE="$CACHED_BUILDPACK_FILE" \ + ginkgo -r -mod=vendor --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached diff --git a/sha.yml b/sha.yml deleted file mode 100644 index 471196a..0000000 --- a/sha.yml +++ /dev/null @@ -1,35 +0,0 @@ -sha: - .envrc: 1d5d07136fb2f6b0832e2b77d4337facca55d6af95fa2fe1bb76d5af80c40d3f - .gitignore: ead7aa86e80a0c37bba84b1fd7fedcfe022f8e83770b184968b2e9089ba7f0fe - README.md: b9535c6ed6ecf50ef9a1524a43211ac137a1e8e4c5bf55389c80be0ba37c3904 - VERSION: f0b8c77d978d7b4aebeb1df5a2c0a6aa70393689819dd4060826ab6d36b5ea90 - bin/compile: 654310b5818ccd89c98bf6e6e306cc7e1f06023fdb5bf2c4e98056ad8523805b - bin/detect: 88e51163e4b0847f1b31405e9ba58ae5d76590141d03c4c3b36e8618dab4e960 - bin/finalize: 8bff387c4065921ef5d8b8885b8b94965960e17e7804dbbd2a88dcb5c3db5642 - bin/release: 5bf496d666beb256634a2677fbe707ba322760c7a90f39a7eb684820d6d0f9e5 - bin/supply: ea9b9228c8012079392601a03c5a4d241b4e2ae18e1695f775401a2b8de93355 - fixtures/.gitkeep: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - fixtures/simple_test/some_file.txt: bf059f3112049d7299f9dc39397fe721c560e790611bfdc163adadbebb4e9ca9 - manifest.yml: 29edfe4761ad3745187bb1d30104a6ef9cb0dd989e4e5d140e292efd13269c1f - scripts/brats.sh: 4cfd6b86f255f3f42601723159bd5beb64667820e402c564d651be06fd7fb226 - scripts/build.sh: 0046e1bd600cccbd94c645d882cce8190908e3b0307b230bccf1240480dd6865 - scripts/install_go.sh: 2b841eae66562aaa80351393a657c6c165fb80333401699f3a15b8fca056f13b - scripts/install_tools.sh: d51958dc00a08dcc227f4de41135f9fa3b556c7580ac50dbc376c6e1b9ace8cf - scripts/integration.sh: 9970361984c5fe56394496c9d836511acd1739b7313ab6d00e11b5154cf0a24b - scripts/unit.sh: 1ce8656f8bbfcf004c2c1de235560ae1779a9fca71ef3d2bebfd842c50568f3d - src/imagemagick/Gopkg.toml: b2fb8588750ab22b33e0282e541bff1c521e4c2786cdf5b77a9b0c775865662b - src/imagemagick/finalize/cli/cli_suite_test.go: 39830eadaa8fcf039fb7848219629cf2426d58855621553c4a586fb7dee938de - src/imagemagick/finalize/cli/main.go: b7ceef4c1a6e68985c4a8cebb579a6bfc77c726e395b35764dfd1b68148778bb - src/imagemagick/finalize/finalize.go: 05464470a9fca6eaaab45c89edaf1f4fd3d6800023c77ac7997b0a1d6505fb66 - src/imagemagick/finalize/finalize_suite_test.go: d724cf73b21a342fb0788d532e76015c5d449bf48f4f8549e43a2636c546f236 - src/imagemagick/finalize/finalize_test.go: 212ac92af25b13a8ec306680103f0c383aa2b02e6e16a072c60d9df6598ce2f1 - src/imagemagick/hooks/hooks_debug.go: 2e5e705c0bfe35d8fc1d8513ccfb207378e30b04e124f222822b0a2632861231 - src/imagemagick/hooks/hooks_suite_test.go: bf6c55a890b6bd3672a04c97aa0670e19c66e1f0f387954efa4a2f06742effe5 - src/imagemagick/integration/integration_suite_test.go: ec4af872891adfa0d7a971c95bf502c010fc96e5c38717fcbd1166b6c473fa52 - src/imagemagick/integration/simple_test.go: cff2dc9c7e6174656a09a55cf8bfd7b12697eb22c5f9fa4bdf0f9bc5a292f221 - src/imagemagick/supply/cli/cli_suite_test.go: 7f95c3d72fed04529f0f93434ec73cea7cf9365012ab90a1e3c4267d22ceb335 - src/imagemagick/supply/cli/main.go: cd1fe6e3830e683e596f9df3c92179e23eab5d782262c8bd93d582a21a6f81db - src/imagemagick/supply/supply.go: 3e67be70a69c572eec91af35fd75a4ea784b07fde74db13d93f4cd1b825c2f7f - src/imagemagick/supply/supply_suite_test.go: 3d0d43ad13e2da3eb2bc91f19a0e4f9c527eaf15c29522a0d5f42afca1bb4b76 - src/imagemagick/supply/supply_test.go: 09476f00e0aa10179c3c4cf5fc38ab86d0d4088e162b41dea48e04adeb868db1 - src/imagemagick/vendor/.gitkeep: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 diff --git a/src/imagemagick/supply/cli/main.go b/src/imagemagick/supply/cli/main.go index 2adb6de..b4b6dd2 100644 --- a/src/imagemagick/supply/cli/main.go +++ b/src/imagemagick/supply/cli/main.go @@ -1,8 +1,8 @@ package main import ( - _ "imagemagick/hooks" - "imagemagick/supply" + _ "github.com/starkandwayne/imagemagick-buildpack/src/imagemagick/hooks" + "github.com/starkandwayne/imagemagick-buildpack/src/imagemagick/supply" "os" "path/filepath" "time" diff --git a/src/imagemagick/vendor/github.com/Masterminds/semver/benchmark_test.go b/src/imagemagick/vendor/github.com/Masterminds/semver/benchmark_test.go deleted file mode 100644 index 58a5c28..0000000 --- a/src/imagemagick/vendor/github.com/Masterminds/semver/benchmark_test.go +++ /dev/null @@ -1,157 +0,0 @@ -package semver_test - -import ( - "testing" - - "github.com/Masterminds/semver" -) - -/* Constraint creation benchmarks */ - -func benchNewConstraint(c string, b *testing.B) { - for i := 0; i < b.N; i++ { - semver.NewConstraint(c) - } -} - -func BenchmarkNewConstraintUnary(b *testing.B) { - benchNewConstraint("=2.0", b) -} - -func BenchmarkNewConstraintTilde(b *testing.B) { - benchNewConstraint("~2.0.0", b) -} - -func BenchmarkNewConstraintCaret(b *testing.B) { - benchNewConstraint("^2.0.0", b) -} - -func BenchmarkNewConstraintWildcard(b *testing.B) { - benchNewConstraint("1.x", b) -} - -func BenchmarkNewConstraintRange(b *testing.B) { - benchNewConstraint(">=2.1.x, <3.1.0", b) -} - -func BenchmarkNewConstraintUnion(b *testing.B) { - benchNewConstraint("~2.0.0 || =3.1.0", b) -} - -/* Check benchmarks */ - -func benchCheckVersion(c, v string, b *testing.B) { - version, _ := semver.NewVersion(v) - constraint, _ := semver.NewConstraint(c) - - for i := 0; i < b.N; i++ { - constraint.Check(version) - } -} - -func BenchmarkCheckVersionUnary(b *testing.B) { - benchCheckVersion("=2.0", "2.0.0", b) -} - -func BenchmarkCheckVersionTilde(b *testing.B) { - benchCheckVersion("~2.0.0", "2.0.5", b) -} - -func BenchmarkCheckVersionCaret(b *testing.B) { - benchCheckVersion("^2.0.0", "2.1.0", b) -} - -func BenchmarkCheckVersionWildcard(b *testing.B) { - benchCheckVersion("1.x", "1.4.0", b) -} - -func BenchmarkCheckVersionRange(b *testing.B) { - benchCheckVersion(">=2.1.x, <3.1.0", "2.4.5", b) -} - -func BenchmarkCheckVersionUnion(b *testing.B) { - benchCheckVersion("~2.0.0 || =3.1.0", "3.1.0", b) -} - -func benchValidateVersion(c, v string, b *testing.B) { - version, _ := semver.NewVersion(v) - constraint, _ := semver.NewConstraint(c) - - for i := 0; i < b.N; i++ { - constraint.Validate(version) - } -} - -/* Validate benchmarks, including fails */ - -func BenchmarkValidateVersionUnary(b *testing.B) { - benchValidateVersion("=2.0", "2.0.0", b) -} - -func BenchmarkValidateVersionUnaryFail(b *testing.B) { - benchValidateVersion("=2.0", "2.0.1", b) -} - -func BenchmarkValidateVersionTilde(b *testing.B) { - benchValidateVersion("~2.0.0", "2.0.5", b) -} - -func BenchmarkValidateVersionTildeFail(b *testing.B) { - benchValidateVersion("~2.0.0", "1.0.5", b) -} - -func BenchmarkValidateVersionCaret(b *testing.B) { - benchValidateVersion("^2.0.0", "2.1.0", b) -} - -func BenchmarkValidateVersionCaretFail(b *testing.B) { - benchValidateVersion("^2.0.0", "4.1.0", b) -} - -func BenchmarkValidateVersionWildcard(b *testing.B) { - benchValidateVersion("1.x", "1.4.0", b) -} - -func BenchmarkValidateVersionWildcardFail(b *testing.B) { - benchValidateVersion("1.x", "2.4.0", b) -} - -func BenchmarkValidateVersionRange(b *testing.B) { - benchValidateVersion(">=2.1.x, <3.1.0", "2.4.5", b) -} - -func BenchmarkValidateVersionRangeFail(b *testing.B) { - benchValidateVersion(">=2.1.x, <3.1.0", "1.4.5", b) -} - -func BenchmarkValidateVersionUnion(b *testing.B) { - benchValidateVersion("~2.0.0 || =3.1.0", "3.1.0", b) -} - -func BenchmarkValidateVersionUnionFail(b *testing.B) { - benchValidateVersion("~2.0.0 || =3.1.0", "3.1.1", b) -} - -/* Version creation benchmarks */ - -func benchNewVersion(v string, b *testing.B) { - for i := 0; i < b.N; i++ { - semver.NewVersion(v) - } -} - -func BenchmarkNewVersionSimple(b *testing.B) { - benchNewVersion("1.0.0", b) -} - -func BenchmarkNewVersionPre(b *testing.B) { - benchNewVersion("1.0.0-alpha", b) -} - -func BenchmarkNewVersionMeta(b *testing.B) { - benchNewVersion("1.0.0+metadata", b) -} - -func BenchmarkNewVersionMetaDash(b *testing.B) { - benchNewVersion("1.0.0+metadata-dash", b) -} diff --git a/src/imagemagick/vendor/github.com/Masterminds/semver/collection_test.go b/src/imagemagick/vendor/github.com/Masterminds/semver/collection_test.go deleted file mode 100644 index 71b909c..0000000 --- a/src/imagemagick/vendor/github.com/Masterminds/semver/collection_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package semver - -import ( - "reflect" - "sort" - "testing" -) - -func TestCollection(t *testing.T) { - raw := []string{ - "1.2.3", - "1.0", - "1.3", - "2", - "0.4.2", - } - - vs := make([]*Version, len(raw)) - for i, r := range raw { - v, err := NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v - } - - sort.Sort(Collection(vs)) - - e := []string{ - "0.4.2", - "1.0.0", - "1.2.3", - "1.3.0", - "2.0.0", - } - - a := make([]string, len(vs)) - for i, v := range vs { - a[i] = v.String() - } - - if !reflect.DeepEqual(a, e) { - t.Error("Sorting Collection failed") - } -} diff --git a/src/imagemagick/vendor/github.com/Masterminds/semver/constraints_test.go b/src/imagemagick/vendor/github.com/Masterminds/semver/constraints_test.go deleted file mode 100644 index bf52c90..0000000 --- a/src/imagemagick/vendor/github.com/Masterminds/semver/constraints_test.go +++ /dev/null @@ -1,465 +0,0 @@ -package semver - -import ( - "reflect" - "testing" -) - -func TestParseConstraint(t *testing.T) { - tests := []struct { - in string - f cfunc - v string - err bool - }{ - {">= 1.2", constraintGreaterThanEqual, "1.2.0", false}, - {"1.0", constraintTildeOrEqual, "1.0.0", false}, - {"foo", nil, "", true}, - {"<= 1.2", constraintLessThanEqual, "1.2.0", false}, - {"=< 1.2", constraintLessThanEqual, "1.2.0", false}, - {"=> 1.2", constraintGreaterThanEqual, "1.2.0", false}, - {"v1.2", constraintTildeOrEqual, "1.2.0", false}, - {"=1.5", constraintTildeOrEqual, "1.5.0", false}, - {"> 1.3", constraintGreaterThan, "1.3.0", false}, - {"< 1.4.1", constraintLessThan, "1.4.1", false}, - } - - for _, tc := range tests { - c, err := parseConstraint(tc.in) - if tc.err && err == nil { - t.Errorf("Expected error for %s didn't occur", tc.in) - } else if !tc.err && err != nil { - t.Errorf("Unexpected error for %s", tc.in) - } - - // If an error was expected continue the loop and don't try the other - // tests as they will cause errors. - if tc.err { - continue - } - - if tc.v != c.con.String() { - t.Errorf("Incorrect version found on %s", tc.in) - } - - f1 := reflect.ValueOf(tc.f) - f2 := reflect.ValueOf(c.function) - if f1 != f2 { - t.Errorf("Wrong constraint found for %s", tc.in) - } - } -} - -func TestConstraintCheck(t *testing.T) { - tests := []struct { - constraint string - version string - check bool - }{ - {"= 2.0", "1.2.3", false}, - {"= 2.0", "2.0.0", true}, - {"4.1", "4.1.0", true}, - {"!=4.1", "4.1.0", false}, - {"!=4.1", "5.1.0", true}, - {">1.1", "4.1.0", true}, - {">1.1", "1.1.0", false}, - {"<1.1", "0.1.0", true}, - {"<1.1", "1.1.0", false}, - {"<1.1", "1.1.1", false}, - {">=1.1", "4.1.0", true}, - {">=1.1", "1.1.0", true}, - {">=1.1", "0.0.9", false}, - {"<=1.1", "0.1.0", true}, - {"<=1.1", "1.1.0", true}, - {"<=1.1", "1.1.1", false}, - {">0", "0.0.1-alpha", true}, - {">=0", "0.0.1-alpha", true}, - {">0", "0", false}, - {">=0", "0", true}, - {"=0", "1", false}, - } - - for _, tc := range tests { - c, err := parseConstraint(tc.constraint) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - v, err := NewVersion(tc.version) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - a := c.check(v) - if a != tc.check { - t.Errorf("Constraint %q failing with %q", tc.constraint, tc.version) - } - } -} - -func TestNewConstraint(t *testing.T) { - tests := []struct { - input string - ors int - count int - err bool - }{ - {">= 1.1", 1, 1, false}, - {"2.0", 1, 1, false}, - {"v2.3.5-20161202202307-sha.e8fc5e5", 1, 1, false}, - {">= bar", 0, 0, true}, - {">= 1.2.3, < 2.0", 1, 2, false}, - {">= 1.2.3, < 2.0 || => 3.0, < 4", 2, 2, false}, - - // The 3 - 4 should be broken into 2 by the range rewriting - {"3 - 4 || => 3.0, < 4", 2, 2, false}, - } - - for _, tc := range tests { - v, err := NewConstraint(tc.input) - if tc.err && err == nil { - t.Errorf("expected but did not get error for: %s", tc.input) - continue - } else if !tc.err && err != nil { - t.Errorf("unexpectederror for input %s: %s", tc.input, err) - continue - } - if tc.err { - continue - } - - l := len(v.constraints) - if tc.ors != l { - t.Errorf("Expected %s to have %d ORs but got %d", - tc.input, tc.ors, l) - } - - l = len(v.constraints[0]) - if tc.count != l { - t.Errorf("Expected %s to have %d constraints but got %d", - tc.input, tc.count, l) - } - } -} - -func TestConstraintsCheck(t *testing.T) { - tests := []struct { - constraint string - version string - check bool - }{ - {"*", "1.2.3", true}, - {"~0.0.0", "1.2.3", true}, - {"0.x.x", "1.2.3", false}, - {"0.0.x", "1.2.3", false}, - {"0.0.0", "1.2.3", false}, - {"*", "1.2.3", true}, - {"^0.0.0", "1.2.3", false}, - {"= 2.0", "1.2.3", false}, - {"= 2.0", "2.0.0", true}, - {"4.1", "4.1.0", true}, - {"4.1.x", "4.1.3", true}, - {"1.x", "1.4", true}, - {"!=4.1", "4.1.0", false}, - {"!=4.1-alpha", "4.1.0-alpha", false}, - {"!=4.1-alpha", "4.1.0", true}, - {"!=4.1", "5.1.0", true}, - {"!=4.x", "5.1.0", true}, - {"!=4.x", "4.1.0", false}, - {"!=4.1.x", "4.2.0", true}, - {"!=4.2.x", "4.2.3", false}, - {">1.1", "4.1.0", true}, - {">1.1", "1.1.0", false}, - {"<1.1", "0.1.0", true}, - {"<1.1", "1.1.0", false}, - {"<1.1", "1.1.1", false}, - {"<1.x", "1.1.1", true}, - {"<1.x", "2.1.1", false}, - {"<1.1.x", "1.2.1", false}, - {"<1.1.x", "1.1.500", true}, - {"<1.2.x", "1.1.1", true}, - {">=1.1", "4.1.0", true}, - {">=1.1", "4.1.0-beta", false}, - {">=1.1", "1.1.0", true}, - {">=1.1", "0.0.9", false}, - {"<=1.1", "0.1.0", true}, - {"<=1.1", "0.1.0-alpha", false}, - {"<=1.1-a", "0.1.0-alpha", true}, - {"<=1.1", "1.1.0", true}, - {"<=1.x", "1.1.0", true}, - {"<=2.x", "3.1.0", false}, - {"<=1.1", "1.1.1", false}, - {"<=1.1.x", "1.2.500", false}, - {">1.1, <2", "1.1.1", true}, - {">1.1, <3", "4.3.2", false}, - {">=1.1, <2, !=1.2.3", "1.2.3", false}, - {">=1.1, <2, !=1.2.3 || > 3", "3.1.2", true}, - {">=1.1, <2, !=1.2.3 || >= 3", "3.0.0", true}, - {">=1.1, <2, !=1.2.3 || > 3", "3.0.0", false}, - {">=1.1, <2, !=1.2.3 || > 3", "1.2.3", false}, - {"1.1 - 2", "1.1.1", true}, - {"1.1-3", "4.3.2", false}, - {"^1.1", "1.1.1", true}, - {"^1.1", "4.3.2", false}, - {"^1.x", "1.1.1", true}, - {"^2.x", "1.1.1", false}, - {"^1.x", "2.1.1", false}, - {"^1.x", "1.1.1-beta1", false}, - {"^1.1.2-alpha", "1.2.1-beta1", true}, - {"^1.2.x-alpha", "1.1.1-beta1", false}, - {"~*", "2.1.1", true}, - {"~1", "2.1.1", false}, - {"~1", "1.3.5", true}, - {"~1", "1.4", true}, - {"~1.x", "2.1.1", false}, - {"~1.x", "1.3.5", true}, - {"~1.x", "1.4", true}, - {"~1.1", "1.1.1", true}, - {"~1.1", "1.1.1-alpha", false}, - {"~1.1-alpha", "1.1.1-beta", true}, - {"~1.1.1-beta", "1.1.1-alpha", false}, - {"~1.1.1-beta", "1.1.1", true}, - {"~1.2.3", "1.2.5", true}, - {"~1.2.3", "1.2.2", false}, - {"~1.2.3", "1.3.2", false}, - {"~1.1", "1.2.3", false}, - {"~1.3", "2.4.5", false}, - } - - for _, tc := range tests { - c, err := NewConstraint(tc.constraint) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - v, err := NewVersion(tc.version) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - a := c.Check(v) - if a != tc.check { - t.Errorf("Constraint '%s' failing with '%s'", tc.constraint, tc.version) - } - } -} - -func TestRewriteRange(t *testing.T) { - tests := []struct { - c string - nc string - }{ - {"2 - 3", ">= 2, <= 3"}, - {"2 - 3, 2 - 3", ">= 2, <= 3,>= 2, <= 3"}, - {"2 - 3, 4.0.0 - 5.1", ">= 2, <= 3,>= 4.0.0, <= 5.1"}, - } - - for _, tc := range tests { - o := rewriteRange(tc.c) - - if o != tc.nc { - t.Errorf("Range %s rewritten incorrectly as '%s'", tc.c, o) - } - } -} - -func TestIsX(t *testing.T) { - tests := []struct { - t string - c bool - }{ - {"A", false}, - {"%", false}, - {"X", true}, - {"x", true}, - {"*", true}, - } - - for _, tc := range tests { - a := isX(tc.t) - if a != tc.c { - t.Errorf("Function isX error on %s", tc.t) - } - } -} - -func TestConstraintsValidate(t *testing.T) { - tests := []struct { - constraint string - version string - check bool - }{ - {"*", "1.2.3", true}, - {"~0.0.0", "1.2.3", true}, - {"= 2.0", "1.2.3", false}, - {"= 2.0", "2.0.0", true}, - {"4.1", "4.1.0", true}, - {"4.1.x", "4.1.3", true}, - {"1.x", "1.4", true}, - {"!=4.1", "4.1.0", false}, - {"!=4.1", "5.1.0", true}, - {"!=4.x", "5.1.0", true}, - {"!=4.x", "4.1.0", false}, - {"!=4.1.x", "4.2.0", true}, - {"!=4.2.x", "4.2.3", false}, - {">1.1", "4.1.0", true}, - {">1.1", "1.1.0", false}, - {"<1.1", "0.1.0", true}, - {"<1.1", "1.1.0", false}, - {"<1.1", "1.1.1", false}, - {"<1.x", "1.1.1", true}, - {"<1.x", "2.1.1", false}, - {"<1.1.x", "1.2.1", false}, - {"<1.1.x", "1.1.500", true}, - {"<1.2.x", "1.1.1", true}, - {">=1.1", "4.1.0", true}, - {">=1.1", "1.1.0", true}, - {">=1.1", "0.0.9", false}, - {"<=1.1", "0.1.0", true}, - {"<=1.1", "1.1.0", true}, - {"<=1.x", "1.1.0", true}, - {"<=2.x", "3.1.0", false}, - {"<=1.1", "1.1.1", false}, - {"<=1.1.x", "1.2.500", false}, - {">1.1, <2", "1.1.1", true}, - {">1.1, <3", "4.3.2", false}, - {">=1.1, <2, !=1.2.3", "1.2.3", false}, - {">=1.1, <2, !=1.2.3 || > 3", "3.1.2", true}, - {">=1.1, <2, !=1.2.3 || >= 3", "3.0.0", true}, - {">=1.1, <2, !=1.2.3 || > 3", "3.0.0", false}, - {">=1.1, <2, !=1.2.3 || > 3", "1.2.3", false}, - {"1.1 - 2", "1.1.1", true}, - {"1.1-3", "4.3.2", false}, - {"^1.1", "1.1.1", true}, - {"^1.1", "1.1.1-alpha", false}, - {"^1.1.1-alpha", "1.1.1-beta", true}, - {"^1.1.1-beta", "1.1.1-alpha", false}, - {"^1.1", "4.3.2", false}, - {"^1.x", "1.1.1", true}, - {"^2.x", "1.1.1", false}, - {"^1.x", "2.1.1", false}, - {"~*", "2.1.1", true}, - {"~1", "2.1.1", false}, - {"~1", "1.3.5", true}, - {"~1", "1.3.5-beta", false}, - {"~1.x", "2.1.1", false}, - {"~1.x", "1.3.5", true}, - {"~1.x", "1.3.5-beta", false}, - {"~1.3.6-alpha", "1.3.5-beta", false}, - {"~1.3.5-alpha", "1.3.5-beta", true}, - {"~1.3.5-beta", "1.3.5-alpha", false}, - {"~1.x", "1.4", true}, - {"~1.1", "1.1.1", true}, - {"~1.2.3", "1.2.5", true}, - {"~1.2.3", "1.2.2", false}, - {"~1.2.3", "1.3.2", false}, - {"~1.1", "1.2.3", false}, - {"~1.3", "2.4.5", false}, - } - - for _, tc := range tests { - c, err := NewConstraint(tc.constraint) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - v, err := NewVersion(tc.version) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - a, msgs := c.Validate(v) - if a != tc.check { - t.Errorf("Constraint '%s' failing with '%s'", tc.constraint, tc.version) - } else if !a && len(msgs) == 0 { - t.Errorf("%q failed with %q but no errors returned", tc.constraint, tc.version) - } - - // if a == false { - // for _, m := range msgs { - // t.Errorf("%s", m) - // } - // } - } - - v, err := NewVersion("1.2.3") - if err != nil { - t.Errorf("err: %s", err) - } - - c, err := NewConstraint("!= 1.2.5, ^2, <= 1.1.x") - if err != nil { - t.Errorf("err: %s", err) - } - - _, msgs := c.Validate(v) - if len(msgs) != 2 { - t.Error("Invalid number of validations found") - } - e := msgs[0].Error() - if e != "1.2.3 does not have same major version as 2" { - t.Error("Did not get expected message: 1.2.3 does not have same major version as 2") - } - e = msgs[1].Error() - if e != "1.2.3 is greater than 1.1.x" { - t.Error("Did not get expected message: 1.2.3 is greater than 1.1.x") - } - - tests2 := []struct { - constraint, version, msg string - }{ - {"= 2.0", "1.2.3", "1.2.3 is not equal to 2.0"}, - {"!=4.1", "4.1.0", "4.1.0 is equal to 4.1"}, - {"!=4.x", "4.1.0", "4.1.0 is equal to 4.x"}, - {"!=4.2.x", "4.2.3", "4.2.3 is equal to 4.2.x"}, - {">1.1", "1.1.0", "1.1.0 is less than or equal to 1.1"}, - {"<1.1", "1.1.0", "1.1.0 is greater than or equal to 1.1"}, - {"<1.1", "1.1.1", "1.1.1 is greater than or equal to 1.1"}, - {"<1.x", "2.1.1", "2.1.1 is greater than or equal to 1.x"}, - {"<1.1.x", "1.2.1", "1.2.1 is greater than or equal to 1.1.x"}, - {">=1.1", "0.0.9", "0.0.9 is less than 1.1"}, - {"<=2.x", "3.1.0", "3.1.0 is greater than 2.x"}, - {"<=1.1", "1.1.1", "1.1.1 is greater than 1.1"}, - {"<=1.1.x", "1.2.500", "1.2.500 is greater than 1.1.x"}, - {">1.1, <3", "4.3.2", "4.3.2 is greater than or equal to 3"}, - {">=1.1, <2, !=1.2.3", "1.2.3", "1.2.3 is equal to 1.2.3"}, - {">=1.1, <2, !=1.2.3 || > 3", "3.0.0", "3.0.0 is greater than or equal to 2"}, - {">=1.1, <2, !=1.2.3 || > 3", "1.2.3", "1.2.3 is equal to 1.2.3"}, - {"1.1 - 3", "4.3.2", "4.3.2 is greater than 3"}, - {"^1.1", "4.3.2", "4.3.2 does not have same major version as 1.1"}, - {"^2.x", "1.1.1", "1.1.1 does not have same major version as 2.x"}, - {"^1.x", "2.1.1", "2.1.1 does not have same major version as 1.x"}, - {"~1", "2.1.2", "2.1.2 does not have same major and minor version as 1"}, - {"~1.x", "2.1.1", "2.1.1 does not have same major and minor version as 1.x"}, - {"~1.2.3", "1.2.2", "1.2.2 does not have same major and minor version as 1.2.3"}, - {"~1.2.3", "1.3.2", "1.3.2 does not have same major and minor version as 1.2.3"}, - {"~1.1", "1.2.3", "1.2.3 does not have same major and minor version as 1.1"}, - {"~1.3", "2.4.5", "2.4.5 does not have same major and minor version as 1.3"}, - } - - for _, tc := range tests2 { - c, err := NewConstraint(tc.constraint) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - v, err := NewVersion(tc.version) - if err != nil { - t.Errorf("err: %s", err) - continue - } - - _, msgs := c.Validate(v) - e := msgs[0].Error() - if e != tc.msg { - t.Errorf("Did not get expected message %q: %s", tc.msg, e) - } - } -} diff --git a/src/imagemagick/vendor/github.com/Masterminds/semver/version_test.go b/src/imagemagick/vendor/github.com/Masterminds/semver/version_test.go deleted file mode 100644 index ff5d644..0000000 --- a/src/imagemagick/vendor/github.com/Masterminds/semver/version_test.go +++ /dev/null @@ -1,490 +0,0 @@ -package semver - -import ( - "encoding/json" - "fmt" - "testing" -) - -func TestNewVersion(t *testing.T) { - tests := []struct { - version string - err bool - }{ - {"1.2.3", false}, - {"v1.2.3", false}, - {"1.0", false}, - {"v1.0", false}, - {"1", false}, - {"v1", false}, - {"1.2.beta", true}, - {"v1.2.beta", true}, - {"foo", true}, - {"1.2-5", false}, - {"v1.2-5", false}, - {"1.2-beta.5", false}, - {"v1.2-beta.5", false}, - {"\n1.2", true}, - {"\nv1.2", true}, - {"1.2.0-x.Y.0+metadata", false}, - {"v1.2.0-x.Y.0+metadata", false}, - {"1.2.0-x.Y.0+metadata-width-hypen", false}, - {"v1.2.0-x.Y.0+metadata-width-hypen", false}, - {"1.2.3-rc1-with-hypen", false}, - {"v1.2.3-rc1-with-hypen", false}, - {"1.2.3.4", true}, - {"v1.2.3.4", true}, - {"1.2.2147483648", false}, - {"1.2147483648.3", false}, - {"2147483648.3.0", false}, - } - - for _, tc := range tests { - _, err := NewVersion(tc.version) - if tc.err && err == nil { - t.Fatalf("expected error for version: %s", tc.version) - } else if !tc.err && err != nil { - t.Fatalf("error for version %s: %s", tc.version, err) - } - } -} - -func TestOriginal(t *testing.T) { - tests := []string{ - "1.2.3", - "v1.2.3", - "1.0", - "v1.0", - "1", - "v1", - "1.2-5", - "v1.2-5", - "1.2-beta.5", - "v1.2-beta.5", - "1.2.0-x.Y.0+metadata", - "v1.2.0-x.Y.0+metadata", - "1.2.0-x.Y.0+metadata-width-hypen", - "v1.2.0-x.Y.0+metadata-width-hypen", - "1.2.3-rc1-with-hypen", - "v1.2.3-rc1-with-hypen", - } - - for _, tc := range tests { - v, err := NewVersion(tc) - if err != nil { - t.Errorf("Error parsing version %s", tc) - } - - o := v.Original() - if o != tc { - t.Errorf("Error retrieving originl. Expected '%s' but got '%s'", tc, v) - } - } -} - -func TestParts(t *testing.T) { - v, err := NewVersion("1.2.3-beta.1+build.123") - if err != nil { - t.Error("Error parsing version 1.2.3-beta.1+build.123") - } - - if v.Major() != 1 { - t.Error("Major() returning wrong value") - } - if v.Minor() != 2 { - t.Error("Minor() returning wrong value") - } - if v.Patch() != 3 { - t.Error("Patch() returning wrong value") - } - if v.Prerelease() != "beta.1" { - t.Error("Prerelease() returning wrong value") - } - if v.Metadata() != "build.123" { - t.Error("Metadata() returning wrong value") - } -} - -func TestString(t *testing.T) { - tests := []struct { - version string - expected string - }{ - {"1.2.3", "1.2.3"}, - {"v1.2.3", "1.2.3"}, - {"1.0", "1.0.0"}, - {"v1.0", "1.0.0"}, - {"1", "1.0.0"}, - {"v1", "1.0.0"}, - {"1.2-5", "1.2.0-5"}, - {"v1.2-5", "1.2.0-5"}, - {"1.2-beta.5", "1.2.0-beta.5"}, - {"v1.2-beta.5", "1.2.0-beta.5"}, - {"1.2.0-x.Y.0+metadata", "1.2.0-x.Y.0+metadata"}, - {"v1.2.0-x.Y.0+metadata", "1.2.0-x.Y.0+metadata"}, - {"1.2.0-x.Y.0+metadata-width-hypen", "1.2.0-x.Y.0+metadata-width-hypen"}, - {"v1.2.0-x.Y.0+metadata-width-hypen", "1.2.0-x.Y.0+metadata-width-hypen"}, - {"1.2.3-rc1-with-hypen", "1.2.3-rc1-with-hypen"}, - {"v1.2.3-rc1-with-hypen", "1.2.3-rc1-with-hypen"}, - } - - for _, tc := range tests { - v, err := NewVersion(tc.version) - if err != nil { - t.Errorf("Error parsing version %s", tc) - } - - s := v.String() - if s != tc.expected { - t.Errorf("Error generating string. Expected '%s' but got '%s'", tc.expected, s) - } - } -} - -func TestCompare(t *testing.T) { - tests := []struct { - v1 string - v2 string - expected int - }{ - {"1.2.3", "1.5.1", -1}, - {"2.2.3", "1.5.1", 1}, - {"2.2.3", "2.2.2", 1}, - {"3.2-beta", "3.2-beta", 0}, - {"1.3", "1.1.4", 1}, - {"4.2", "4.2-beta", 1}, - {"4.2-beta", "4.2", -1}, - {"4.2-alpha", "4.2-beta", -1}, - {"4.2-alpha", "4.2-alpha", 0}, - {"4.2-beta.2", "4.2-beta.1", 1}, - {"4.2-beta2", "4.2-beta1", 1}, - {"4.2-beta", "4.2-beta.2", -1}, - {"4.2-beta", "4.2-beta.foo", -1}, - {"4.2-beta.2", "4.2-beta", 1}, - {"4.2-beta.foo", "4.2-beta", 1}, - {"1.2+bar", "1.2+baz", 0}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - a := v1.Compare(v2) - e := tc.expected - if a != e { - t.Errorf( - "Comparison of '%s' and '%s' failed. Expected '%d', got '%d'", - tc.v1, tc.v2, e, a, - ) - } - } -} - -func TestLessThan(t *testing.T) { - tests := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.5.1", true}, - {"2.2.3", "1.5.1", false}, - {"3.2-beta", "3.2-beta", false}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - a := v1.LessThan(v2) - e := tc.expected - if a != e { - t.Errorf( - "Comparison of '%s' and '%s' failed. Expected '%t', got '%t'", - tc.v1, tc.v2, e, a, - ) - } - } -} - -func TestGreaterThan(t *testing.T) { - tests := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.5.1", false}, - {"2.2.3", "1.5.1", true}, - {"3.2-beta", "3.2-beta", false}, - {"3.2.0-beta.1", "3.2.0-beta.5", false}, - {"3.2-beta.4", "3.2-beta.2", true}, - {"7.43.0-SNAPSHOT.99", "7.43.0-SNAPSHOT.103", false}, - {"7.43.0-SNAPSHOT.FOO", "7.43.0-SNAPSHOT.103", true}, - {"7.43.0-SNAPSHOT.99", "7.43.0-SNAPSHOT.BAR", false}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - a := v1.GreaterThan(v2) - e := tc.expected - if a != e { - t.Errorf( - "Comparison of '%s' and '%s' failed. Expected '%t', got '%t'", - tc.v1, tc.v2, e, a, - ) - } - } -} - -func TestEqual(t *testing.T) { - tests := []struct { - v1 string - v2 string - expected bool - }{ - {"1.2.3", "1.5.1", false}, - {"2.2.3", "1.5.1", false}, - {"3.2-beta", "3.2-beta", true}, - {"3.2-beta+foo", "3.2-beta+bar", true}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - v2, err := NewVersion(tc.v2) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - a := v1.Equal(v2) - e := tc.expected - if a != e { - t.Errorf( - "Comparison of '%s' and '%s' failed. Expected '%t', got '%t'", - tc.v1, tc.v2, e, a, - ) - } - } -} - -func TestInc(t *testing.T) { - tests := []struct { - v1 string - expected string - how string - expectedOriginal string - }{ - {"1.2.3", "1.2.4", "patch", "1.2.4"}, - {"v1.2.4", "1.2.5", "patch", "v1.2.5"}, - {"1.2.3", "1.3.0", "minor", "1.3.0"}, - {"v1.2.4", "1.3.0", "minor", "v1.3.0"}, - {"1.2.3", "2.0.0", "major", "2.0.0"}, - {"v1.2.4", "2.0.0", "major", "v2.0.0"}, - {"1.2.3+meta", "1.2.4", "patch", "1.2.4"}, - {"1.2.3-beta+meta", "1.2.3", "patch", "1.2.3"}, - {"v1.2.4-beta+meta", "1.2.4", "patch", "v1.2.4"}, - {"1.2.3-beta+meta", "1.3.0", "minor", "1.3.0"}, - {"v1.2.4-beta+meta", "1.3.0", "minor", "v1.3.0"}, - {"1.2.3-beta+meta", "2.0.0", "major", "2.0.0"}, - {"v1.2.4-beta+meta", "2.0.0", "major", "v2.0.0"}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - var v2 Version - switch tc.how { - case "patch": - v2 = v1.IncPatch() - case "minor": - v2 = v1.IncMinor() - case "major": - v2 = v1.IncMajor() - } - - a := v2.String() - e := tc.expected - if a != e { - t.Errorf( - "Inc %q failed. Expected %q got %q", - tc.how, e, a, - ) - } - - a = v2.Original() - e = tc.expectedOriginal - if a != e { - t.Errorf( - "Inc %q failed. Expected original %q got %q", - tc.how, e, a, - ) - } - } -} - -func TestSetPrerelease(t *testing.T) { - tests := []struct { - v1 string - prerelease string - expectedVersion string - expectedPrerelease string - expectedOriginal string - expectedErr error - }{ - {"1.2.3", "**", "1.2.3", "", "1.2.3", ErrInvalidPrerelease}, - {"1.2.3", "beta", "1.2.3-beta", "beta", "1.2.3-beta", nil}, - {"v1.2.4", "beta", "1.2.4-beta", "beta", "v1.2.4-beta", nil}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - v2, err := v1.SetPrerelease(tc.prerelease) - if err != tc.expectedErr { - t.Errorf("Expected to get err=%s, but got err=%s", tc.expectedErr, err) - } - - a := v2.Prerelease() - e := tc.expectedPrerelease - if a != e { - t.Errorf("Expected prerelease value=%q, but got %q", e, a) - } - - a = v2.String() - e = tc.expectedVersion - if a != e { - t.Errorf("Expected version string=%q, but got %q", e, a) - } - - a = v2.Original() - e = tc.expectedOriginal - if a != e { - t.Errorf("Expected version original=%q, but got %q", e, a) - } - } -} - -func TestSetMetadata(t *testing.T) { - tests := []struct { - v1 string - metadata string - expectedVersion string - expectedMetadata string - expectedOriginal string - expectedErr error - }{ - {"1.2.3", "**", "1.2.3", "", "1.2.3", ErrInvalidMetadata}, - {"1.2.3", "meta", "1.2.3+meta", "meta", "1.2.3+meta", nil}, - {"v1.2.4", "meta", "1.2.4+meta", "meta", "v1.2.4+meta", nil}, - } - - for _, tc := range tests { - v1, err := NewVersion(tc.v1) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - v2, err := v1.SetMetadata(tc.metadata) - if err != tc.expectedErr { - t.Errorf("Expected to get err=%s, but got err=%s", tc.expectedErr, err) - } - - a := v2.Metadata() - e := tc.expectedMetadata - if a != e { - t.Errorf("Expected metadata value=%q, but got %q", e, a) - } - - a = v2.String() - e = tc.expectedVersion - if e != a { - t.Errorf("Expected version string=%q, but got %q", e, a) - } - - a = v2.Original() - e = tc.expectedOriginal - if a != e { - t.Errorf("Expected version original=%q, but got %q", e, a) - } - } -} - -func TestOriginalVPrefix(t *testing.T) { - tests := []struct { - version string - vprefix string - }{ - {"1.2.3", ""}, - {"v1.2.4", "v"}, - } - - for _, tc := range tests { - v1, _ := NewVersion(tc.version) - a := v1.originalVPrefix() - e := tc.vprefix - if a != e { - t.Errorf("Expected vprefix=%q, but got %q", e, a) - } - } -} - -func TestJsonMarshal(t *testing.T) { - sVer := "1.1.1" - x, err := NewVersion(sVer) - if err != nil { - t.Errorf("Error creating version: %s", err) - } - out, err2 := json.Marshal(x) - if err2 != nil { - t.Errorf("Error marshaling version: %s", err2) - } - got := string(out) - want := fmt.Sprintf("%q", sVer) - if got != want { - t.Errorf("Error marshaling unexpected marshaled content: got=%q want=%q", got, want) - } -} - -func TestJsonUnmarshal(t *testing.T) { - sVer := "1.1.1" - ver := &Version{} - err := json.Unmarshal([]byte(fmt.Sprintf("%q", sVer)), ver) - if err != nil { - t.Errorf("Error unmarshaling version: %s", err) - } - got := ver.String() - want := sVer - if got != want { - t.Errorf("Error unmarshaling unexpected object content: got=%q want=%q", got, want) - } -} diff --git a/src/imagemagick/vendor/github.com/blang/semver/.gx/lastpubver b/src/imagemagick/vendor/github.com/blang/semver/.gx/lastpubver deleted file mode 100644 index 27ed267..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/.gx/lastpubver +++ /dev/null @@ -1 +0,0 @@ -3.5.1: QmYRGECuvQnRX73fcvPnGbYijBcGN2HbKZQ7jh26qmLiHG diff --git a/src/imagemagick/vendor/github.com/blang/semver/examples/main.go b/src/imagemagick/vendor/github.com/blang/semver/examples/main.go deleted file mode 100644 index 7bd1c55..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/examples/main.go +++ /dev/null @@ -1,84 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/blang/semver" -) - -func main() { - v, err := semver.Parse("0.0.1-alpha.preview.222+123.github") - if err != nil { - fmt.Printf("Error while parsing (not valid): %q", err) - } - fmt.Printf("Version to string: %q\n", v) - - fmt.Printf("Major: %d\n", v.Major) - fmt.Printf("Minor: %d\n", v.Minor) - fmt.Printf("Patch: %d\n", v.Patch) - - // Prerelease versions - if len(v.Pre) > 0 { - fmt.Println("Prerelease versions:") - for i, pre := range v.Pre { - fmt.Printf("%d: %q\n", i, pre) - } - } - - // Build meta data - if len(v.Build) > 0 { - fmt.Println("Build meta data:") - for i, build := range v.Build { - fmt.Printf("%d: %q\n", i, build) - } - } - - // Make == Parse (Value), New for Pointer - v001, _ := semver.Make("0.0.1") - - fmt.Println("\nUse Version.Compare for comparisons (-1, 0, 1):") - fmt.Printf("%q is greater than %q: Compare == %d\n", v001, v, v001.Compare(v)) - fmt.Printf("%q is less than %q: Compare == %d\n", v, v001, v.Compare(v001)) - fmt.Printf("%q is equal to %q: Compare == %d\n", v, v, v.Compare(v)) - - fmt.Println("\nUse comparison helpers returning booleans:") - fmt.Printf("%q is greater than %q: %t\n", v001, v, v001.GT(v)) - fmt.Printf("%q is greater than equal %q: %t\n", v001, v, v001.GTE(v)) - fmt.Printf("%q is greater than equal %q: %t\n", v, v, v.GTE(v)) - fmt.Printf("%q is less than %q: %t\n", v, v001, v.LT(v001)) - fmt.Printf("%q is less than equal %q: %t\n", v, v001, v.LTE(v001)) - fmt.Printf("%q is less than equal %q: %t\n", v, v, v.LTE(v)) - - fmt.Println("\nManipulate Version in place:") - v.Pre[0], err = semver.NewPRVersion("beta") - if err != nil { - fmt.Printf("Error parsing pre release version: %q", err) - } - fmt.Printf("Version to string: %q\n", v) - - fmt.Println("\nCompare Prerelease versions:") - pre1, _ := semver.NewPRVersion("123") - pre2, _ := semver.NewPRVersion("alpha") - pre3, _ := semver.NewPRVersion("124") - fmt.Printf("%q is less than %q: Compare == %d\n", pre1, pre2, pre1.Compare(pre2)) - fmt.Printf("%q is greater than %q: Compare == %d\n", pre3, pre1, pre3.Compare(pre1)) - fmt.Printf("%q is equal to %q: Compare == %d\n", pre1, pre1, pre1.Compare(pre1)) - - fmt.Println("\nValidate versions:") - v.Build[0] = "?" - - err = v.Validate() - if err != nil { - fmt.Printf("Validation failed: %s\n", err) - } - - fmt.Println("Create valid build meta data:") - b1, _ := semver.NewBuildVersion("build123") - v.Build[0] = b1 - fmt.Printf("Version with new build version %q\n", v) - - _, err = semver.NewBuildVersion("build?123") - if err != nil { - fmt.Printf("Create build version failed: %s\n", err) - } -} diff --git a/src/imagemagick/vendor/github.com/blang/semver/go.mod b/src/imagemagick/vendor/github.com/blang/semver/go.mod deleted file mode 100644 index d008305..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/blang/semver diff --git a/src/imagemagick/vendor/github.com/blang/semver/json_test.go b/src/imagemagick/vendor/github.com/blang/semver/json_test.go deleted file mode 100644 index c635dea..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/json_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package semver - -import ( - "encoding/json" - "strconv" - "testing" -) - -func TestJSONMarshal(t *testing.T) { - versionString := "3.1.4-alpha.1.5.9+build.2.6.5" - v, err := Parse(versionString) - if err != nil { - t.Fatal(err) - } - - versionJSON, err := json.Marshal(v) - if err != nil { - t.Fatal(err) - } - - quotedVersionString := strconv.Quote(versionString) - - if string(versionJSON) != quotedVersionString { - t.Fatalf("JSON marshaled semantic version not equal: expected %q, got %q", quotedVersionString, string(versionJSON)) - } -} - -func TestJSONUnmarshal(t *testing.T) { - versionString := "3.1.4-alpha.1.5.9+build.2.6.5" - quotedVersionString := strconv.Quote(versionString) - - var v Version - if err := json.Unmarshal([]byte(quotedVersionString), &v); err != nil { - t.Fatal(err) - } - - if v.String() != versionString { - t.Fatalf("JSON unmarshaled semantic version not equal: expected %q, got %q", versionString, v.String()) - } - - badVersionString := strconv.Quote("3.1.4.1.5.9.2.6.5-other-digits-of-pi") - if err := json.Unmarshal([]byte(badVersionString), &v); err == nil { - t.Fatal("expected JSON unmarshal error, got nil") - } - - if err := json.Unmarshal([]byte("3.1"), &v); err == nil { - t.Fatal("expected JSON unmarshal error, got nil") - } -} diff --git a/src/imagemagick/vendor/github.com/blang/semver/range_test.go b/src/imagemagick/vendor/github.com/blang/semver/range_test.go deleted file mode 100644 index fc11670..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/range_test.go +++ /dev/null @@ -1,581 +0,0 @@ -package semver - -import ( - "reflect" - "strings" - "testing" -) - -type wildcardTypeTest struct { - input string - wildcardType wildcardType -} - -type comparatorTest struct { - input string - comparator func(comparator) bool -} - -func TestParseComparator(t *testing.T) { - compatorTests := []comparatorTest{ - {">", testGT}, - {">=", testGE}, - {"<", testLT}, - {"<=", testLE}, - {"", testEQ}, - {"=", testEQ}, - {"==", testEQ}, - {"!=", testNE}, - {"!", testNE}, - {"-", nil}, - {"<==", nil}, - {"<<", nil}, - {">>", nil}, - } - - for _, tc := range compatorTests { - if c := parseComparator(tc.input); c == nil { - if tc.comparator != nil { - t.Errorf("Comparator nil for case %q\n", tc.input) - } - } else if !tc.comparator(c) { - t.Errorf("Invalid comparator for case %q\n", tc.input) - } - } -} - -var ( - v1 = MustParse("1.2.2") - v2 = MustParse("1.2.3") - v3 = MustParse("1.2.4") -) - -func testEQ(f comparator) bool { - return f(v1, v1) && !f(v1, v2) -} - -func testNE(f comparator) bool { - return !f(v1, v1) && f(v1, v2) -} - -func testGT(f comparator) bool { - return f(v2, v1) && f(v3, v2) && !f(v1, v2) && !f(v1, v1) -} - -func testGE(f comparator) bool { - return f(v2, v1) && f(v3, v2) && !f(v1, v2) -} - -func testLT(f comparator) bool { - return f(v1, v2) && f(v2, v3) && !f(v2, v1) && !f(v1, v1) -} - -func testLE(f comparator) bool { - return f(v1, v2) && f(v2, v3) && !f(v2, v1) -} - -func TestSplitAndTrim(t *testing.T) { - tests := []struct { - i string - s []string - }{ - {"1.2.3 1.2.3", []string{"1.2.3", "1.2.3"}}, - {" 1.2.3 1.2.3 ", []string{"1.2.3", "1.2.3"}}, // Spaces - {" >= 1.2.3 <= 1.2.3 ", []string{">=1.2.3", "<=1.2.3"}}, // Spaces between operator and version - {"1.2.3 || >=1.2.3 <1.2.3", []string{"1.2.3", "||", ">=1.2.3", "<1.2.3"}}, - {" 1.2.3 || >=1.2.3 <1.2.3 ", []string{"1.2.3", "||", ">=1.2.3", "<1.2.3"}}, - } - - for _, tc := range tests { - p := splitAndTrim(tc.i) - if !reflect.DeepEqual(p, tc.s) { - t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.s, p) - } - } -} - -func TestSplitComparatorVersion(t *testing.T) { - tests := []struct { - i string - p []string - }{ - {">1.2.3", []string{">", "1.2.3"}}, - {">=1.2.3", []string{">=", "1.2.3"}}, - {"<1.2.3", []string{"<", "1.2.3"}}, - {"<=1.2.3", []string{"<=", "1.2.3"}}, - {"1.2.3", []string{"", "1.2.3"}}, - {"=1.2.3", []string{"=", "1.2.3"}}, - {"==1.2.3", []string{"==", "1.2.3"}}, - {"!=1.2.3", []string{"!=", "1.2.3"}}, - {"!1.2.3", []string{"!", "1.2.3"}}, - {"error", nil}, - } - for _, tc := range tests { - if op, v, err := splitComparatorVersion(tc.i); err != nil { - if tc.p != nil { - t.Errorf("Invalid for case %q: Expected %q, got error %q", tc.i, tc.p, err) - } - } else if op != tc.p[0] { - t.Errorf("Invalid operator for case %q: Expected %q, got: %q", tc.i, tc.p[0], op) - } else if v != tc.p[1] { - t.Errorf("Invalid version for case %q: Expected %q, got: %q", tc.i, tc.p[1], v) - } - - } -} - -func TestBuildVersionRange(t *testing.T) { - tests := []struct { - opStr string - vStr string - c func(comparator) bool - v string - }{ - {">", "1.2.3", testGT, "1.2.3"}, - {">=", "1.2.3", testGE, "1.2.3"}, - {"<", "1.2.3", testLT, "1.2.3"}, - {"<=", "1.2.3", testLE, "1.2.3"}, - {"", "1.2.3", testEQ, "1.2.3"}, - {"=", "1.2.3", testEQ, "1.2.3"}, - {"==", "1.2.3", testEQ, "1.2.3"}, - {"!=", "1.2.3", testNE, "1.2.3"}, - {"!", "1.2.3", testNE, "1.2.3"}, - {">>", "1.2.3", nil, ""}, // Invalid comparator - {"=", "invalid", nil, ""}, // Invalid version - } - - for _, tc := range tests { - if r, err := buildVersionRange(tc.opStr, tc.vStr); err != nil { - if tc.c != nil { - t.Errorf("Invalid for case %q: Expected %q, got error %q", strings.Join([]string{tc.opStr, tc.vStr}, ""), tc.v, err) - } - } else if r == nil { - t.Errorf("Invalid for case %q: got nil", strings.Join([]string{tc.opStr, tc.vStr}, "")) - } else { - // test version - if tv := MustParse(tc.v); !r.v.EQ(tv) { - t.Errorf("Invalid for case %q: Expected version %q, got: %q", strings.Join([]string{tc.opStr, tc.vStr}, ""), tv, r.v) - } - // test comparator - if r.c == nil { - t.Errorf("Invalid for case %q: got nil comparator", strings.Join([]string{tc.opStr, tc.vStr}, "")) - continue - } - if !tc.c(r.c) { - t.Errorf("Invalid comparator for case %q\n", strings.Join([]string{tc.opStr, tc.vStr}, "")) - } - } - } - -} - -func TestSplitORParts(t *testing.T) { - tests := []struct { - i []string - o [][]string - }{ - {[]string{">1.2.3", "||", "<1.2.3", "||", "=1.2.3"}, [][]string{ - {">1.2.3"}, - {"<1.2.3"}, - {"=1.2.3"}, - }}, - {[]string{">1.2.3", "<1.2.3", "||", "=1.2.3"}, [][]string{ - {">1.2.3", "<1.2.3"}, - {"=1.2.3"}, - }}, - {[]string{">1.2.3", "||"}, nil}, - {[]string{"||", ">1.2.3"}, nil}, - } - for _, tc := range tests { - o, err := splitORParts(tc.i) - if err != nil && tc.o != nil { - t.Errorf("Unexpected error for case %q: %s", tc.i, err) - } - if !reflect.DeepEqual(tc.o, o) { - t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.o, o) - } - } -} - -func TestGetWildcardType(t *testing.T) { - wildcardTypeTests := []wildcardTypeTest{ - {"x", majorWildcard}, - {"1.x", minorWildcard}, - {"1.2.x", patchWildcard}, - {"fo.o.b.ar", noneWildcard}, - } - - for _, tc := range wildcardTypeTests { - o := getWildcardType(tc.input) - if o != tc.wildcardType { - t.Errorf("Invalid for case: %q: Expected %q, got: %q", tc.input, tc.wildcardType, o) - } - } -} - -func TestCreateVersionFromWildcard(t *testing.T) { - tests := []struct { - i string - s string - }{ - {"1.2.x", "1.2.0"}, - {"1.x", "1.0.0"}, - } - - for _, tc := range tests { - p := createVersionFromWildcard(tc.i) - if p != tc.s { - t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.s, p) - } - } -} - -func TestIncrementMajorVersion(t *testing.T) { - tests := []struct { - i string - s string - }{ - {"1.2.3", "2.2.3"}, - {"1.2", "2.2"}, - {"foo.bar", ""}, - } - - for _, tc := range tests { - p, _ := incrementMajorVersion(tc.i) - if p != tc.s { - t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.s, p) - } - } -} - -func TestIncrementMinorVersion(t *testing.T) { - tests := []struct { - i string - s string - }{ - {"1.2.3", "1.3.3"}, - {"1.2", "1.3"}, - {"foo.bar", ""}, - } - - for _, tc := range tests { - p, _ := incrementMinorVersion(tc.i) - if p != tc.s { - t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.s, p) - } - } -} - -func TestExpandWildcardVersion(t *testing.T) { - tests := []struct { - i [][]string - o [][]string - }{ - {[][]string{{"foox"}}, nil}, - {[][]string{{">=1.2.x"}}, [][]string{{">=1.2.0"}}}, - {[][]string{{"<=1.2.x"}}, [][]string{{"<1.3.0"}}}, - {[][]string{{">1.2.x"}}, [][]string{{">=1.3.0"}}}, - {[][]string{{"<1.2.x"}}, [][]string{{"<1.2.0"}}}, - {[][]string{{"!=1.2.x"}}, [][]string{{"<1.2.0", ">=1.3.0"}}}, - {[][]string{{">=1.x"}}, [][]string{{">=1.0.0"}}}, - {[][]string{{"<=1.x"}}, [][]string{{"<2.0.0"}}}, - {[][]string{{">1.x"}}, [][]string{{">=2.0.0"}}}, - {[][]string{{"<1.x"}}, [][]string{{"<1.0.0"}}}, - {[][]string{{"!=1.x"}}, [][]string{{"<1.0.0", ">=2.0.0"}}}, - {[][]string{{"1.2.x"}}, [][]string{{">=1.2.0", "<1.3.0"}}}, - {[][]string{{"1.x"}}, [][]string{{">=1.0.0", "<2.0.0"}}}, - } - - for _, tc := range tests { - o, _ := expandWildcardVersion(tc.i) - if !reflect.DeepEqual(tc.o, o) { - t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.o, o) - } - } -} - -func TestVersionRangeToRange(t *testing.T) { - vr := versionRange{ - v: MustParse("1.2.3"), - c: compLT, - } - rf := vr.rangeFunc() - if !rf(MustParse("1.2.2")) || rf(MustParse("1.2.3")) { - t.Errorf("Invalid conversion to range func") - } -} - -func TestRangeAND(t *testing.T) { - v := MustParse("1.2.2") - v1 := MustParse("1.2.1") - v2 := MustParse("1.2.3") - rf1 := Range(func(v Version) bool { - return v.GT(v1) - }) - rf2 := Range(func(v Version) bool { - return v.LT(v2) - }) - rf := rf1.AND(rf2) - if rf(v1) { - t.Errorf("Invalid rangefunc, accepted: %s", v1) - } - if rf(v2) { - t.Errorf("Invalid rangefunc, accepted: %s", v2) - } - if !rf(v) { - t.Errorf("Invalid rangefunc, did not accept: %s", v) - } -} - -func TestRangeOR(t *testing.T) { - tests := []struct { - v Version - b bool - }{ - {MustParse("1.2.0"), true}, - {MustParse("1.2.2"), false}, - {MustParse("1.2.4"), true}, - } - v1 := MustParse("1.2.1") - v2 := MustParse("1.2.3") - rf1 := Range(func(v Version) bool { - return v.LT(v1) - }) - rf2 := Range(func(v Version) bool { - return v.GT(v2) - }) - rf := rf1.OR(rf2) - for _, tc := range tests { - if r := rf(tc.v); r != tc.b { - t.Errorf("Invalid for case %q: Expected %t, got %t", tc.v, tc.b, r) - } - } -} - -func TestParseRange(t *testing.T) { - type tv struct { - v string - b bool - } - tests := []struct { - i string - t []tv - }{ - // Simple expressions - {">1.2.3", []tv{ - {"1.2.2", false}, - {"1.2.3", false}, - {"1.2.4", true}, - }}, - {">=1.2.3", []tv{ - {"1.2.3", true}, - {"1.2.4", true}, - {"1.2.2", false}, - }}, - {"<1.2.3", []tv{ - {"1.2.2", true}, - {"1.2.3", false}, - {"1.2.4", false}, - }}, - {"<=1.2.3", []tv{ - {"1.2.2", true}, - {"1.2.3", true}, - {"1.2.4", false}, - }}, - {"1.2.3", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - }}, - {"=1.2.3", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - }}, - {"==1.2.3", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - }}, - {"!=1.2.3", []tv{ - {"1.2.2", true}, - {"1.2.3", false}, - {"1.2.4", true}, - }}, - {"!1.2.3", []tv{ - {"1.2.2", true}, - {"1.2.3", false}, - {"1.2.4", true}, - }}, - // Simple Expression errors - {">>1.2.3", nil}, - {"!1.2.3", nil}, - {"1.0", nil}, - {"string", nil}, - {"", nil}, - {"fo.ob.ar.x", nil}, - // AND Expressions - {">1.2.2 <1.2.4", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - }}, - {"<1.2.2 <1.2.4", []tv{ - {"1.2.1", true}, - {"1.2.2", false}, - {"1.2.3", false}, - {"1.2.4", false}, - }}, - {">1.2.2 <1.2.5 !=1.2.4", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - {"1.2.5", false}, - }}, - {">1.2.2 <1.2.5 !1.2.4", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - {"1.2.5", false}, - }}, - // OR Expressions - {">1.2.2 || <1.2.4", []tv{ - {"1.2.2", true}, - {"1.2.3", true}, - {"1.2.4", true}, - }}, - {"<1.2.2 || >1.2.4", []tv{ - {"1.2.2", false}, - {"1.2.3", false}, - {"1.2.4", false}, - }}, - // Wildcard expressions - {">1.x", []tv{ - {"0.1.9", false}, - {"1.2.6", false}, - {"1.9.0", false}, - {"2.0.0", true}, - }}, - {">1.2.x", []tv{ - {"1.1.9", false}, - {"1.2.6", false}, - {"1.3.0", true}, - }}, - // Combined Expressions - {">1.2.2 <1.2.4 || >=2.0.0", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - {"2.0.0", true}, - {"2.0.1", true}, - }}, - {"1.x || >=2.0.x <2.2.x", []tv{ - {"0.9.2", false}, - {"1.2.2", true}, - {"2.0.0", true}, - {"2.1.8", true}, - {"2.2.0", false}, - }}, - {">1.2.2 <1.2.4 || >=2.0.0 <3.0.0", []tv{ - {"1.2.2", false}, - {"1.2.3", true}, - {"1.2.4", false}, - {"2.0.0", true}, - {"2.0.1", true}, - {"2.9.9", true}, - {"3.0.0", false}, - }}, - } - - for _, tc := range tests { - r, err := ParseRange(tc.i) - if err != nil && tc.t != nil { - t.Errorf("Error parsing range %q: %s", tc.i, err) - continue - } - for _, tvc := range tc.t { - v := MustParse(tvc.v) - if res := r(v); res != tvc.b { - t.Errorf("Invalid for case %q matching %q: Expected %t, got: %t", tc.i, tvc.v, tvc.b, res) - } - } - - } -} - -func TestMustParseRange(t *testing.T) { - testCase := ">1.2.2 <1.2.4 || >=2.0.0 <3.0.0" - r := MustParseRange(testCase) - if !r(MustParse("1.2.3")) { - t.Errorf("Unexpected range behavior on MustParseRange") - } -} - -func TestMustParseRange_panic(t *testing.T) { - defer func() { - if recover() == nil { - t.Errorf("Should have panicked") - } - }() - _ = MustParseRange("invalid version") -} - -func BenchmarkRangeParseSimple(b *testing.B) { - const VERSION = ">1.0.0" - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - ParseRange(VERSION) - } -} - -func BenchmarkRangeParseAverage(b *testing.B) { - const VERSION = ">=1.0.0 <2.0.0" - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - ParseRange(VERSION) - } -} - -func BenchmarkRangeParseComplex(b *testing.B) { - const VERSION = ">=1.0.0 <2.0.0 || >=3.0.1 <4.0.0 !=3.0.3 || >=5.0.0" - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - ParseRange(VERSION) - } -} - -func BenchmarkRangeMatchSimple(b *testing.B) { - const VERSION = ">1.0.0" - r, _ := ParseRange(VERSION) - v := MustParse("2.0.0") - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - r(v) - } -} - -func BenchmarkRangeMatchAverage(b *testing.B) { - const VERSION = ">=1.0.0 <2.0.0" - r, _ := ParseRange(VERSION) - v := MustParse("1.2.3") - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - r(v) - } -} - -func BenchmarkRangeMatchComplex(b *testing.B) { - const VERSION = ">=1.0.0 <2.0.0 || >=3.0.1 <4.0.0 !=3.0.3 || >=5.0.0" - r, _ := ParseRange(VERSION) - v := MustParse("5.0.1") - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - r(v) - } -} diff --git a/src/imagemagick/vendor/github.com/blang/semver/semver_test.go b/src/imagemagick/vendor/github.com/blang/semver/semver_test.go deleted file mode 100644 index 8e5d80c..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/semver_test.go +++ /dev/null @@ -1,518 +0,0 @@ -package semver - -import ( - "testing" -) - -func prstr(s string) PRVersion { - return PRVersion{s, 0, false} -} - -func prnum(i uint64) PRVersion { - return PRVersion{"", i, true} -} - -type formatTest struct { - v Version - result string -} - -var formatTests = []formatTest{ - {Version{1, 2, 3, nil, nil}, "1.2.3"}, - {Version{0, 0, 1, nil, nil}, "0.0.1"}, - {Version{0, 0, 1, []PRVersion{prstr("alpha"), prstr("preview")}, []string{"123", "456"}}, "0.0.1-alpha.preview+123.456"}, - {Version{1, 2, 3, []PRVersion{prstr("alpha"), prnum(1)}, []string{"123", "456"}}, "1.2.3-alpha.1+123.456"}, - {Version{1, 2, 3, []PRVersion{prstr("alpha"), prnum(1)}, nil}, "1.2.3-alpha.1"}, - {Version{1, 2, 3, nil, []string{"123", "456"}}, "1.2.3+123.456"}, - // Prereleases and build metadata hyphens - {Version{1, 2, 3, []PRVersion{prstr("alpha"), prstr("b-eta")}, []string{"123", "b-uild"}}, "1.2.3-alpha.b-eta+123.b-uild"}, - {Version{1, 2, 3, nil, []string{"123", "b-uild"}}, "1.2.3+123.b-uild"}, - {Version{1, 2, 3, []PRVersion{prstr("alpha"), prstr("b-eta")}, nil}, "1.2.3-alpha.b-eta"}, -} - -var tolerantFormatTests = []formatTest{ - {Version{1, 2, 3, nil, nil}, "v1.2.3"}, - {Version{1, 2, 3, nil, nil}, " 1.2.3 "}, - {Version{1, 2, 3, nil, nil}, "01.02.03"}, - {Version{0, 0, 3, nil, nil}, "00.0.03"}, - {Version{1, 2, 0, nil, nil}, "1.2"}, - {Version{1, 0, 0, nil, nil}, "1"}, -} - -func TestStringer(t *testing.T) { - for _, test := range formatTests { - if res := test.v.String(); res != test.result { - t.Errorf("Stringer, expected %q but got %q", test.result, res) - } - } -} - -func TestParse(t *testing.T) { - for _, test := range formatTests { - if v, err := Parse(test.result); err != nil { - t.Errorf("Error parsing %q: %q", test.result, err) - } else if comp := v.Compare(test.v); comp != 0 { - t.Errorf("Parsing, expected %q but got %q, comp: %d ", test.v, v, comp) - } else if err := v.Validate(); err != nil { - t.Errorf("Error validating parsed version %q: %q", test.v, err) - } - } -} - -func TestParseTolerant(t *testing.T) { - for _, test := range tolerantFormatTests { - if v, err := ParseTolerant(test.result); err != nil { - t.Errorf("Error parsing %q: %q", test.result, err) - } else if comp := v.Compare(test.v); comp != 0 { - t.Errorf("Parsing, expected %q but got %q, comp: %d ", test.v, v, comp) - } else if err := v.Validate(); err != nil { - t.Errorf("Error validating parsed version %q: %q", test.v, err) - } - } -} - -func TestMustParse(t *testing.T) { - _ = MustParse("32.2.1-alpha") -} - -func TestMustParse_panic(t *testing.T) { - defer func() { - if recover() == nil { - t.Errorf("Should have panicked") - } - }() - _ = MustParse("invalid version") -} - -func TestValidate(t *testing.T) { - for _, test := range formatTests { - if err := test.v.Validate(); err != nil { - t.Errorf("Error validating %q: %q", test.v, err) - } - } -} - -type compareTest struct { - v1 Version - v2 Version - result int -} - -var compareTests = []compareTest{ - {Version{1, 0, 0, nil, nil}, Version{1, 0, 0, nil, nil}, 0}, - {Version{2, 0, 0, nil, nil}, Version{1, 0, 0, nil, nil}, 1}, - {Version{0, 1, 0, nil, nil}, Version{0, 1, 0, nil, nil}, 0}, - {Version{0, 2, 0, nil, nil}, Version{0, 1, 0, nil, nil}, 1}, - {Version{0, 0, 1, nil, nil}, Version{0, 0, 1, nil, nil}, 0}, - {Version{0, 0, 2, nil, nil}, Version{0, 0, 1, nil, nil}, 1}, - {Version{1, 2, 3, nil, nil}, Version{1, 2, 3, nil, nil}, 0}, - {Version{2, 2, 4, nil, nil}, Version{1, 2, 4, nil, nil}, 1}, - {Version{1, 3, 3, nil, nil}, Version{1, 2, 3, nil, nil}, 1}, - {Version{1, 2, 4, nil, nil}, Version{1, 2, 3, nil, nil}, 1}, - - // Spec Examples #11 - {Version{1, 0, 0, nil, nil}, Version{2, 0, 0, nil, nil}, -1}, - {Version{2, 0, 0, nil, nil}, Version{2, 1, 0, nil, nil}, -1}, - {Version{2, 1, 0, nil, nil}, Version{2, 1, 1, nil, nil}, -1}, - - // Spec Examples #9 - {Version{1, 0, 0, nil, nil}, Version{1, 0, 0, []PRVersion{prstr("alpha")}, nil}, 1}, - {Version{1, 0, 0, []PRVersion{prstr("alpha")}, nil}, Version{1, 0, 0, []PRVersion{prstr("alpha"), prnum(1)}, nil}, -1}, - {Version{1, 0, 0, []PRVersion{prstr("alpha"), prnum(1)}, nil}, Version{1, 0, 0, []PRVersion{prstr("alpha"), prstr("beta")}, nil}, -1}, - {Version{1, 0, 0, []PRVersion{prstr("alpha"), prstr("beta")}, nil}, Version{1, 0, 0, []PRVersion{prstr("beta")}, nil}, -1}, - {Version{1, 0, 0, []PRVersion{prstr("beta")}, nil}, Version{1, 0, 0, []PRVersion{prstr("beta"), prnum(2)}, nil}, -1}, - {Version{1, 0, 0, []PRVersion{prstr("beta"), prnum(2)}, nil}, Version{1, 0, 0, []PRVersion{prstr("beta"), prnum(11)}, nil}, -1}, - {Version{1, 0, 0, []PRVersion{prstr("beta"), prnum(11)}, nil}, Version{1, 0, 0, []PRVersion{prstr("rc"), prnum(1)}, nil}, -1}, - {Version{1, 0, 0, []PRVersion{prstr("rc"), prnum(1)}, nil}, Version{1, 0, 0, nil, nil}, -1}, - - // Ignore Build metadata - {Version{1, 0, 0, nil, []string{"1", "2", "3"}}, Version{1, 0, 0, nil, nil}, 0}, -} - -func TestCompare(t *testing.T) { - for _, test := range compareTests { - if res := test.v1.Compare(test.v2); res != test.result { - t.Errorf("Comparing %q : %q, expected %d but got %d", test.v1, test.v2, test.result, res) - } - //Test counterpart - if res := test.v2.Compare(test.v1); res != -test.result { - t.Errorf("Comparing %q : %q, expected %d but got %d", test.v2, test.v1, -test.result, res) - } - } -} - -type wrongformatTest struct { - v *Version - str string -} - -var wrongformatTests = []wrongformatTest{ - {nil, ""}, - {nil, "."}, - {nil, "1."}, - {nil, ".1"}, - {nil, "a.b.c"}, - {nil, "1.a.b"}, - {nil, "1.1.a"}, - {nil, "1.a.1"}, - {nil, "a.1.1"}, - {nil, ".."}, - {nil, "1.."}, - {nil, "1.1."}, - {nil, "1..1"}, - {nil, "1.1.+123"}, - {nil, "1.1.-beta"}, - {nil, "-1.1.1"}, - {nil, "1.-1.1"}, - {nil, "1.1.-1"}, - // giant numbers - {nil, "20000000000000000000.1.1"}, - {nil, "1.20000000000000000000.1"}, - {nil, "1.1.20000000000000000000"}, - {nil, "1.1.1-20000000000000000000"}, - // Leading zeroes - {nil, "01.1.1"}, - {nil, "001.1.1"}, - {nil, "1.01.1"}, - {nil, "1.001.1"}, - {nil, "1.1.01"}, - {nil, "1.1.001"}, - {nil, "1.1.1-01"}, - {nil, "1.1.1-001"}, - {nil, "1.1.1-beta.01"}, - {nil, "1.1.1-beta.001"}, - {&Version{0, 0, 0, []PRVersion{prstr("!")}, nil}, "0.0.0-!"}, - {&Version{0, 0, 0, nil, []string{"!"}}, "0.0.0+!"}, - // empty prversion - {&Version{0, 0, 0, []PRVersion{prstr(""), prstr("alpha")}, nil}, "0.0.0-.alpha"}, - // empty build meta data - {&Version{0, 0, 0, []PRVersion{prstr("alpha")}, []string{""}}, "0.0.0-alpha+"}, - {&Version{0, 0, 0, []PRVersion{prstr("alpha")}, []string{"test", ""}}, "0.0.0-alpha+test."}, -} - -func TestWrongFormat(t *testing.T) { - for _, test := range wrongformatTests { - - if res, err := Parse(test.str); err == nil { - t.Errorf("Parsing wrong format version %q, expected error but got %q", test.str, res) - } - - if test.v != nil { - if err := test.v.Validate(); err == nil { - t.Errorf("Validating wrong format version %q (%q), expected error", test.v, test.str) - } - } - } -} - -var wrongTolerantFormatTests = []wrongformatTest{ - {nil, "1.0+abc"}, - {nil, "1.0-rc.1"}, -} - -func TestWrongTolerantFormat(t *testing.T) { - for _, test := range wrongTolerantFormatTests { - if res, err := ParseTolerant(test.str); err == nil { - t.Errorf("Parsing wrong format version %q, expected error but got %q", test.str, res) - } - } -} - -func TestCompareHelper(t *testing.T) { - v := Version{1, 0, 0, []PRVersion{prstr("alpha")}, nil} - v1 := Version{1, 0, 0, nil, nil} - if !v.EQ(v) { - t.Errorf("%q should be equal to %q", v, v) - } - if !v.Equals(v) { - t.Errorf("%q should be equal to %q", v, v) - } - if !v1.NE(v) { - t.Errorf("%q should not be equal to %q", v1, v) - } - if !v.GTE(v) { - t.Errorf("%q should be greater than or equal to %q", v, v) - } - if !v.LTE(v) { - t.Errorf("%q should be less than or equal to %q", v, v) - } - if !v.LT(v1) { - t.Errorf("%q should be less than %q", v, v1) - } - if !v.LTE(v1) { - t.Errorf("%q should be less than or equal %q", v, v1) - } - if !v.LE(v1) { - t.Errorf("%q should be less than or equal %q", v, v1) - } - if !v1.GT(v) { - t.Errorf("%q should be greater than %q", v1, v) - } - if !v1.GTE(v) { - t.Errorf("%q should be greater than or equal %q", v1, v) - } - if !v1.GE(v) { - t.Errorf("%q should be greater than or equal %q", v1, v) - } -} - -const ( - MAJOR = iota - MINOR - PATCH -) - -type incrementTest struct { - version Version - incrementType int - expectingError bool - expectedVersion Version -} - -var incrementTests = []incrementTest{ - {Version{1, 2, 3, nil, nil}, PATCH, false, Version{1, 2, 4, nil, nil}}, - {Version{1, 2, 3, nil, nil}, MINOR, false, Version{1, 3, 0, nil, nil}}, - {Version{1, 2, 3, nil, nil}, MAJOR, false, Version{2, 0, 0, nil, nil}}, - {Version{0, 1, 2, nil, nil}, PATCH, true, Version{}}, - {Version{0, 1, 2, nil, nil}, MINOR, true, Version{}}, - {Version{0, 1, 2, nil, nil}, MAJOR, true, Version{}}, -} - -func TestIncrements(t *testing.T) { - for _, test := range incrementTests { - var originalVersion = Version{ - test.version.Major, - test.version.Minor, - test.version.Patch, - test.version.Pre, - test.version.Build, - } - var err error - switch test.incrementType { - case PATCH: - err = test.version.IncrementPatch() - case MINOR: - err = test.version.IncrementMinor() - case MAJOR: - err = test.version.IncrementMajor() - } - if test.expectingError { - if err == nil { - t.Errorf("Increment version %q, expecting error, got %q", test.version, err) - } - if test.version.NE(originalVersion) { - t.Errorf("Increment version, expecting %q, got %q", test.expectedVersion, test.version) - } - } else { - if (err != nil) && !test.expectingError { - t.Errorf("Increment version %q, not expecting error, got %q", test.version, err) - } - if test.version.NE(test.expectedVersion) { - t.Errorf("Increment version, expecting %q, got %q", test.expectedVersion, test.version) - } - } - } -} - -func TestPreReleaseVersions(t *testing.T) { - p1, err := NewPRVersion("123") - if !p1.IsNumeric() { - t.Errorf("Expected numeric prversion, got %q", p1) - } - if p1.VersionNum != 123 { - t.Error("Wrong prversion number") - } - if err != nil { - t.Errorf("Not expected error %q", err) - } - p2, err := NewPRVersion("alpha") - if p2.IsNumeric() { - t.Errorf("Expected non-numeric prversion, got %q", p2) - } - if p2.VersionStr != "alpha" { - t.Error("Wrong prversion string") - } - if err != nil { - t.Errorf("Not expected error %q", err) - } -} - -func TestBuildMetaDataVersions(t *testing.T) { - _, err := NewBuildVersion("123") - if err != nil { - t.Errorf("Unexpected error %q", err) - } - - _, err = NewBuildVersion("build") - if err != nil { - t.Errorf("Unexpected error %q", err) - } - - _, err = NewBuildVersion("test?") - if err == nil { - t.Error("Expected error, got none") - } - - _, err = NewBuildVersion("") - if err == nil { - t.Error("Expected error, got none") - } -} - -func TestNewHelper(t *testing.T) { - v, err := New("1.2.3") - if err != nil { - t.Fatalf("Unexpected error %q", err) - } - - // New returns pointer - if v == nil { - t.Fatal("Version is nil") - } - if v.Compare(Version{1, 2, 3, nil, nil}) != 0 { - t.Fatal("Unexpected comparison problem") - } -} - -func TestMakeHelper(t *testing.T) { - v, err := Make("1.2.3") - if err != nil { - t.Fatalf("Unexpected error %q", err) - } - if v.Compare(Version{1, 2, 3, nil, nil}) != 0 { - t.Fatal("Unexpected comparison problem") - } -} - -func BenchmarkParseSimple(b *testing.B) { - const VERSION = "0.0.1" - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - Parse(VERSION) - } -} - -func BenchmarkParseComplex(b *testing.B) { - const VERSION = "0.0.1-alpha.preview+123.456" - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - Parse(VERSION) - } -} - -func BenchmarkParseAverage(b *testing.B) { - l := len(formatTests) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - Parse(formatTests[n%l].result) - } -} - -func BenchmarkParseTolerantAverage(b *testing.B) { - l := len(tolerantFormatTests) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - ParseTolerant(tolerantFormatTests[n%l].result) - } -} - -func BenchmarkStringSimple(b *testing.B) { - const VERSION = "0.0.1" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - _ = v.String() - } -} - -func BenchmarkStringLarger(b *testing.B) { - const VERSION = "11.15.2012" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - _ = v.String() - } -} - -func BenchmarkStringComplex(b *testing.B) { - const VERSION = "0.0.1-alpha.preview+123.456" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - _ = v.String() - } -} - -func BenchmarkStringAverage(b *testing.B) { - l := len(formatTests) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - _ = formatTests[n%l].v.String() - } -} - -func BenchmarkValidateSimple(b *testing.B) { - const VERSION = "0.0.1" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - v.Validate() - } -} - -func BenchmarkValidateComplex(b *testing.B) { - const VERSION = "0.0.1-alpha.preview+123.456" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - v.Validate() - } -} - -func BenchmarkValidateAverage(b *testing.B) { - l := len(formatTests) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - formatTests[n%l].v.Validate() - } -} - -func BenchmarkCompareSimple(b *testing.B) { - const VERSION = "0.0.1" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - v.Compare(v) - } -} - -func BenchmarkCompareComplex(b *testing.B) { - const VERSION = "0.0.1-alpha.preview+123.456" - v, _ := Parse(VERSION) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - v.Compare(v) - } -} - -func BenchmarkCompareAverage(b *testing.B) { - l := len(compareTests) - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - compareTests[n%l].v1.Compare((compareTests[n%l].v2)) - } -} diff --git a/src/imagemagick/vendor/github.com/blang/semver/sort_test.go b/src/imagemagick/vendor/github.com/blang/semver/sort_test.go deleted file mode 100644 index 6889397..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/sort_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package semver - -import ( - "reflect" - "testing" -) - -func TestSort(t *testing.T) { - v100, _ := Parse("1.0.0") - v010, _ := Parse("0.1.0") - v001, _ := Parse("0.0.1") - versions := []Version{v010, v100, v001} - Sort(versions) - - correct := []Version{v001, v010, v100} - if !reflect.DeepEqual(versions, correct) { - t.Fatalf("Sort returned wrong order: %s", versions) - } -} - -func BenchmarkSort(b *testing.B) { - v100, _ := Parse("1.0.0") - v010, _ := Parse("0.1.0") - v001, _ := Parse("0.0.1") - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - Sort([]Version{v010, v100, v001}) - } -} diff --git a/src/imagemagick/vendor/github.com/blang/semver/sql_test.go b/src/imagemagick/vendor/github.com/blang/semver/sql_test.go deleted file mode 100644 index ebf48b5..0000000 --- a/src/imagemagick/vendor/github.com/blang/semver/sql_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package semver - -import ( - "testing" -) - -type scanTest struct { - val interface{} - shouldError bool - expected string -} - -var scanTests = []scanTest{ - {"1.2.3", false, "1.2.3"}, - {[]byte("1.2.3"), false, "1.2.3"}, - {7, true, ""}, - {7e4, true, ""}, - {true, true, ""}, -} - -func TestScanString(t *testing.T) { - for _, tc := range scanTests { - s := &Version{} - err := s.Scan(tc.val) - if tc.shouldError { - if err == nil { - t.Fatalf("Scan did not return an error on %v (%T)", tc.val, tc.val) - } - } else { - if err != nil { - t.Fatalf("Scan returned an unexpected error: %s (%T) on %v (%T)", tc.val, tc.val, tc.val, tc.val) - } - if val, _ := s.Value(); val != tc.expected { - t.Errorf("Wrong Value returned, expected %q, got %q", tc.expected, val) - } - } - } -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/ansicleaner/buffer.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/ansicleaner/buffer.go deleted file mode 100644 index fb0af2a..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/ansicleaner/buffer.go +++ /dev/null @@ -1,20 +0,0 @@ -package ansicleaner - -import ( - "io" - "strings" -) - -type bufferCleaner struct { - w io.Writer - replacer *strings.Replacer -} - -func New(w io.Writer) io.Writer { - replacer := strings.NewReplacer("\033[31;1m", "", "\033[33;1m", "", "\033[34;1m", "", "\033[0m", "") - return &bufferCleaner{w: w, replacer: replacer} -} - -func (b *bufferCleaner) Write(bytes []byte) (int, error) { - return b.replacer.WriteString(b.w, string(bytes)) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/data.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/data.go deleted file mode 100644 index 4ebb21e..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/data.go +++ /dev/null @@ -1,89 +0,0 @@ -package bratshelper - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - "sync" - - "github.com/cloudfoundry/libbuildpack/cutlass" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - yaml "gopkg.in/yaml.v2" -) - -type BpData struct { - BpVersion string - BpLanguage string - BpDir string - Cached string - CachedFile string - Uncached string - UncachedFile string -} - -var Data BpData - -func InitBpData(stack string, stackAssociationSupported bool) *BpData { - cutlass.SeedRandom() - - Data.BpVersion = cutlass.RandStringRunes(6) - - var err error - Data.BpDir, err = cutlass.FindRoot() - Expect(err).NotTo(HaveOccurred()) - - file, err := ioutil.ReadFile(filepath.Join(Data.BpDir, "manifest.yml")) - Expect(err).ToNot(HaveOccurred()) - obj := make(map[string]interface{}) - Expect(yaml.Unmarshal(file, &obj)).To(Succeed()) - - var ok bool - Data.BpLanguage, ok = obj["language"].(string) - Expect(ok).To(BeTrue()) - bpLanguage := strings.Replace(Data.BpLanguage, "-", "_", -1) - - Data.Cached = "brats_" + bpLanguage + "_cached_" + Data.BpVersion - Data.Uncached = "brats_" + bpLanguage + "_uncached_" + Data.BpVersion - - var wg sync.WaitGroup - wg.Add(2) - go func() { - defer wg.Done() - defer GinkgoRecover() - fmt.Fprintln(os.Stderr, "Start build cached buildpack") - cachedBuildpack, err := cutlass.PackageUniquelyVersionedBuildpackExtra(Data.Cached, Data.BpVersion, stack, true, stackAssociationSupported) - Expect(err).NotTo(HaveOccurred()) - Data.CachedFile = cachedBuildpack.File - fmt.Fprintln(os.Stderr, "Finish cached buildpack") - }() - go func() { - defer wg.Done() - defer GinkgoRecover() - fmt.Fprintln(os.Stderr, "Start build uncached buildpack") - uncachedBuildpack, err := cutlass.PackageUniquelyVersionedBuildpackExtra(Data.Uncached, Data.BpVersion, stack, false, stackAssociationSupported) - Expect(err).NotTo(HaveOccurred()) - Data.UncachedFile = uncachedBuildpack.File - fmt.Fprintln(os.Stderr, "Finish uncached buildpack") - }() - wg.Wait() - - Data.Cached = Data.Cached + "_buildpack" - Data.Uncached = Data.Uncached + "_buildpack" - - return &Data -} - -func (d *BpData) Marshal() []byte { - data, err := json.Marshal(Data) - Expect(err).NotTo(HaveOccurred()) - return data -} - -func (d *BpData) Unmarshal(data []byte) { - err := json.Unmarshal(data, d) - Expect(err).NotTo(HaveOccurred()) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/language.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/language.go deleted file mode 100644 index ba85d2d..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/language.go +++ /dev/null @@ -1,40 +0,0 @@ -package bratshelper - -import ( - "io/ioutil" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack/cutlass" - . "github.com/onsi/gomega" - yaml "gopkg.in/yaml.v2" -) - -var cachedLanguage string - -func bpLanguage() string { - if cachedLanguage == "" { - file, err := ioutil.ReadFile(filepath.Join(bpDir(), "manifest.yml")) - Expect(err).ToNot(HaveOccurred()) - obj := make(map[string]interface{}) - Expect(yaml.Unmarshal(file, &obj)).To(Succeed()) - var ok bool - cachedLanguage, ok = obj["language"].(string) - Expect(ok).To(BeTrue()) - } - return cachedLanguage -} - -func GenBpName(name string) string { - return "brats_" + bpLanguage() + "_" + name + "_" + cutlass.RandStringRunes(6) -} - -var cachedBpDir string - -func bpDir() string { - if cachedBpDir == "" { - var err error - cachedBpDir, err = cutlass.FindRoot() - Expect(err).ToNot(HaveOccurred()) - } - return cachedBpDir -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/modify.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/modify.go deleted file mode 100644 index 8d3b2a2..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/modify.go +++ /dev/null @@ -1,137 +0,0 @@ -package bratshelper - -import ( - "archive/zip" - "bytes" - "io" - "io/ioutil" - "os" - - yaml "gopkg.in/yaml.v2" -) - -func ModifyBuildpack(path string, cb func(path string, r io.Reader) (io.Reader, error)) (string, error) { - if file, err := modifyZipfile(path, cb); err != nil { - return file, err - } else { - if err := os.Rename(file, file+".zip"); err != nil { - return "", err - } - return file + ".zip", nil - } -} - -func ModifyBuildpackManifest(path string, cb func(*Manifest)) (string, error) { - return ModifyBuildpack(path, func(path string, r io.Reader) (io.Reader, error) { - if path == "manifest.yml" { - if r, err := changeManifest(r, cb); err != nil { - return nil, err - } else { - return r, nil - } - } - return r, nil - }) -} - -type Manifest struct { - Stack string `yaml:"stack"` - Language string `yaml:"language"` - DefaultVersions []*struct { - Name string `yaml:"name"` - Version string `yaml:"version"` - } `yaml:"default_versions"` - PrePackage string `yaml:"pre_package"` - DependencyDeprecationDates []*struct { - VersionLine string `yaml:"version_line"` - Name string `yaml:"name"` - Date string `yaml:"date"` - Link string `yaml:"link"` - Match string `yaml:"match,omitempty"` // CompileExtensions - } `yaml:"dependency_deprecation_dates"` - Dependencies []*struct { - Name string `yaml:"name"` - Version string `yaml:"version"` - URI string `yaml:"uri"` - Md5 string `yaml:"md5,omitempty"` - Sha256 string `yaml:"sha256,omitempty"` - CfStacks []string `yaml:"cf_stacks"` - Modules []string `yaml:"modules,omitempty"` // CompileExtensions PHP - } `yaml:"dependencies"` - IncludeFiles []string `yaml:"include_files,omitempty"` - ExcludeFiles []string `yaml:"exclude_files,omitempty"` // CompileExtensions - UrlToDependencyMap []interface{} `yaml:"url_to_dependency_map,omitempty"` // CompileExtensions -} - -func modifyZipfile(path string, cb func(path string, r io.Reader) (io.Reader, error)) (string, error) { - r, err := zip.OpenReader(path) - if err != nil { - return "", err - } - defer r.Close() - - newfile, err := ioutil.TempFile("", "buildpack.zip") - if err != nil { - return "", err - } - defer newfile.Close() - - zipWriter := zip.NewWriter(newfile) - defer zipWriter.Close() - - for _, f := range r.File { - rc, err := f.Open() - if err != nil { - return "", err - } - - if f.FileInfo().IsDir() { - // Nothing - } else { - header, err := zip.FileInfoHeader(f.FileInfo()) - if err != nil { - return "", err - } - header.Method = zip.Deflate - header.Name = f.Name - - writer, err := zipWriter.CreateHeader(header) - if err != nil { - return "", err - } - - rc, err := cb(f.Name, rc) - if err != nil { - return "", err - } - - _, err = io.Copy(writer, rc) - if err != nil { - return "", err - } - } - rc.Close() - } - - return newfile.Name(), nil -} - -func changeManifest(r io.Reader, cb func(*Manifest)) (io.Reader, error) { - data, err := ioutil.ReadAll(r) - if err != nil { - return nil, err - } - - obj := Manifest{} - if err := yaml.Unmarshal(data, &obj); err != nil { - return nil, err - } - - cb(&obj) - - if data, err := yaml.Marshal(&obj); err != nil { - return nil, err - } else { - return bytes.NewReader(data), nil - } -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/tests.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/tests.go deleted file mode 100644 index 2c49581..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/tests.go +++ /dev/null @@ -1,399 +0,0 @@ -package bratshelper - -import ( - "archive/tar" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "net/url" - "os" - "os/exec" - "path/filepath" - "strings" - "time" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/cutlass" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func defaultCleanup(app *cutlass.App) { - DestroyApp(app) - os.RemoveAll(app.Path) -} - -func UnbuiltBuildpack(depName string, copyBrats func(string) *cutlass.App) { - Context("Unbuilt buildpack (eg github)", func() { - var ( - bpName string - app *cutlass.App - ) - BeforeEach(func() { - bpName = GenBpName("unbuilt") - app = copyBrats("") - app.Buildpacks = []string{bpName + "_buildpack"} - cmd := exec.Command("git", "archive", "-o", filepath.Join("/tmp", bpName+".zip"), "HEAD") - cmd.Dir = Data.BpDir - Expect(cmd.Run()).To(Succeed()) - Expect(cutlass.CreateOrUpdateBuildpack(bpName, filepath.Join("/tmp", bpName+".zip"), "")).To(Succeed()) - Expect(os.Remove(filepath.Join("/tmp", bpName+".zip"))).To(Succeed()) - }) - AfterEach(func() { - defaultCleanup(app) - Expect(cutlass.DeleteBuildpack(bpName)).To(Succeed()) - }) - - It("runs", func() { - PushApp(app) - Expect(app.Stdout.String()).To(ContainSubstring("-----> Download go ")) - - if depName != "" { - Expect(app.Stdout.String()).To(ContainSubstring("Installing " + depName)) - } - Expect(app.GetBody("/")).To(ContainSubstring("Hello World!")) - }) - }) -} - -func DeployingAnAppWithAnUpdatedVersionOfTheSameBuildpack(copyBrats func(string) *cutlass.App) { - Describe("deploying an app with an updated version of the same buildpack", func() { - var ( - bpName, stack string - app *cutlass.App - ) - BeforeEach(func() { - bpName = GenBpName("changing") - app = copyBrats("") - app.Buildpacks = []string{bpName + "_buildpack"} - stackAssociationSupported, err := cutlass.ApiGreaterThan("2.113.0") - Expect(err).ToNot(HaveOccurred()) - if stackAssociationSupported { - stack = app.Stack - } else { - stack = "" - } - }) - AfterEach(func() { - defaultCleanup(app) - Expect(cutlass.DeleteBuildpack(bpName)).To(Succeed()) - // With stacks, creating the buildpack twice will result in a second record, one with `nil` stack. - // We need to clean up both. - if count, err := cutlass.CountBuildpack(bpName); err == nil && count > 0 { - Expect(cutlass.DeleteBuildpack(bpName)).To(Succeed(), "Attempted to delete buildpack %s", bpName) - } - // LTS errors when running `cf buildpacks`. Ignore that output. - count, err := cutlass.CountBuildpack(bpName) - if err == nil { - Expect(count).To(BeZero(), "There are %d %s buildpacks", count, bpName) - } - }) - - It("prints useful warning message to stdout", func() { - Expect(cutlass.CreateOrUpdateBuildpack(bpName, Data.UncachedFile, stack)).To(Succeed()) - PushApp(app) - Expect(app.Stdout.String()).ToNot(ContainSubstring("buildpack version changed from")) - - newFile, err := ModifyBuildpack(Data.UncachedFile, func(path string, r io.Reader) (io.Reader, error) { - if path == "VERSION" { - return strings.NewReader("NewVersion"), nil - } - return r, nil - }) - Expect(err).ToNot(HaveOccurred()) - - Expect(cutlass.CreateOrUpdateBuildpack(bpName, newFile, stack)).To(Succeed(), "Could not create or update %s on %s", bpName, stack) - PushApp(app) - Expect(app.Stdout.String()).To(MatchRegexp(`buildpack version changed from (\S+) to NewVersion`)) - }) - }) -} - -func StagingWithBuildpackThatSetsEOL(depName string, copyBrats func(string) *cutlass.App) { - Describe("staging with "+depName+" buildpack that sets EOL on dependency", func() { - var ( - eolDate, buildpackFile, bpName, stack string - app *cutlass.App - ) - JustBeforeEach(func() { - eolDate = time.Now().AddDate(0, 0, 10).Format("2006-01-02") - file, err := ModifyBuildpackManifest(buildpackFile, func(m *Manifest) { - for _, eol := range m.DependencyDeprecationDates { - if eol.Name == depName { - eol.Date = eolDate - } - } - }) - Expect(err).ToNot(HaveOccurred()) - bpName = GenBpName("eol") - app = copyBrats("") - app.Buildpacks = []string{bpName + "_buildpack"} - stackAssociationSupported, err := cutlass.ApiGreaterThan("2.113.0") - Expect(err).ToNot(HaveOccurred()) - if stackAssociationSupported { - stack = app.Stack - } else { - stack = "" - } - - Expect(cutlass.CreateOrUpdateBuildpack(bpName, file, stack)).To(Succeed()) - os.Remove(file) - - PushApp(app) - }) - AfterEach(func() { - defaultCleanup(app) - Expect(cutlass.DeleteBuildpack(bpName)).To(Succeed()) - }) - - Context("using an uncached buildpack", func() { - BeforeEach(func() { - buildpackFile = Data.UncachedFile - }) - It("warns about end of life", func() { - Expect(app.Stdout.String()).To(MatchRegexp(`WARNING.*` + depName + ` \S+ will no longer be available in new buildpacks released after`)) - }) - }) - - Context("using a cached buildpack", func() { - BeforeEach(func() { - buildpackFile = Data.CachedFile - }) - It("warns about end of life", func() { - Expect(app.Stdout.String()).To(MatchRegexp(`WARNING.*` + depName + ` \S+ will no longer be available in new buildpacks released after`)) - }) - }) - }) -} - -func StagingWithADepThatIsNotTheLatestConstrained(depName string, versionConstraint string, copyBrats func(string) *cutlass.App) { - Describe("staging with a version of "+depName+" that is not the latest patch release in the manifest", func() { - var app *cutlass.App - BeforeEach(func() { - manifest, err := libbuildpack.NewManifest(Data.BpDir, nil, time.Now()) - Expect(err).ToNot(HaveOccurred(), "Making new manifest from %s: error is %v", Data.BpDir, err) - versions, err := libbuildpack.FindMatchingVersions(versionConstraint, manifest.AllDependencyVersions(depName)) - Expect(err).ToNot(HaveOccurred(), "Finding matching version: error is %v", err) - app = copyBrats(versions[0]) - app.Buildpacks = []string{Data.Cached} - PushApp(app) - }) - AfterEach(func() { - defaultCleanup(app) - }) - - It("logs a warning that tells the user to upgrade the dependency", func() { - Expect(app.Stdout.String()).To(MatchRegexp("WARNING.*A newer version of " + depName + " is available in this buildpack")) - }) - }) -} - -func StagingWithADepThatIsNotTheLatest(depName string, copyBrats func(string) *cutlass.App) { - StagingWithADepThatIsNotTheLatestConstrained(depName, "x", copyBrats) -} - -func StagingWithCustomBuildpackWithCredentialsInDependencies(copyBrats func(string) *cutlass.App) { - Describe("staging with custom buildpack that uses credentials in manifest dependency uris", func() { - var ( - buildpackFile, bpName, stack, username, password string - app *cutlass.App - ) - JustBeforeEach(func() { - file, err := ModifyBuildpackManifest(buildpackFile, func(m *Manifest) { - for _, d := range m.Dependencies { - uri, err := url.Parse(d.URI) - if proxyHost, ok := os.LookupEnv("PROXY_HOST"); ok { - uri.Host = proxyHost - } - if proxyPort, ok := os.LookupEnv("PROXY_PORT"); ok { - uri.Host += ":" + proxyPort - } - if proxyScheme, ok := os.LookupEnv("PROXY_SCHEME"); ok { - uri.Scheme = proxyScheme - } - if proxyUsername, ok := os.LookupEnv("PROXY_USERNAME"); ok { - username = proxyUsername - } else { - username = "login" - } - if proxyPassword, ok := os.LookupEnv("PROXY_PASSWORD"); ok { - password = proxyPassword - } else { - password = "password" - } - uri.User = url.UserPassword(username, password) - Expect(err).ToNot(HaveOccurred()) - d.URI = uri.String() - } - }) - Expect(err).ToNot(HaveOccurred()) - bpName = GenBpName("eol") - - app = copyBrats("") - app.Buildpacks = []string{bpName + "_buildpack"} - - stackAssociationSupported, err := cutlass.ApiGreaterThan("2.113.0") - Expect(err).ToNot(HaveOccurred()) - if stackAssociationSupported { - stack = app.Stack - } else { - stack = "" - } - - Expect(cutlass.CreateOrUpdateBuildpack(bpName, file, stack)).To(Succeed()) - os.Remove(file) - PushApp(app) - }) - AfterEach(func() { - defaultCleanup(app) - Expect(cutlass.DeleteBuildpack(bpName)).To(Succeed()) - }) - Context("using an uncached buildpack", func() { - BeforeEach(func() { - buildpackFile = Data.UncachedFile - }) - It("does not include credentials in logged dependency uris", func() { - Expect(app.Stdout.String()).To(MatchRegexp(`\[.*-redacted-:-redacted-.*\]`)) - Expect(app.Stdout.String()).ToNot(ContainSubstring(username)) - Expect(app.Stdout.String()).ToNot(ContainSubstring(password)) - }) - }) - }) -} - -func DeployAppWithExecutableProfileScript(depName string, copyBrats func(string) *cutlass.App) { - Describe("deploying an app that has an executable .profile script", func() { - var app *cutlass.App - BeforeEach(func() { - if depName != "" { - manifest, err := libbuildpack.NewManifest(Data.BpDir, nil, time.Now()) - Expect(err).ToNot(HaveOccurred()) - dep, err := manifest.DefaultVersion(depName) - Expect(err).ToNot(HaveOccurred()) - - app = copyBrats(dep.Version) - } else { - app = copyBrats("") - } - AddDotProfileScriptToApp(app.Path) - app.Buildpacks = []string{Data.Cached} - PushApp(app) - }) - AfterEach(func() { - defaultCleanup(app) - }) - - It("executes the .profile script", func() { - Expect(app.Stdout.String()).To(ContainSubstring("PROFILE_SCRIPT_IS_PRESENT_AND_RAN")) - }) - It("does not let me view the .profile script", func() { - _, headers, err := app.Get("/.profile", map[string]string{}) - Expect(err).ToNot(HaveOccurred()) - Expect(headers).To(HaveKeyWithValue("StatusCode", []string{"404"})) - }) - }) -} - -func DeployAnAppWithSensitiveEnvironmentVariables(copyBrats func(string) *cutlass.App) { - Describe("deploying an app that has sensitive environment variables", func() { - var app *cutlass.App - BeforeEach(func() { - app = copyBrats("") - app.Buildpacks = []string{Data.Cached} - app.SetEnv("MY_SPECIAL_VAR", "SUPER SENSITIVE DATA") - PushApp(app) - }) - AfterEach(func() { - defaultCleanup(app) - }) - - It("will not write credentials to the app droplet", func() { - Expect(app.DownloadDroplet(filepath.Join(app.Path, "droplet.tgz"))).To(Succeed()) - file, err := os.Open(filepath.Join(app.Path, "droplet.tgz")) - Expect(err).ToNot(HaveOccurred()) - defer file.Close() - gz, err := gzip.NewReader(file) - Expect(err).ToNot(HaveOccurred()) - defer gz.Close() - tr := tar.NewReader(gz) - - for { - hdr, err := tr.Next() - if err == io.EOF { - break - } - b, err := ioutil.ReadAll(tr) - for _, content := range []string{"MY_SPECIAL_VAR", "SUPER SENSITIVE DATA"} { - if strings.Contains(string(b), content) { - Fail(fmt.Sprintf("Found sensitive string %s in %s", content, hdr.Name)) - } - } - } - }) - }) -} - -func ForAllSupportedVersions(depName string, copyBrats func(string) *cutlass.App, runTests func(string, *cutlass.App)) { - Describe("For all supported "+depName+" versions", func() { - bpDir, err := cutlass.FindRoot() - if err != nil { - panic(err) - } - manifest, err := libbuildpack.NewManifest(bpDir, nil, time.Now()) - if err != nil { - panic(err) - } - versions := manifest.AllDependencyVersions(depName) - - var app *cutlass.App - AfterEach(func() { - defaultCleanup(app) - }) - - for _, v := range versions { - version := v - It("with "+depName+" "+version, func() { - app = copyBrats(version) - app.Buildpacks = []string{Data.Cached} - - runTests(version, app) - }) - } - }) -} - -func ForAllSupportedVersions2(depName1, depName2 string, compatible func(string, string) bool, itString string, copyBrats func(string, string) *cutlass.App, runTests func(string, string, *cutlass.App)) { - Describe("For all supported "+depName1+" and "+depName2+" versions", func() { - bpDir, err := cutlass.FindRoot() - if err != nil { - panic(err) - } - manifest, err := libbuildpack.NewManifest(bpDir, nil, time.Now()) - if err != nil { - panic(err) - } - versions1 := manifest.AllDependencyVersions(depName1) - versions2 := manifest.AllDependencyVersions(depName2) - - var app *cutlass.App - AfterEach(func() { - defaultCleanup(app) - }) - - for _, v1 := range versions1 { - version1 := v1 - for _, v2 := range versions2 { - version2 := v2 - if compatible(v1, v2) { - It(fmt.Sprintf(itString, version1, version2), func() { - app = copyBrats(version1, version2) - app.Buildpacks = []string{Data.Cached} - - runTests(version1, version2, app) - }) - } - } - } - }) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/utils.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/utils.go deleted file mode 100644 index 97062ba..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/bratshelper/utils.go +++ /dev/null @@ -1,28 +0,0 @@ -package bratshelper - -import ( - "io/ioutil" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack/cutlass" - . "github.com/onsi/gomega" -) - -func PushApp(app *cutlass.App) { - Expect(app.Push()).To(Succeed(), "Failed to push %s", app.Name) - Eventually(app.InstanceStates, 20*time.Second).Should(Equal([]string{"RUNNING"})) -} - -func DestroyApp(app *cutlass.App) { - if app != nil { - app.Destroy() - } -} - -func AddDotProfileScriptToApp(dir string) { - profilePath := filepath.Join(dir, ".profile") - Expect(ioutil.WriteFile(profilePath, []byte(`#!/usr/bin/env bash -echo PROFILE_SCRIPT_IS_PRESENT_AND_RAN -`), 0755)).To(Succeed()) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum.go deleted file mode 100644 index d912db7..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum.go +++ /dev/null @@ -1,78 +0,0 @@ -package checksum - -import ( - "crypto/md5" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/cloudfoundry/libbuildpack" -) - -type Checksum struct { - dir string - timestampFile string -} - -func New(dir string) *Checksum { - c := &Checksum{dir: dir} - - if f, err := ioutil.TempFile("", "checksum"); err == nil { - f.Close() - c.timestampFile = f.Name() - } - - return c -} - -func Do(dir string, debug func(format string, args ...interface{}), exec func() error) error { - checksum := New(dir) - if sum, err := checksum.calc(); err == nil { - debug("Checksum Before (%s): %s", dir, sum) - } - err := exec() - if sum, err := checksum.calc(); err == nil { - debug("Checksum After (%s): %s", dir, sum) - } - - if checksum.timestampFile != "" { - if filesChanged, err := (&libbuildpack.Command{}).Output(checksum.dir, "find", ".", "-newer", checksum.timestampFile, "-not", "-path", "./.cloudfoundry/*", "-not", "-path", "./.cloudfoundry"); err == nil && filesChanged != "" { - debug("Below files changed:") - debug(filesChanged) - } - } - return err -} - -func (c *Checksum) calc() (string, error) { - h := md5.New() - err := filepath.Walk(c.dir, func(path string, info os.FileInfo, err error) error { - if info.Mode().IsRegular() { - relpath, err := filepath.Rel(c.dir, path) - if strings.HasPrefix(relpath, ".cloudfoundry/") { - return nil - } - if err != nil { - return err - } - if _, err := io.WriteString(h, relpath); err != nil { - return err - } - if f, err := os.Open(path); err != nil { - return err - } else { - if _, err := io.Copy(h, f); err != nil { - return err - } - } - } - return nil - }) - if err != nil { - return "", err - } - return fmt.Sprintf("%x", h.Sum(nil)), nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_suite_test.go deleted file mode 100644 index b0c6df8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package checksum_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestChecksum(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Checksum Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_test.go deleted file mode 100644 index 5ff2bc1..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/checksum/checksum_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package checksum_test - -import ( - "errors" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack/checksum" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Checksum", func() { - var ( - dir string - lines []string - ) - - BeforeEach(func() { - var err error - dir, err = ioutil.TempDir("", "checksum") - Expect(err).To(BeNil()) - - Expect(os.MkdirAll(filepath.Join(dir, "a/b"), 0755)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(dir, "a/b", "file"), []byte("hi"), 0644)).To(Succeed()) - - lines = []string{} - }) - - AfterEach(func() { - Expect(os.RemoveAll(dir)).To(Succeed()) - }) - - debug := func(format string, args ...interface{}) { - lines = append(lines, fmt.Sprintf(format, args...)) - } - - Describe("Do", func() { - Context("Directory is unchanged", func() { - It("Reports the current directory checksum", func() { - exec := func() error { return nil } - Expect(checksum.Do(dir, debug, exec)).To(Succeed()) - Expect(lines).To(Equal([]string{ - "Checksum Before (" + dir + "): 3e673106d28d587c5c01b3582bf15a50", - "Checksum After (" + dir + "): 3e673106d28d587c5c01b3582bf15a50", - })) - }) - }) - - Context("a file is changed", func() { - It("Reports the current directory checksum", func() { - exec := func() error { - time.Sleep(10 * time.Millisecond) - return ioutil.WriteFile(filepath.Join(dir, "a/b", "file"), []byte("bye"), 0644) - } - Expect(checksum.Do(dir, debug, exec)).To(Succeed()) - Expect(lines).To(Equal([]string{ - "Checksum Before (" + dir + "): 3e673106d28d587c5c01b3582bf15a50", - "Checksum After (" + dir + "): e01956670269656ae69872c0672592ae", - "Below files changed:", - "./a/b/file\n", - })) - }) - }) - - Context("a file is added", func() { - It("Reports the current directory checksum", func() { - exec := func() error { - time.Sleep(10 * time.Millisecond) - return ioutil.WriteFile(filepath.Join(dir, "a", "file"), []byte("new file"), 0644) - } - Expect(checksum.Do(dir, debug, exec)).To(Succeed()) - Expect(lines).To(Equal([]string{ - "Checksum Before (" + dir + "): 3e673106d28d587c5c01b3582bf15a50", - "Checksum After (" + dir + "): 9fc7505dc69734c5d40c38a35017e1dc", - "Below files changed:", - "./a\n./a/file\n", - })) - }) - }) - - Context("when exec returns an error", func() { - It("Returns an error", func() { - exec := func() error { - return errors.New("some error") - } - Expect(checksum.Do(dir, debug, exec)).To(MatchError("some error")) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/command_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/command_test.go deleted file mode 100644 index 5099104..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/command_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package libbuildpack_test - -import ( - "bytes" - "os/exec" - "path/filepath" - "runtime" - - bp "github.com/cloudfoundry/libbuildpack" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Command", func() { - var ( - buffer *bytes.Buffer - exe string - args []string - cmd bp.Command - ) - - BeforeEach(func() { - buffer = new(bytes.Buffer) - }) - - Context("valid command", func() { - BeforeEach(func() { - if runtime.GOOS == "windows" { - exe = "cmd.exe" - args = []string{"/c", "dir", "fixtures"} - } else { - exe = "ls" - args = []string{"-l", "fixtures"} - } - }) - - It("runs the command with the output in the right location", func() { - err := cmd.Execute("", buffer, buffer, exe, args...) - Expect(err).To(BeNil()) - - Expect(buffer.String()).To(ContainSubstring("thing.tgz")) - }) - }) - Context("changing directory", func() { - BeforeEach(func() { - if runtime.GOOS == "windows" { - exe = "cmd.exe" - args = []string{"/c", "cd"} - } else { - exe = "pwd" - args = []string{} - } - }) - - It("runs the command with the output in the right location", func() { - err := cmd.Execute("fixtures", buffer, buffer, exe, args...) - Expect(err).To(BeNil()) - - Expect(buffer.String()).To(ContainSubstring(filepath.Join("libbuildpack", "fixtures"))) - }) - }) - - Context("invalid command", func() { - BeforeEach(func() { - if runtime.GOOS == "windows" { - exe = "cmd.exe" - args = []string{"/c", "dir", filepath.Join("not", "a", "dir")} - } else { - exe = "ls" - args = []string{"-l", filepath.Join("not", "a", "dir")} - } - }) - - It("runs the command and returns an eror", func() { - err := cmd.Execute("", buffer, buffer, exe, args...) - Expect(err).NotTo(BeNil()) - _, ok := err.(*exec.ExitError) - Expect(ok).To(BeTrue()) - - if runtime.GOOS == "windows" { - Expect(buffer.String()).To(ContainSubstring("The system cannot find the path specified.")) - } else { - Expect(buffer.String()).To(ContainSubstring("No such file or directory")) - } - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/docker.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/docker.go deleted file mode 100644 index 39821aa..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/docker.go +++ /dev/null @@ -1,124 +0,0 @@ -package cutlass - -import ( - "fmt" - "io/ioutil" - "math/rand" - "os" - "os/exec" - "path/filepath" - "regexp" - "strings" - - "github.com/pkg/errors" -) - -func InternetTraffic(bp_dir, fixture_path, buildpack_path string, envs []string) ([]string, bool, []string, error) { - network_command := "(sudo tcpdump -n -i eth0 not udp port 53 and not udp port 1900 and not udp port 5353 and ip -t -Uw /tmp/dumplog &) " + - "&& /buildpack/bin/detect /tmp/staged && echo 'Detect completed' " + - "&& /buildpack/bin/supply /tmp/staged /tmp/cache /buildpack 0 && echo 'Supply completed' " + - "&& /buildpack/bin/finalize /tmp/staged /tmp/cache /buildpack 0 /tmp && echo 'Finalize completed' " + - "&& /buildpack/bin/release /tmp/staged && echo 'Release completed' " + - "&& sleep 1 && pkill tcpdump; tcpdump -nr /tmp/dumplog | sed -e 's/^/internet traffic: /' 2>&1 || true" - - output, err := executeDockerFile(bp_dir, fixture_path, buildpack_path, envs, network_command) - if err != nil { - return nil, false, nil, errors.Wrapf(err, "failed to build and run docker image: %s", output) - } - - var internet_traffic, logs []string - var detected, released, supplied, finalized bool - for _, line := range strings.Split(output, "\n") { - if idx := strings.Index(line, "internet traffic: "); idx >= 0 && idx < 10 { - internet_traffic = append(internet_traffic, line[(idx+18):]) - } else { - logs = append(logs, line) - if strings.Contains(line, "Detect completed") { - detected = true - } else if strings.Contains(line, "Supply completed") { - supplied = true - } else if strings.Contains(line, "Finalize completed") { - finalized = true - } else if strings.Contains(line, "Release completed") { - released = true - } - } - - } - - built := detected && supplied && finalized && released - - return internet_traffic, built, logs, nil -} - -func UniqueDestination(traffic []string, destination string) error { - re := regexp.MustCompile("^[\\d\\.:]+ IP ([\\d\\.]+) > ([\\d\\.]+):") - for _, line := range traffic { - m := re.FindStringSubmatch(line) - if len(m) != 3 || (m[1] != destination && m[2] != destination) { - return fmt.Errorf("Outgoing traffic: %s", line) - } - } - return nil -} - -func executeDockerFile(bp_dir, fixture_path, buildpack_path string, envs []string, network_command string) (string, error) { - var err error - buildpack_path, err = filepath.Rel(bp_dir, buildpack_path) - - docker_image_name := "internet_traffic_test" + RandStringRunes(8) - - // docker_env_vars += get_app_env_vars(fixture_path) - dockerfile_contents := dockerfile(fixture_path, buildpack_path, envs, network_command) - - dockerfile_name := fmt.Sprintf("itf.Dockerfile.%v", rand.Int()) - err = ioutil.WriteFile(filepath.Join(bp_dir, dockerfile_name), []byte(dockerfile_contents), 0755) - if err != nil { - return "", err - } - defer os.Remove(filepath.Join(bp_dir, dockerfile_name)) - defer exec.Command("docker", "rmi", "-f", docker_image_name).Output() - - cmd := exec.Command("docker", "build", "--rm", "--no-cache", "-t", docker_image_name, "-f", dockerfile_name, ".") - cmd.Dir = bp_dir - cmd.Stderr = DefaultStdoutStderr - if output, err := cmd.Output(); err != nil { - return "", errors.Wrapf(err, "failed to docker build: %s", string(output)) - - } - - cmd = exec.Command("docker", "run", "--net", "none", "--rm", "-t", docker_image_name, "bash", "-c", network_command) - cmd.Dir = bp_dir - cmd.Stderr = DefaultStdoutStderr - output, err := cmd.Output() - - return string(output), err -} - -func dockerfile(fixture_path, buildpack_path string, envs []string, network_command string) string { - cfStack := os.Getenv("CF_STACK") - if cfStack == "" { - cfStack = "cflinuxfs2" - } - - stackDockerImage := os.Getenv("CF_STACK_DOCKER_IMAGE") - if stackDockerImage == "" { - stackDockerImage = fmt.Sprintf("cloudfoundry/%s", cfStack) - } - - out := fmt.Sprintf("FROM %s\n"+ - "ENV CF_STACK %s\n"+ - "ENV VCAP_APPLICATION {}\n", stackDockerImage, cfStack) - for _, env := range envs { - out = out + "ENV " + env + "\n" - } - out = out + - "ADD " + fixture_path + " /tmp/staged/\n" + - "ADD " + buildpack_path + " /tmp/\n" + - "RUN mkdir -p /buildpack/0\n" + - "RUN mkdir -p /tmp/cache\n" + - "RUN unzip /tmp/" + filepath.Base(buildpack_path) + " -d /buildpack\n" + - "# HACK around https://github.com/dotcloud/docker/issues/5490\n" + - "RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump\n" - return out -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/proxy.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/proxy.go deleted file mode 100644 index 5df2c32..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/cutlass/proxy.go +++ /dev/null @@ -1,33 +0,0 @@ -package cutlass - -import ( - "net" - "net/http/httptest" - - "github.com/elazarl/goproxy" -) - -func NewTLSProxy() (*httptest.Server, error) { - return newProxy(true) -} - -func NewProxy() (*httptest.Server, error) { - return newProxy(false) -} - -func newProxy(tls bool) (*httptest.Server, error) { - var err error - ts := httptest.NewUnstartedServer(goproxy.NewProxyHttpServer()) - ts.Listener.Close() - ts.Listener, err = net.Listen("tcp", "0.0.0.0:0") - if err != nil { - return nil, err - } - - if tls { - ts.StartTLS() - } else { - ts.Start() - } - return ts, nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/source.txt b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/source.txt deleted file mode 100644 index 02f6335..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/source.txt +++ /dev/null @@ -1 +0,0 @@ -a file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/standard/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/standard/manifest.yml deleted file mode 100644 index 4fb22a5..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir/standard/manifest.yml +++ /dev/null @@ -1,141 +0,0 @@ ---- -language: dotnet-core -default_versions: -- name: bower - version: 1.8.0 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 -- name: node - version: 6.9.4 -- name: bower - version: 1.9.0 -- name: ruby - version: 2.x -- name: jruby - version: 9.3.x -url_to_dependency_map: -- match: libunwind-(.*)-(\d+\.\d+) - name: libunwind - version: "$2" -- match: dotnet\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-sdk - version: "$1" -- match: dotnet-runtime\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-runtime - version: "$1" -- match: node(.*)(\d+\.\d+\.\d+)-linux-x64.tar.gz - name: node - version: "$2" -- match: bower-(\d+\.\d+\.\d+).tgz - name: bower - version: "$1" -dependencies: -- name: ruby - version: 2.2.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: ruby - version: 2.3.3 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.5 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.4.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: libunwind - version: 1.2 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003156.linux-amd64.tar.gz - md5: 0afc3d78c0d44e89b01b1eb333824ff5 -- name: dotnet-sdk - version: 1.0.0-preview2-003131 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003131.linux-amd64.tar.gz - md5: ca1ca58a95992c90b0c4230d86168e03 -- name: dotnet-sdk - version: 1.0.0-preview2-1-003177 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-1-003177.linux-amd64.tar.gz - md5: 5fd10e42a9fb412a2d25c09fcf14e036 - cf_stacks: - - cflinuxfs2 -- name: dotnet-sdk - version: 1.0.0-preview3-004056 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview3-004056.linux-amd64.tar.gz - md5: f3808b1b6d2d632d6392b1b0f9762e97 - cf_stacks: - - cflinuxfs2 -- name: bower - version: 1.8.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/bower/bower-1.8.0.tgz - md5: b61dd4e9685101f82dab8c13b5c085e1 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.0.linux-amd64.tar.gz - md5: 318aba2c18e2bbbc5d0432fd23fc7a8d - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.1 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.1.linux-amd64.tar.gz - md5: 249445eb0d92270688d33333f7de4cd0 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.3 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.3.linux-amd64.tar.gz - md5: cc6bc4bd77c900c3c1f2a3a5ef28e420 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.1.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.1.0.linux-amd64.tar.gz - md5: a4fabc3c15c92b795836ad53634cd3dd - cf_stacks: - - cflinuxfs2 -- name: dotnet-sdk - version: 1.0.0-preview4-004233 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview4-004233.linux-amd64.tar.gz - md5: 30bff5f194e75c4d8e2933c3d50742a6 - cf_stacks: - - cflinuxfs2 -- name: node - version: 6.9.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/node/node-6.9.4-linux-x64.tgz - md5: 374ad90048055f1d11bc2ffb70ce08a7 - cf_stacks: - - cflinuxfs2 -exclude_files: -- ".git/" -- ".gitignore" -- ".gitmodules" -- spec/ -- cf_spec/ -- dotnet-core_buildpack-*v*.zip diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/source.txt b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/source.txt deleted file mode 100644 index 02f6335..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/source.txt +++ /dev/null @@ -1 +0,0 @@ -a file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/standard/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/standard/manifest.yml deleted file mode 100644 index 4fb22a5..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/standard/manifest.yml +++ /dev/null @@ -1,141 +0,0 @@ ---- -language: dotnet-core -default_versions: -- name: bower - version: 1.8.0 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 -- name: node - version: 6.9.4 -- name: bower - version: 1.9.0 -- name: ruby - version: 2.x -- name: jruby - version: 9.3.x -url_to_dependency_map: -- match: libunwind-(.*)-(\d+\.\d+) - name: libunwind - version: "$2" -- match: dotnet\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-sdk - version: "$1" -- match: dotnet-runtime\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-runtime - version: "$1" -- match: node(.*)(\d+\.\d+\.\d+)-linux-x64.tar.gz - name: node - version: "$2" -- match: bower-(\d+\.\d+\.\d+).tgz - name: bower - version: "$1" -dependencies: -- name: ruby - version: 2.2.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: ruby - version: 2.3.3 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.5 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.4.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: libunwind - version: 1.2 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003156.linux-amd64.tar.gz - md5: 0afc3d78c0d44e89b01b1eb333824ff5 -- name: dotnet-sdk - version: 1.0.0-preview2-003131 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003131.linux-amd64.tar.gz - md5: ca1ca58a95992c90b0c4230d86168e03 -- name: dotnet-sdk - version: 1.0.0-preview2-1-003177 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-1-003177.linux-amd64.tar.gz - md5: 5fd10e42a9fb412a2d25c09fcf14e036 - cf_stacks: - - cflinuxfs2 -- name: dotnet-sdk - version: 1.0.0-preview3-004056 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview3-004056.linux-amd64.tar.gz - md5: f3808b1b6d2d632d6392b1b0f9762e97 - cf_stacks: - - cflinuxfs2 -- name: bower - version: 1.8.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/bower/bower-1.8.0.tgz - md5: b61dd4e9685101f82dab8c13b5c085e1 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.0.linux-amd64.tar.gz - md5: 318aba2c18e2bbbc5d0432fd23fc7a8d - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.1 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.1.linux-amd64.tar.gz - md5: 249445eb0d92270688d33333f7de4cd0 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.3 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.3.linux-amd64.tar.gz - md5: cc6bc4bd77c900c3c1f2a3a5ef28e420 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.1.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.1.0.linux-amd64.tar.gz - md5: a4fabc3c15c92b795836ad53634cd3dd - cf_stacks: - - cflinuxfs2 -- name: dotnet-sdk - version: 1.0.0-preview4-004233 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview4-004233.linux-amd64.tar.gz - md5: 30bff5f194e75c4d8e2933c3d50742a6 - cf_stacks: - - cflinuxfs2 -- name: node - version: 6.9.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/node/node-6.9.4-linux-x64.tgz - md5: 374ad90048055f1d11bc2ffb70ce08a7 - cf_stacks: - - cflinuxfs2 -exclude_files: -- ".git/" -- ".gitignore" -- ".gitmodules" -- spec/ -- cf_spec/ -- dotnet-core_buildpack-*v*.zip diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_source.txt b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_source.txt deleted file mode 120000 index 36fef27..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_source.txt +++ /dev/null @@ -1 +0,0 @@ -source.txt \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_standard b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_standard deleted file mode 120000 index aa0bc07..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/copydir_symlinks/sym_standard +++ /dev/null @@ -1 +0,0 @@ -standard \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/maliciousGlobalSymlink.tar.gz b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/maliciousGlobalSymlink.tar.gz deleted file mode 100644 index 2f1fa56ebeeb327a7f4578a75d7123627f156cd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmb2|=3rPc^-eSc^V{=|T+Idot%?1Uq%9_2c_I|26u^?X_27|jzeK0Ld!x7e|Lr|z zlPe}Cots~6f3AO-lptqp`nNCcU3+CKjb6>+UlnF55vZ?ca%@|wSMDwGFzM~jgr?_u kN!?#BG=KWuwPrl^@8;D15n@0F4PE=Jrl0)ApuxZZ0JbwZfdBvi diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/duplicate/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/duplicate/manifest.yml deleted file mode 100644 index 89a057e..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/duplicate/manifest.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -default_versions: -- name: bower - version: 1.8.0 -- name: node - version: 6.9.4 -- name: bower - version: 1.9.0 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch/manifest.yml deleted file mode 100644 index 08eaa8b..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch/manifest.yml +++ /dev/null @@ -1,119 +0,0 @@ ---- -language: sample -dependency_deprecation_dates: -- name: thing - version_line: '6.2.x' - date: 2018-04-01 -- name: thing - version_line: '4.x' - date: 2017-03-01 - link: http://example.com/eol-policy -- name: thing - version_line: '5.x' - date: 2017-04-01 -- name: nonsemver - version_line: 'abc-1.2.3-def-4.5.6' - date: 2018-04-01 -dependencies: -- name: other_thing - version: 4.5.6 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/other_thing-4.5.6-linux-x64.tgz - sha256: fdf72806b9bc1a1bc78be1bfc21978d03591dea5042304211b81235dbf87bd77 -- name: thing - version: 1 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-1-linux-x64.tgz - sha256: fdf72806b9bc1a1bc78be1bfc21978d03591dea5042304211b81235dbf87bd77 -- name: thing - version: 2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-2-linux-x64.tgz - sha256: 191e76317fb5ba7f118a74ff9fbba0616f6ea5a2e0c5eaaff83e2d43eb5ef81c -- name: real_tar_file - version: 3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/real_tar_file-3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: real_zip_file - version: 3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/real_zip_file-3-linux-x64.zip - sha256: b742b6d71d03f13c43ecdeb429ef19e79aaa0727544522ab14710935887be2b0 -- name: thing - version: 8.1.2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-8.1.2-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 8.1.3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-8.1.3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 8.2.2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-8.2.2-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 6.2.2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-6.2.2-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 6.2.3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-6.2.3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 7.2.2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-7.2.2-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 7.3.2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-7.3.2-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 6.2.1 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-6.2.1-linux-x64.tgz - sha256: 191e76317fb5ba7f118a74ff9fbba0616f6ea5a2e0c5eaaff83e2d43eb5ef81c -- name: thing - version: 4.6.1 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-4.6.1-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: thing - version: 5.2.3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-5.2.3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: nonsemver - version: 'abc-1.2.3-def-4.5.6' - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/nonsemver-abc-1.2.3-def-4.5.6-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 -- name: godep - version: v79 - uri: https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v79-linux-x64-9e37ce0f.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - cf_stacks: - - cflinuxfs2 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch_cached/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch_cached/manifest.yml deleted file mode 100644 index 49d111c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/fetch_cached/manifest.yml +++ /dev/null @@ -1,101 +0,0 @@ ---- -language: sample -dependency_deprecation_dates: -- name: thing - version_line: 6.2.x - date: 2018-04-01 -- name: thing - version_line: 4.x - date: 2017-03-01 - link: http://example.com/eol-policy -- name: thing - version_line: 5.x - date: 2017-04-01 -- name: nonsemver - version_line: abc-1.2.3-def-4.5.6 - date: 2018-04-01 -dependencies: -- name: other_thing - version: 4.5.6 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/other_thing-4.5.6-linux-x64.tgz - file: dependencies/e56aeaf494f6099c7268511c23852ba5/other_thing-4.5.6-linux-x64.tgz - sha256: fdf72806b9bc1a1bc78be1bfc21978d03591dea5042304211b81235dbf87bd77 -- name: thing - version: 1 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-1-linux-x64.tgz - sha256: fdf72806b9bc1a1bc78be1bfc21978d03591dea5042304211b81235dbf87bd77 - file: dependencies/0fa03f02b4708e80d1975940e09b2cb9/thing-1-linux-x64.tgz -- name: thing - version: 2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-2-linux-x64.tgz - sha256: 191e76317fb5ba7f118a74ff9fbba0616f6ea5a2e0c5eaaff83e2d43eb5ef81c - file: dependencies/c4fef5682adf1c19c7f9b76fde9d0ecb/thing-2-linux-x64.tgz -- name: real_tar_file - version: 3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/real_tar_file-3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - file: dependencies/4ccda170fac663974196a8d668841913/real_tar_file-3-linux-x64.tgz -- name: real_zip_file - version: 3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/real_zip_file-3-linux-x64.zip - sha256: b742b6d71d03f13c43ecdeb429ef19e79aaa0727544522ab14710935887be2b0 - file: dependencies/f666296d630cce4c94c62afcc6680b44/real_zip_file-3-linux-x64.zip -- name: thing - version: 6.2.2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-6.2.2-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - file: dependencies/941695e02ad9e1c18e94ab4cd96c404f/thing-6.2.2-linux-x64.tgz -- name: thing - version: 6.2.3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-6.2.3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - file: dependencies/9accc716207e4610dc6e80f56bb29226/thing-6.2.3-linux-x64.tgz -- name: thing - version: 6.2.1 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-6.2.1-linux-x64.tgz - sha256: 191e76317fb5ba7f118a74ff9fbba0616f6ea5a2e0c5eaaff83e2d43eb5ef81c - file: dependencies/61a814af98bba9d1321db815e1affe6d/thing-6.2.1-linux-x64.tgz -- name: thing - version: 4.6.1 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-4.6.1-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - file: dependencies/a648c500b4bc0cfa558ba6ac2fe22ccb/thing-4.6.1-linux-x64.tgz -- name: thing - version: 5.2.3 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-5.2.3-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - file: dependencies/2adf3f711ab6c6a06ace58cd1db185d2/thing-5.2.3-linux-x64.tgz -- name: nonsemver - version: abc-1.2.3-def-4.5.6 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/nonsemver-abc-1.2.3-def-4.5.6-linux-x64.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - file: dependencies/c5d66e234b0787cf2ddff75039ae0b22/nonsemver-abc-1.2.3-def-4.5.6-linux-x64.tgz -- name: godep - version: v79 - uri: https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v79-linux-x64-9e37ce0f.tgz - sha256: 8208480eb849203632239f73bd3c61ed488546d19d29c06d7c2e1649d8950bd1 - cf_stacks: - - cflinuxfs2 - file: dependencies/45a95193113276fa9608ae86763bb2ea/godep-v79-linux-x64-9e37ce0f.tgz diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/no-deps/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/no-deps/manifest.yml deleted file mode 100644 index b325f5a..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/no-deps/manifest.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -language: sample -dependencies: [] diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/VERSION deleted file mode 100644 index 526a426..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/VERSION +++ /dev/null @@ -1 +0,0 @@ -99.99 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/manifest.yml deleted file mode 100644 index 4b9edec..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/packaged-with-stack/manifest.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- -stack: cflinuxfs2 -language: dotnet-core -default_versions: -- name: bower - version: 1.8.0 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 -- name: node - version: 6.9.4 -- name: bower - version: 1.9.0 -- name: ruby - version: 2.x -- name: jruby - version: 9.3.x -url_to_dependency_map: -- match: libunwind-(.*)-(\d+\.\d+) - name: libunwind - version: "$2" -- match: dotnet\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-sdk - version: "$1" -- match: dotnet-runtime\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-runtime - version: "$1" -- match: node(.*)(\d+\.\d+\.\d+)-linux-x64.tar.gz - name: node - version: "$2" -- match: bower-(\d+\.\d+\.\d+).tgz - name: bower - version: "$1" -dependencies: -- name: ruby - version: 2.2.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: ruby - version: 2.3.3 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.5 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.4.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: libunwind - version: 1.2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003156.linux-amd64.tar.gz - md5: 0afc3d78c0d44e89b01b1eb333824ff5 -- name: dotnet-sdk - version: 1.0.0-preview2-003131 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003131.linux-amd64.tar.gz - md5: ca1ca58a95992c90b0c4230d86168e03 -- name: dotnet-sdk - version: 1.0.0-preview2-1-003177 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-1-003177.linux-amd64.tar.gz - md5: 5fd10e42a9fb412a2d25c09fcf14e036 -- name: dotnet-sdk - version: 1.0.0-preview3-004056 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview3-004056.linux-amd64.tar.gz - md5: f3808b1b6d2d632d6392b1b0f9762e97 -- name: bower - version: 1.8.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/bower/bower-1.8.0.tgz - md5: b61dd4e9685101f82dab8c13b5c085e1 -- name: dotnet-runtime - version: 1.0.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.0.linux-amd64.tar.gz - md5: 318aba2c18e2bbbc5d0432fd23fc7a8d -- name: dotnet-runtime - version: 1.0.1 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.1.linux-amd64.tar.gz - md5: 249445eb0d92270688d33333f7de4cd0 -- name: dotnet-runtime - version: 1.0.3 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.3.linux-amd64.tar.gz - md5: cc6bc4bd77c900c3c1f2a3a5ef28e420 -- name: dotnet-runtime - version: 1.1.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.1.0.linux-amd64.tar.gz - md5: a4fabc3c15c92b795836ad53634cd3dd -- name: dotnet-sdk - version: 1.0.0-preview4-004233 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview4-004233.linux-amd64.tar.gz - md5: 30bff5f194e75c4d8e2933c3d50742a6 -- name: node - version: 6.9.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/node/node-6.9.4-linux-x64.tgz - md5: 374ad90048055f1d11bc2ffb70ce08a7 -exclude_files: -- ".git/" -- ".gitignore" -- ".gitmodules" -- spec/ -- cf_spec/ -- dotnet-core_buildpack-*v*.zip diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/stacks/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/stacks/manifest.yml deleted file mode 100644 index 24ae2bb..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/stacks/manifest.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -language: sample -dependencies: -- name: other_thing - version: 4.5.6 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/other_thing-4.5.6-linux-x64.tgz - md5: 7712b658293ea4b2c8505843b0e15441 -- name: thing - version: 1 - cf_stacks: - - cflinuxfs2 - - xenial - uri: https://example.com/dependencies/thing-1-linux-x64.tgz - md5: 7712b658293ea4b2c8505843b0e15441 -- name: thing - version: 2 - cf_stacks: - - cflinuxfs2 - uri: https://example.com/dependencies/thing-2-linux-x64.tgz - md5: e7437e09b0b13de8cd926e4b9b923fcb - diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/VERSION deleted file mode 100644 index 526a426..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/VERSION +++ /dev/null @@ -1 +0,0 @@ -99.99 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/manifest.yml deleted file mode 100644 index 4fb22a5..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/manifest/standard/manifest.yml +++ /dev/null @@ -1,141 +0,0 @@ ---- -language: dotnet-core -default_versions: -- name: bower - version: 1.8.0 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 -- name: node - version: 6.9.4 -- name: bower - version: 1.9.0 -- name: ruby - version: 2.x -- name: jruby - version: 9.3.x -url_to_dependency_map: -- match: libunwind-(.*)-(\d+\.\d+) - name: libunwind - version: "$2" -- match: dotnet\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-sdk - version: "$1" -- match: dotnet-runtime\.(.*)\.linux-amd64\.tar\.gz - name: dotnet-runtime - version: "$1" -- match: node(.*)(\d+\.\d+\.\d+)-linux-x64.tar.gz - name: node - version: "$2" -- match: bower-(\d+\.\d+\.\d+).tgz - name: bower - version: "$1" -dependencies: -- name: ruby - version: 2.2.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: ruby - version: 2.3.3 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.3.5 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: jruby - version: 9.4.4 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: libunwind - version: 1.2 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/libunwind-1.2-linux-x64.tgz - md5: f56347d4e83c27658a4181ceacd93b35 -- name: dotnet-sdk - version: 1.0.0-preview2-003156 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003156.linux-amd64.tar.gz - md5: 0afc3d78c0d44e89b01b1eb333824ff5 -- name: dotnet-sdk - version: 1.0.0-preview2-003131 - cf_stacks: - - cflinuxfs2 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-003131.linux-amd64.tar.gz - md5: ca1ca58a95992c90b0c4230d86168e03 -- name: dotnet-sdk - version: 1.0.0-preview2-1-003177 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview2-1-003177.linux-amd64.tar.gz - md5: 5fd10e42a9fb412a2d25c09fcf14e036 - cf_stacks: - - cflinuxfs2 -- name: dotnet-sdk - version: 1.0.0-preview3-004056 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview3-004056.linux-amd64.tar.gz - md5: f3808b1b6d2d632d6392b1b0f9762e97 - cf_stacks: - - cflinuxfs2 -- name: bower - version: 1.8.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/bower/bower-1.8.0.tgz - md5: b61dd4e9685101f82dab8c13b5c085e1 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.0.linux-amd64.tar.gz - md5: 318aba2c18e2bbbc5d0432fd23fc7a8d - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.1 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.1.linux-amd64.tar.gz - md5: 249445eb0d92270688d33333f7de4cd0 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.0.3 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.0.3.linux-amd64.tar.gz - md5: cc6bc4bd77c900c3c1f2a3a5ef28e420 - cf_stacks: - - cflinuxfs2 -- name: dotnet-runtime - version: 1.1.0 - uri: https://buildpacks.cloudfoundry.org/dependencies/manual-binaries/dotnet/dotnet-runtime.1.1.0.linux-amd64.tar.gz - md5: a4fabc3c15c92b795836ad53634cd3dd - cf_stacks: - - cflinuxfs2 -- name: dotnet-sdk - version: 1.0.0-preview4-004233 - uri: https://buildpacks.cloudfoundry.org/dependencies/dotnet/dotnet.1.0.0-preview4-004233.linux-amd64.tar.gz - md5: 30bff5f194e75c4d8e2933c3d50742a6 - cf_stacks: - - cflinuxfs2 -- name: node - version: 6.9.4 - uri: https://buildpacks.cloudfoundry.org/dependencies/node/node-6.9.4-linux-x64.tgz - md5: 374ad90048055f1d11bc2ffb70ce08a7 - cf_stacks: - - cflinuxfs2 -exclude_files: -- ".git/" -- ".gitignore" -- ".gitmodules" -- spec/ -- cf_spec/ -- dotnet-core_buildpack-*v*.zip diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/path_traversal.tgz b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/fixtures/path_traversal.tgz deleted file mode 100644 index 6689eed99ad037a93a373e0e4b0dd8aedfbb0993..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139 zcmb2|=3tmndOMnd`R#c}u0sX_tqe>-4+-X8nzc z6~Uh>zI~0{-R7e5b?@xp>2qp|C7pU!&1yRKL?uJu?VW4C&nk*%-+EuS`f%y0P4dTb mo|aU;ee?d_r89k=n@jykj3ip)ef&E}T#oSbeq2G zCZ4-&bKXzfzyGNE%~hIlO}9H5?}2CY=ah5{1kFDLFUbEBT(jQovnzka?j7^;Pntis ztono^lG6G2)UOWG;#g(R{@ipu6)D>)vx9;!<0yHn5g z=Ha<;tZhpyR2E Installing real_tar_file 3")) - }) - - It("extracts a file at the root", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_tar_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "root.txt")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "root.txt"))).To(Equal([]byte("root\n"))) - }) - - It("extracts a nested file", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_tar_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - - It("makes intermediate directories", func() { - outputDir = filepath.Join(outputDir, "notexist") - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_tar_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - - Context("by default, the version is NOT latest patch in version line", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-6.2.2-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("warns the user", func() { - patchWarning := "**WARNING** A newer version of thing is available in this buildpack. " + - "Please adjust your app to use version 6.2.3 instead of version 6.2.2 as soon as possible. " + - "Old versions of thing are only provided to assist in migrating to newer versions.\n" - - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "6.2.2"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(patchWarning)) - }) - }) - - Context("when there is a greater minor version and a greater patch version", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-8.1.2-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("warns about greater minor version over greater patch version", func() { - installer.SetVersionLine("thing", "minor") - patchWarning := "**WARNING** A newer version of thing is available in this buildpack. " + - "Please adjust your app to use version 8.2.2 instead of version 8.1.2 as soon as possible. " + - "Old versions of thing are only provided to assist in migrating to newer versions.\n" - - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "8.1.2"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(patchWarning)) - }) - }) - - Context("when the version line in a manifest is by patch line and the version installed is not the latest patch in that line", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-8.1.2-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("warns about greater patch version and not the greater minor version", func() { - installer.SetVersionLine("thing", "patch") - patchWarning := "**WARNING** A newer version of thing is available in this buildpack. " + - "Please adjust your app to use version 8.1.3 instead of version 8.1.2 as soon as possible. " + - "Old versions of thing are only provided to assist in migrating to newer versions.\n" - - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "8.1.2"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(patchWarning)) - }) - }) - - Context("version is latest in version line", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-6.2.3-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("does not warn the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "6.2.3"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).NotTo(ContainSubstring("newer version")) - }) - }) - - Context("version is not semver", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://buildpacks.cloudfoundry.org/dependencies/godep/godep-v79-linux-x64-9e37ce0f.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("does not warn the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "godep", Version: "v79"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).NotTo(ContainSubstring("newer version")) - }) - }) - - Context("version has an EOL, version line is major", func() { - const warning = "**WARNING** thing 4.x will no longer be available in new buildpacks released after 2017-03-01." - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-4.6.1-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - Context("less than 30 days in the future", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2017-02-15") - Expect(err).To(BeNil()) - }) - - It("warns the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "4.6.1"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(warning)) - }) - - Context("dependency EOL has a link associated with it", func() { - It("includes the link in the warning", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "4.6.1"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring("See: http://example.com/eol-policy")) - }) - }) - - Context("dependency EOL does not have a link associated with it", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-5.2.3-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("does not include the word 'See:' in the warning", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "5.2.3"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).ToNot(ContainSubstring("See:")) - }) - }) - }) - Context("in the past", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2017-12-15") - Expect(err).To(BeNil()) - }) - It("warns the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "4.6.1"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(warning)) - }) - }) - Context("more than 30 days in the future", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2016-10-15") - Expect(err).To(BeNil()) - }) - It("does not warn the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "4.6.1"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).ToNot(ContainSubstring(warning)) - }) - }) - }) - - Context("version has an EOL, version line is major + minor", func() { - const warning = "**WARNING** thing 6.2.x will no longer be available in new buildpacks released after 2018-04-01" - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-6.2.3-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - Context("less than 30 days in the future", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2018-03-29") - Expect(err).To(BeNil()) - }) - It("warns the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "6.2.3"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(warning)) - }) - }) - Context("in the past", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2019-12-30") - Expect(err).To(BeNil()) - }) - It("warns the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "6.2.3"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(warning)) - }) - }) - Context("more than 30 days in the future", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2018-01-15") - Expect(err).To(BeNil()) - }) - It("does not warn the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "6.2.3"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).ToNot(ContainSubstring(warning)) - }) - }) - }) - - Context("version has an EOL, version line non semver", func() { - const warning = "**WARNING** nonsemver abc-1.2.3-def-4.5.6 will no longer be available in new buildpacks released after 2018-04-01" - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/nonsemver-abc-1.2.3-def-4.5.6-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - Context("less than 30 days in the future", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2018-03-29") - Expect(err).To(BeNil()) - }) - It("warns the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "nonsemver", Version: "abc-1.2.3-def-4.5.6"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(warning)) - }) - }) - Context("in the past", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2019-12-30") - Expect(err).To(BeNil()) - }) - It("warns the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "nonsemver", Version: "abc-1.2.3-def-4.5.6"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring(warning)) - }) - }) - Context("more than 30 days in the future", func() { - BeforeEach(func() { - currentTime, err = time.Parse("2006-01-02", "2018-01-15") - Expect(err).To(BeNil()) - }) - It("does not warn the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "nonsemver", Version: "abc-1.2.3-def-4.5.6"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).ToNot(ContainSubstring(warning)) - }) - }) - }) - - Context("version does not have an EOL", func() { - const warning = "**WARNING** real_tar_file 3 will no longer be available in new buildpacks released after" - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/real_tar_file-3-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("does not warn the user", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_tar_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - Expect(buffer.String()).ToNot(ContainSubstring(warning)) - }) - }) - }) - - Context("url exists but does not match sha256", func() { - BeforeEach(func() { - httpmock.RegisterResponder("GET", "https://example.com/dependencies/thing-1-linux-x64.tgz", - httpmock.NewStringResponder(200, "other data")) - }) - - It("logs the name and version of the dependency", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "1"}, outputDir) - Expect(err).ToNot(BeNil()) - - Expect(buffer.String()).To(ContainSubstring("-----> Installing thing 1")) - }) - - It("outputfile does not exist", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "thing", Version: "1"}, outputDir) - Expect(err).ToNot(BeNil()) - - Expect(filepath.Join(outputDir, "root.txt")).ToNot(BeAnExistingFile()) - }) - }) - }) - - Context("cached", func() { - var ( - dependenciesDir string - outputDir string - ) - - BeforeEach(func() { - manifestDir, err = ioutil.TempDir("", "cached") - Expect(err).To(BeNil()) - - dependenciesDir = filepath.Join(manifestDir, "dependencies") - os.MkdirAll(dependenciesDir, 0755) - - data, err := ioutil.ReadFile("fixtures/manifest/fetch_cached/manifest.yml") - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(manifestDir, "manifest.yml"), data, 0644) - Expect(err).To(BeNil()) - - outputDir, err = ioutil.TempDir("", "downloads") - Expect(err).To(BeNil()) - }) - - Context("url exists cached on disk and matches sha256", func() { - BeforeEach(func() { - libbuildpack.CopyFile("fixtures/thing.zip", filepath.Join(dependenciesDir, "f666296d630cce4c94c62afcc6680b44", "real_zip_file-3-linux-x64.zip")) - }) - - It("logs the name and version of the dependency", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_zip_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(buffer.String()).To(ContainSubstring("-----> Installing real_zip_file 3")) - }) - - It("extracts a file at the root", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_zip_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "root.txt")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "root.txt"))).To(Equal([]byte("root\n"))) - }) - - It("extracts a nested file", func() { - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_zip_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - - It("makes intermediate directories", func() { - outputDir = filepath.Join(outputDir, "notexist") - err = installer.InstallDependency(libbuildpack.Dependency{Name: "real_zip_file", Version: "3"}, outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - }) - }) - }) - - Describe("InstallOnlyVersion", func() { - var outputDir string - - BeforeEach(func() { - manifestDir = "fixtures/manifest/fetch" - outputDir, err = ioutil.TempDir("", "downloads") - Expect(err).To(BeNil()) - }) - AfterEach(func() { err = os.RemoveAll(outputDir); Expect(err).To(BeNil()) }) - - Context("there is only one version of the dependency", func() { - BeforeEach(func() { - tgzContents, err := ioutil.ReadFile("fixtures/thing.tgz") - Expect(err).To(BeNil()) - httpmock.RegisterResponder("GET", "https://example.com/dependencies/real_tar_file-3-linux-x64.tgz", - httpmock.NewStringResponder(200, string(tgzContents))) - }) - - It("installs", func() { - outputDir = filepath.Join(outputDir, "notexist") - err = installer.InstallOnlyVersion("real_tar_file", outputDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(outputDir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(outputDir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - }) - - Context("there is more than one version of the dependency", func() { - It("fails", func() { - outputDir = filepath.Join(outputDir, "notexist") - err = installer.InstallOnlyVersion("thing", outputDir) - Expect(err).NotTo(BeNil()) - Expect(err.Error()).To(Equal("more than one version of thing found")) - }) - }) - - Context("there are no versions of the dependency", func() { - It("fails", func() { - outputDir = filepath.Join(outputDir, "notexist") - err = installer.InstallOnlyVersion("not_a_dependency", outputDir) - Expect(err).NotTo(BeNil()) - Expect(err.Error()).To(Equal("no versions of not_a_dependency found")) - }) - }) - }) - - Describe("SetVersionLine", func() { - var i *libbuildpack.Installer - var versionLine map[string]string - - BeforeEach(func() { - i = libbuildpack.NewInstaller(nil) - versionLine = *i.GetVersionLine() - }) - - It("is an empty map by default", func() { - Expect(len(versionLine)).To(BeZero()) - }) - - It("returns the version line that was previously set", func() { - i.SetVersionLine("thing", "minor") - line := versionLine["thing"] - Expect(line).To(Equal("minor")) - }) - - It("sets more than one line", func() { - i.SetVersionLine("thing", "minor") - i.SetVersionLine("thing2", "patch") - line := versionLine["thing"] - Expect(line).To(Equal("minor")) - line = versionLine["thing2"] - Expect(line).To(Equal("patch")) - }) - - It("overrides a previously set line", func() { - i.SetVersionLine("thing", "minor") - i.SetVersionLine("thing", "patch") - line := versionLine["thing"] - Expect(line).To(Equal("patch")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/json_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/json_test.go deleted file mode 100644 index 1ff7858..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/json_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package libbuildpack_test - -import ( - "io/ioutil" - "os" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("JSON", func() { - var ( - json *libbuildpack.JSON - tmpDir string - err error - ) - - BeforeEach(func() { - tmpDir, err = ioutil.TempDir("", "json") - Expect(err).To(BeNil()) - - json = &libbuildpack.JSON{} - }) - - AfterEach(func() { - err = os.RemoveAll(tmpDir) - Expect(err).To(BeNil()) - }) - - Describe("Load", func() { - Context("file is valid json", func() { - Context("that starts with BOM", func() { - BeforeEach(func() { - ioutil.WriteFile(filepath.Join(tmpDir, "valid.json"), []byte("\uFEFF"+`{"key": "value"}`), 0666) - }) - It("returns an error", func() { - obj := make(map[string]string) - err = json.Load(filepath.Join(tmpDir, "valid.json"), &obj) - - Expect(err).To(BeNil()) - Expect(obj["key"]).To(Equal("value")) - }) - }) - Context("that does not start with BOM", func() { - BeforeEach(func() { - ioutil.WriteFile(filepath.Join(tmpDir, "valid.json"), []byte(`{"key": "value"}`), 0666) - }) - It("returns an error", func() { - obj := make(map[string]string) - err = json.Load(filepath.Join(tmpDir, "valid.json"), &obj) - - Expect(err).To(BeNil()) - Expect(obj["key"]).To(Equal("value")) - }) - }) - }) - - Context("file is NOT valid json", func() { - BeforeEach(func() { - ioutil.WriteFile(filepath.Join(tmpDir, "invalid.json"), []byte("not valid json"), 0666) - }) - It("returns an error", func() { - obj := make(map[string]string) - err = json.Load(filepath.Join(tmpDir, "invalid.json"), &obj) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("file does not exist", func() { - It("returns an error", func() { - obj := make(map[string]string) - err = json.Load(filepath.Join(tmpDir, "does_not_exist.json"), &obj) - Expect(err).ToNot(BeNil()) - }) - }) - }) - - Describe("Write", func() { - Context("directory exists", func() { - It("writes the json to a file ", func() { - obj := map[string]string{ - "key": "val", - } - err = json.Write(filepath.Join(tmpDir, "file.json"), obj) - Expect(err).To(BeNil()) - - Expect(ioutil.ReadFile(filepath.Join(tmpDir, "file.json"))).To(Equal([]byte(`{"key":"val"}`))) - }) - }) - - Context("directory does not exist", func() { - It("creates the directory", func() { - obj := map[string]string{ - "key": "val", - } - err = json.Write(filepath.Join(tmpDir, "extradir", "file.json"), obj) - Expect(err).To(BeNil()) - - Expect(ioutil.ReadFile(filepath.Join(tmpDir, "extradir", "file.json"))).To(Equal([]byte(`{"key":"val"}`))) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/libbuildpack_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/libbuildpack_suite_test.go deleted file mode 100644 index 7d8d00a..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/libbuildpack_suite_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package libbuildpack_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - httpmock "gopkg.in/jarcoal/httpmock.v1" - - "testing" -) - -var _ = BeforeSuite(func() { - httpmock.Activate() -}) - -var _ = AfterSuite(func() { - httpmock.DeactivateAndReset() -}) - -func TestLibBuildpackTest(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "LibBuildpackTest Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/logger_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/logger_test.go deleted file mode 100644 index af9aa1e..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/logger_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package libbuildpack_test - -import ( - "bytes" - "os" - - "github.com/cloudfoundry/libbuildpack" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Logger", func() { - - var ( - err error - logger *libbuildpack.Logger - buffer *bytes.Buffer - ) - - BeforeEach(func() { - buffer = new(bytes.Buffer) - logger = libbuildpack.NewLogger(buffer) - }) - - Describe("Debug", func() { - var ( - bpDebug string - oldBpDebug string - ) - - JustBeforeEach(func() { - oldBpDebug = os.Getenv("BP_DEBUG") - err = os.Setenv("BP_DEBUG", bpDebug) - Expect(err).To(BeNil()) - }) - - AfterEach(func() { - err = os.Setenv("BP_DEBUG", oldBpDebug) - Expect(err).To(BeNil()) - }) - - Context("BP_DEBUG is set", func() { - BeforeEach(func() { - bpDebug = "true" - }) - - It("Logs the message", func() { - logger.Debug("detailed info") - Expect(buffer.String()).To(ContainSubstring("\033[34;1mDEBUG:\033[0m detailed info")) - }) - }) - - Context("BP_DEBUG is not set", func() { - BeforeEach(func() { - bpDebug = "" - }) - - It("Does not log the message", func() { - logger.Debug("detailed info") - Expect(buffer.String()).To(Equal("")) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/manifest_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/manifest_test.go deleted file mode 100644 index 440aa62..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/manifest_test.go +++ /dev/null @@ -1,580 +0,0 @@ -package libbuildpack_test - -import ( - "bytes" - "errors" - "io/ioutil" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/ansicleaner" - httpmock "gopkg.in/jarcoal/httpmock.v1" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Manifest", func() { - var ( - oldCfStack string - manifest *libbuildpack.Manifest - manifestDir string - err error - version string - currentTime time.Time - buffer *bytes.Buffer - logger *libbuildpack.Logger - ) - - BeforeEach(func() { - oldCfStack = os.Getenv("CF_STACK") - os.Setenv("CF_STACK", "cflinuxfs2") - manifestDir = "fixtures/manifest/standard" - currentTime = time.Now() - httpmock.Reset() - - buffer = new(bytes.Buffer) - logger = libbuildpack.NewLogger(ansicleaner.New(buffer)) - }) - AfterEach(func() { err = os.Setenv("CF_STACK", oldCfStack); Expect(err).To(BeNil()) }) - - JustBeforeEach(func() { - manifest, err = libbuildpack.NewManifest(manifestDir, logger, currentTime) - Expect(err).To(BeNil()) - }) - - Describe("NewManifest", func() { - It("has a language", func() { - Expect(manifest.Language()).To(Equal("dotnet-core")) - }) - }) - - Describe("ApplyOverride", func() { - var depsDir string - BeforeEach(func() { - depsDir, err = ioutil.TempDir("", "libbuildpack_override") - Expect(err).ToNot(HaveOccurred()) - Expect(os.Mkdir(filepath.Join(depsDir, "0"), 0755)).To(Succeed()) - Expect(os.Mkdir(filepath.Join(depsDir, "1"), 0755)).To(Succeed()) - Expect(os.Mkdir(filepath.Join(depsDir, "2"), 0755)).To(Succeed()) - - data := `--- -dotnet-core: - default_versions: - - name: node - version: 1.7.x - - name: thing - version: 9.3.x - dependencies: - - name: node - version: 1.7.6 - cf_stacks: ['cflinuxfs2'] - - name: thing - version: 9.3.6 - cf_stacks: ['cflinuxfs2'] -ruby: - default_versions: - - name: node - version: 2.2.x - dependencies: - - name: node - version: 2.2.2 - cf_stacks: ['cflinuxfs2'] -` - Expect(ioutil.WriteFile(filepath.Join(depsDir, "1", "override.yml"), []byte(data), 0644)).To(Succeed()) - }) - - AfterEach(func() { - Expect(os.RemoveAll(depsDir)).To(Succeed()) - }) - - It("updates default version", func() { - Expect(manifest.DefaultVersion("node")).To(Equal(libbuildpack.Dependency{Name: "node", Version: "6.9.4"})) - - Expect(manifest.ApplyOverride(depsDir)).To(Succeed()) - - Expect(manifest.DefaultVersion("node")).To(Equal(libbuildpack.Dependency{Name: "node", Version: "1.7.6"})) - }) - - It("doesn't remove data which is not overriden", func() { - Expect(manifest.DefaultVersion("ruby")).To(Equal(libbuildpack.Dependency{Name: "ruby", Version: "2.3.3"})) - - Expect(manifest.ApplyOverride(depsDir)).To(Succeed()) - - Expect(manifest.DefaultVersion("ruby")).To(Equal(libbuildpack.Dependency{Name: "ruby", Version: "2.3.3"})) - }) - - It("adds new default versions", func() { - Expect(manifest.ApplyOverride(depsDir)).To(Succeed()) - - Expect(manifest.DefaultVersion("thing")).To(Equal(libbuildpack.Dependency{Name: "thing", Version: "9.3.6"})) - }) - }) - - Describe("CheckStackSupport", func() { - Context("Stack is supported", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/stacks" - err = os.Setenv("CF_STACK", "cflinuxfs2") - Expect(err).To(BeNil()) - }) - - It("returns nil", func() { - Expect(manifest.CheckStackSupport()).To(Succeed()) - }) - - Context("with no dependencies listed", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/no-deps" - }) - It("returns nil", func() { - Expect(manifest.CheckStackSupport()).To(Succeed()) - }) - }) - - Context("by a single dependency", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/stacks" - err = os.Setenv("CF_STACK", "xenial") - Expect(err).To(BeNil()) - }) - It("returns nil", func() { - Expect(manifest.CheckStackSupport()).To(Succeed()) - }) - }) - - Context("by the whole manifest", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/packaged-with-stack" - err = os.Setenv("CF_STACK", "cflinuxfs2") - Expect(err).To(BeNil()) - }) - It("returns nil", func() { - Expect(manifest.CheckStackSupport()).To(Succeed()) - }) - }) - }) - - Context("stack is CFLINUXFS2", func() { - It("prints a warning message", func() { - err = os.Setenv("CF_STACK", libbuildpack.CFLINUXFS2) - Expect(err).To(BeNil()) - Expect(manifest.CheckStackSupport()).To(Succeed()) - Expect(buffer.String()).To(ContainSubstring("Please migrate this application to cflinuxfs3.")) - }) - }) - - Context("Stack is not supported", func() { - Context("stacks specified in dependencies", func() { - BeforeEach(func() { - err = os.Setenv("CF_STACK", "notastack") - Expect(err).To(BeNil()) - }) - - It("returns an error", func() { - Expect(manifest.CheckStackSupport()).To(MatchError(errors.New("required stack notastack was not found"))) - }) - }) - Context("stack specified in top-level of manifest", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/packaged-with-stack" - err = os.Setenv("CF_STACK", "notastack") - Expect(err).To(BeNil()) - }) - - It("returns an error", func() { - Expect(manifest.CheckStackSupport()).To(MatchError(errors.New("required stack notastack was not found"))) - }) - }) - }) - }) - - Describe("Version", func() { - Context("VERSION file exists", func() { - It("returns the version", func() { - version, err = manifest.Version() - Expect(err).To(BeNil()) - - Expect(version).To(Equal("99.99")) - }) - }) - - Context("VERSION file does not exist", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/duplicate" - }) - - It("returns an error", func() { - version, err = manifest.Version() - Expect(version).To(Equal("")) - Expect(err).ToNot(BeNil()) - - Expect(err.Error()).To(ContainSubstring("unable to read VERSION file")) - }) - }) - }) - - Describe("AllDependencyVersions", func() { - It("returns all the versions of the dependency", func() { - versions := manifest.AllDependencyVersions("dotnet-runtime") - Expect(versions).To(Equal([]string{"1.0.0", "1.0.1", "1.0.3", "1.1.0"})) - }) - - Context("CF_STACK = xenial", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/stacks" - os.Setenv("CF_STACK", "xenial") - }) - It("limits to dependencies matching CF_STACK", func() { - versions := manifest.AllDependencyVersions("thing") - Expect(versions).To(Equal([]string{"1"})) - }) - }) - - Context("CF_STACK = cflinuxfs2", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/stacks" - os.Setenv("CF_STACK", "cflinuxfs2") - }) - It("limits to dependencies matching CF_STACK", func() { - versions := manifest.AllDependencyVersions("thing") - Expect(versions).To(Equal([]string{"1", "2"})) - }) - }) - - Context("CF_STACK = empty string", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/stacks" - os.Setenv("CF_STACK", "cflinuxfs2") - }) - It("lists all dependencies matching name", func() { - versions := manifest.AllDependencyVersions("thing") - Expect(versions).To(Equal([]string{"1", "2"})) - }) - }) - - Context("stack specified in top-level of manifest", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/packaged-with-stack" - }) - - Context("stack matches", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "cflinuxfs2") - }) - It("returns all versions of the dependency", func() { - versions := manifest.AllDependencyVersions("jruby") - Expect(versions).To(Equal([]string{"9.3.4", "9.3.5", "9.4.4"})) - }) - }) - - Context("stack does not match", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "inanestack") - }) - - It("returns an empty list", func() { - versions := manifest.AllDependencyVersions("jruby") - Expect(versions).To(BeEmpty()) - }) - }) - }) - }) - - Describe("IsCached", func() { - BeforeEach(func() { - var err error - manifestDir, err = ioutil.TempDir("", "cached") - Expect(err).To(BeNil()) - - data, err := ioutil.ReadFile("fixtures/manifest/fetch/manifest.yml") - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(manifestDir, "manifest.yml"), data, 0644) - Expect(err).To(BeNil()) - }) - AfterEach(func() { - Expect(os.RemoveAll(manifestDir)).To(Succeed()) - }) - - Context("uncached buildpack", func() { - It("is false", func() { - Expect(manifest.IsCached()).To(BeFalse()) - }) - }) - - Context("cached buildpack", func() { - BeforeEach(func() { - dependenciesDir := filepath.Join(manifestDir, "dependencies") - Expect(os.MkdirAll(dependenciesDir, 0755)).To(Succeed()) - }) - It("is true", func() { - Expect(manifest.IsCached()).To(BeTrue()) - }) - }) - }) - - Describe("DefaultVersion", func() { - Context("requested name exists and default version is locked to the patch", func() { - It("returns the default", func() { - dep, err := manifest.DefaultVersion("node") - Expect(err).To(BeNil()) - - Expect(dep).To(Equal(libbuildpack.Dependency{Name: "node", Version: "6.9.4"})) - }) - }) - - Context("requested name exists multiple times in dependencies and default version is locked to minor line", func() { - It("returns the default", func() { - dep, err := manifest.DefaultVersion("jruby") - Expect(err).To(BeNil()) - - Expect(dep).To(Equal(libbuildpack.Dependency{Name: "jruby", Version: "9.3.5"})) - }) - }) - - Context("requested name exists multiple times in dependencies and default version is locked to major line", func() { - It("returns the default", func() { - dep, err := manifest.DefaultVersion("ruby") - Expect(err).To(BeNil()) - - Expect(dep).To(Equal(libbuildpack.Dependency{Name: "ruby", Version: "2.3.3"})) - }) - }) - - Context("requested name exists (twice) in default version section", func() { - BeforeEach(func() { manifestDir = "fixtures/manifest/duplicate" }) - It("returns an error", func() { - _, err := manifest.DefaultVersion("bower") - Expect(err.Error()).To(Equal("found 2 default versions for bower")) - }) - }) - - Context("requested name does not exist", func() { - It("returns an error", func() { - _, err := manifest.DefaultVersion("notexist") - Expect(err.Error()).To(Equal("no default version for notexist")) - }) - }) - - Context("stack specified in top-level of manifest", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/packaged-with-stack" - }) - - Context("stack matches", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "cflinuxfs2") - }) - It("returns all versions of the dependency", func() { - dep, err := manifest.DefaultVersion("jruby") - Expect(err).To(BeNil()) - Expect(dep).To(Equal(libbuildpack.Dependency{Name: "jruby", Version: "9.3.5"})) - }) - }) - - Context("stack does not match", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "inanestack") - }) - - It("returns an error", func() { - _, err := manifest.DefaultVersion("jruby") - Expect(err.Error()).To(Equal("no match found for 9.3.x in []")) - }) - }) - }) - }) - - Describe("CheckBuildpackVersion", func() { - var cacheDir string - - BeforeEach(func() { - cacheDir, err = ioutil.TempDir("", "cache") - }) - - AfterEach(func() { - err = os.RemoveAll(cacheDir) - Expect(err).To(BeNil()) - }) - - Context("BUILDPACK_METADATA exists", func() { - Context("The language does not match", func() { - BeforeEach(func() { - metadata := "---\nlanguage: diffLang\nversion: 99.99" - ioutil.WriteFile(filepath.Join(cacheDir, "BUILDPACK_METADATA"), []byte(metadata), 0666) - }) - - It("Does not log anything", func() { - manifest.CheckBuildpackVersion(cacheDir) - Expect(buffer.String()).To(Equal("")) - }) - }) - Context("The language matches", func() { - Context("The version matches", func() { - BeforeEach(func() { - metadata := "---\nlanguage: dotnet-core\nversion: 99.99" - ioutil.WriteFile(filepath.Join(cacheDir, "BUILDPACK_METADATA"), []byte(metadata), 0666) - }) - - It("Does not log anything", func() { - manifest.CheckBuildpackVersion(cacheDir) - Expect(buffer.String()).To(Equal("")) - - }) - }) - - Context("The version does not match", func() { - BeforeEach(func() { - metadata := "---\nlanguage: dotnet-core\nversion: 33.99" - ioutil.WriteFile(filepath.Join(cacheDir, "BUILDPACK_METADATA"), []byte(metadata), 0666) - }) - - It("Logs a warning that the buildpack version has changed", func() { - manifest.CheckBuildpackVersion(cacheDir) - Expect(buffer.String()).To(ContainSubstring("buildpack version changed from 33.99 to 99.99")) - - }) - }) - }) - }) - - Context("BUILDPACK_METADATA does not exist", func() { - It("Does not log anything", func() { - manifest.CheckBuildpackVersion(cacheDir) - Expect(buffer.String()).To(Equal("")) - - }) - }) - }) - - Describe("StoreBuildpackMetadata", func() { - var cacheDir string - - BeforeEach(func() { - cacheDir, err = ioutil.TempDir("", "cache") - }) - - AfterEach(func() { - err = os.RemoveAll(cacheDir) - Expect(err).To(BeNil()) - }) - - Context("VERSION file exists", func() { - Context("cache dir exists", func() { - It("writes to the BUILDPACK_METADATA file", func() { - manifest.StoreBuildpackMetadata(cacheDir) - - var md libbuildpack.BuildpackMetadata - - y := &libbuildpack.YAML{} - err = y.Load(filepath.Join(cacheDir, "BUILDPACK_METADATA"), &md) - Expect(err).To(BeNil()) - - Expect(md.Language).To(Equal("dotnet-core")) - Expect(md.Version).To(Equal("99.99")) - }) - }) - - Context("cache dir does not exist", func() { - It("Does not log anything", func() { - manifest.StoreBuildpackMetadata(filepath.Join(cacheDir, "not_exist")) - Expect(buffer.String()).To(Equal("")) - Expect(filepath.Join(cacheDir, "not_exist")).ToNot(BeADirectory()) - }) - }) - }) - - Context("VERSION file does not exist", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/stacks" - }) - - It("Does not log anything", func() { - manifest.StoreBuildpackMetadata(cacheDir) - Expect(buffer.String()).To(Equal("")) - }) - }) - }) - - Describe("GetEntry", func() { - var depToFind libbuildpack.Dependency - - Context("dependency matches", func() { - BeforeEach(func() { - depToFind = libbuildpack.Dependency{"jruby", "9.3.5"} - }) - - Context("top-level manifest stack exists", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/packaged-with-stack" - }) - - Context("top-level manifest stack matches", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "cflinuxfs2") - }) - - It("returns matched dependency", func() { - entry, err := manifest.GetEntry(depToFind) - Expect(err).To(BeNil()) - Expect(entry.Dependency).To(Equal(depToFind)) - }) - }) - - Context("top-level manifest stack does not match", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "inanestack") - }) - - It("returns an error", func() { - _, err := manifest.GetEntry(depToFind) - Expect(err).To(HaveOccurred()) - }) - }) - }) - - Context("top-level manifest stack does not exist", func() { - BeforeEach(func() { - manifestDir = "fixtures/manifest/standard" - }) - - Context("dependency stack matches", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "cflinuxfs2") - }) - - It("returns matched dependency", func() { - entry, err := manifest.GetEntry(depToFind) - Expect(err).To(BeNil()) - Expect(entry.Dependency).To(Equal(depToFind)) - }) - }) - - Context("dependency stack does not match", func() { - BeforeEach(func() { - os.Setenv("CF_STACK", "inanestack") - }) - - It("returns an error", func() { - _, err := manifest.GetEntry(depToFind) - Expect(err).To(HaveOccurred()) - }) - }) - }) - - Context("dependency does not match ", func() { - BeforeEach(func() { - depToFind = libbuildpack.Dependency{"inanedep", "11"} - }) - - It("returns an error", func() { - _, err := manifest.GetEntry(depToFind) - Expect(err).To(HaveOccurred()) - }) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/mocks_hooks_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/mocks_hooks_test.go deleted file mode 100644 index c8cd5f6..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/mocks_hooks_test.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: hooks.go - -// Package libbuildpack_test is a generated GoMock package. -package libbuildpack_test - -import ( - reflect "reflect" - - . "github.com/cloudfoundry/libbuildpack" - gomock "github.com/golang/mock/gomock" -) - -// MockHook is a mock of Hook interface -type MockHook struct { - ctrl *gomock.Controller - recorder *MockHookMockRecorder -} - -// MockHookMockRecorder is the mock recorder for MockHook -type MockHookMockRecorder struct { - mock *MockHook -} - -// NewMockHook creates a new mock instance -func NewMockHook(ctrl *gomock.Controller) *MockHook { - mock := &MockHook{ctrl: ctrl} - mock.recorder = &MockHookMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockHook) EXPECT() *MockHookMockRecorder { - return m.recorder -} - -// BeforeCompile mocks base method -func (m *MockHook) BeforeCompile(arg0 *Stager) error { - ret := m.ctrl.Call(m, "BeforeCompile", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// BeforeCompile indicates an expected call of BeforeCompile -func (mr *MockHookMockRecorder) BeforeCompile(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeCompile", reflect.TypeOf((*MockHook)(nil).BeforeCompile), arg0) -} - -// AfterCompile mocks base method -func (m *MockHook) AfterCompile(arg0 *Stager) error { - ret := m.ctrl.Call(m, "AfterCompile", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// AfterCompile indicates an expected call of AfterCompile -func (mr *MockHookMockRecorder) AfterCompile(arg0 interface{}) *gomock.Call { - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterCompile", reflect.TypeOf((*MockHook)(nil).AfterCompile), arg0) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/bin/filename b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/bin/filename deleted file mode 100644 index 80d7e98..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/bin/filename +++ /dev/null @@ -1 +0,0 @@ -awesome content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager/main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager/main.go deleted file mode 100644 index e462811..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager/main.go +++ /dev/null @@ -1,209 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "io/ioutil" - "log" - "os" - "path/filepath" - "strings" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/packager" - "github.com/google/subcommands" -) - -type summaryCmd struct { -} - -func (*summaryCmd) Name() string { return "summary" } -func (*summaryCmd) Synopsis() string { return "Print out list of dependencies of this buildpack" } -func (*summaryCmd) SetFlags(f *flag.FlagSet) {} -func (*summaryCmd) Usage() string { - return `summary: - When run in a directory that is structured as a buildpack, prints a list of depedencies of that buildpack. - (i.e. what would be downloaded to build a cached zipfile) -` -} -func (s *summaryCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { - summary, err := packager.Summary(".") - if err != nil { - log.Printf("error reading dependencies from manifest: %v", err) - return subcommands.ExitFailure - } - fmt.Println(summary) - return subcommands.ExitSuccess -} - -type buildCmd struct { - cached bool - anyStack bool - version string - cacheDir string - stack string -} - -func (*buildCmd) Name() string { return "build" } -func (*buildCmd) Synopsis() string { return "Create a buildpack zipfile from the current directory" } -func (*buildCmd) Usage() string { - return `build -stack |-any-stack [-cached] [-version ] [-cachedir ]: - When run in a directory that is structured as a buildpack, creates a zip file. - -` -} -func (b *buildCmd) SetFlags(f *flag.FlagSet) { - f.StringVar(&b.version, "version", "", "version to build as") - f.BoolVar(&b.cached, "cached", false, "include dependencies") - f.StringVar(&b.cacheDir, "cachedir", packager.CacheDir, "cache dir") - - f.StringVar(&b.stack, "stack", "", "stack to package buildpack for") - f.BoolVar(&b.anyStack, "any-stack", false, "package buildpack for any stack") -} -func (b *buildCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { - if b.stack == "" && !b.anyStack { - log.Printf("error: must either specify a stack or pass -any-stack") - return subcommands.ExitFailure - } - if b.stack != "" && b.anyStack { - log.Printf("error: cannot specify a stack AND pass -any-stack") - return subcommands.ExitFailure - } - if b.version == "" { - v, err := ioutil.ReadFile("VERSION") - if err != nil { - log.Printf("error: Could not read VERSION file: %v", err) - return subcommands.ExitFailure - } - b.version = strings.TrimSpace(string(v)) - } - - zipFile, err := packager.Package(".", b.cacheDir, b.version, b.stack, b.cached) - if err != nil { - log.Printf("error while creating zipfile: %v", err) - return subcommands.ExitFailure - } - - buildpackType := "uncached" - if b.cached { - buildpackType = "cached" - } - - stat, err := os.Stat(zipFile) - if err != nil { - log.Printf("error while stating zipfile: %v", err) - return subcommands.ExitFailure - } - - fmt.Printf("%s buildpack created and saved as %s with a size of %dMB\n", buildpackType, zipFile, stat.Size()/1024/1024) - return subcommands.ExitSuccess -} - -type initCmd struct { - name string - dir string -} - -func (*initCmd) Name() string { return "init" } -func (*initCmd) Synopsis() string { - return "Creates a folder with the basic structure of a new buildpack" -} -func (i *initCmd) SetFlags(f *flag.FlagSet) { - f.StringVar(&i.name, "name", "", "Name of the buildpack. Required.") - f.StringVar(&i.dir, "path", "", "Path to folder to create. Defaults to the name + '-buildpack' in the current directory.") -} -func (*initCmd) Usage() string { - return `init: - Create a new directory that is structured as a buildpack. -` -} -func (i *initCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { - fmt.Println("Init", i.name, i.dir) - - if i.name == "" { - log.Printf("error: no name entered for new buildpack") - return subcommands.ExitUsageError - } - - // assume user doesn't want -buildpack in the language name - i.name = strings.TrimSuffix(i.name, "-buildpack") - - if i.dir == "" { - i.dir = i.name + "-buildpack" - } - var err error - i.dir, err = filepath.Abs(i.dir) - if err != nil { - log.Printf("error: couldn't get absolute path to default directory: %v", err) - return subcommands.ExitFailure - } - - if exists, err := libbuildpack.FileExists(i.dir); err != nil { - return subcommands.ExitFailure - } else if exists { - log.Printf("error: directory %s already exists", i.dir) - return subcommands.ExitUsageError - } - - if err := packager.Scaffold(i.dir, i.name); err != nil { - log.Printf("Error creating new buildpack scaffolding: %v", err) - return subcommands.ExitFailure - } - - return subcommands.ExitSuccess -} - -type upgradeCmd struct { - dir string - force bool -} - -func (*upgradeCmd) Name() string { return "upgrade" } -func (*upgradeCmd) Synopsis() string { - return "Upgrades a buildpack scaffolded by buildpack-packager init" -} -func (u *upgradeCmd) SetFlags(f *flag.FlagSet) { - f.StringVar(&u.dir, "path", ".", "Path to folder to create. Defaults to the current directory.") - f.BoolVar(&u.force, "force", false, "Regenerate files even if they have been modified") -} -func (*upgradeCmd) Usage() string { - return `upgrade: - Update an existing buildpack with changes made to scaffolding code. -` -} -func (u *upgradeCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { - var err error - u.dir, err = filepath.Abs(u.dir) - if err != nil { - log.Printf("error: couldn't get absolute path to default directory: %v", err) - return subcommands.ExitFailure - } - - if exists, err := libbuildpack.FileExists(u.dir); err != nil { - return subcommands.ExitFailure - } else if !exists { - log.Printf("error: directory %s does not exist", u.dir) - return subcommands.ExitUsageError - } - - if err := packager.Upgrade(u.dir, u.force); err != nil { - log.Printf("Error upgrading buildpack: %v", err) - return subcommands.ExitFailure - } - - return subcommands.ExitSuccess -} -func main() { - subcommands.Register(subcommands.HelpCommand(), "") - subcommands.Register(subcommands.FlagsCommand(), "") - subcommands.Register(subcommands.CommandsCommand(), "") - subcommands.Register(&summaryCmd{}, "Custom") - subcommands.Register(&buildCmd{}, "Custom") - subcommands.Register(&initCmd{}, "Custom") - subcommands.Register(&upgradeCmd{}, "Custom") - - flag.Parse() - ctx := context.Background() - os.Exit(int(subcommands.Execute(ctx))) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/VERSION deleted file mode 100644 index e7ccb34..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.45.8 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/filename b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/filename deleted file mode 100644 index 80d7e98..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/filename +++ /dev/null @@ -1 +0,0 @@ -awesome content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/ignoredfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/ignoredfile deleted file mode 100644 index 6b584e8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/bin/ignoredfile +++ /dev/null @@ -1 +0,0 @@ -content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/hi.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/hi.sh deleted file mode 100755 index f980b46..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/hi.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -echo "running now" -echo "hi mom" > hi.txt \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/manifest.yml deleted file mode 100644 index be801ce..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/manifest.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -language: ruby -pre_package: ./hi.sh -dependencies: -- name: ruby - version: 1.2.3 - sha256: fffffff - uri: https://www.ietf.org/rfc/rfc2324.txt - cf_stacks: - - cflinuxfs2 -include_files: -- manifest.yml -- VERSION -- bin/filename -- hi.txt diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/otherfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/otherfile deleted file mode 100644 index 6b584e8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/bad/otherfile +++ /dev/null @@ -1 +0,0 @@ -content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/VERSION deleted file mode 100644 index e7ccb34..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.45.8 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/filename b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/filename deleted file mode 100644 index 80d7e98..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/filename +++ /dev/null @@ -1 +0,0 @@ -awesome content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/ignoredfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/ignoredfile deleted file mode 100644 index 6b584e8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/bin/ignoredfile +++ /dev/null @@ -1 +0,0 @@ -content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/hi.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/hi.sh deleted file mode 100755 index f980b46..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/hi.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -echo "running now" -echo "hi mom" > hi.txt \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/manifest.yml deleted file mode 100644 index 9a18b28..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/manifest.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -language: ruby -pre_package: ./hi.sh -default_versions: -- name: ruby - version: 1.2.3 -dependencies: -- name: ruby - version: 1.2.3 - sha256: b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596 - uri: https://www.ietf.org/rfc/rfc2324.txt - cf_stacks: - - cflinuxfs2 -- name: ruby - version: 1.2.3 - sha256: 646b43b5d718913d6211e2c18b2b3b667cf6eaa76a2493e55b1de5ca04c2578e - uri: https://www.ietf.org/rfc/rfc2549.txt - cf_stacks: - - cflinuxfs3 -include_files: -- manifest.yml -- VERSION -- bin/filename -- hi.txt diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/otherfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/otherfile deleted file mode 100644 index 6b584e8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/good/otherfile +++ /dev/null @@ -1 +0,0 @@ -content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_default_fs3/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_default_fs3/manifest.yml deleted file mode 100644 index c50be8b..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_default_fs3/manifest.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -language: ruby -default_versions: -- name: ruby - version: 1.2.3 -dependencies: -- name: ruby - version: 1.2.3 - sha256: b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596 - uri: https://www.ietf.org/rfc/rfc2324.txt - cf_stacks: - - cflinuxfs2 -- name: ruby - version: 2.3.4 - sha256: 646b43b5d718913d6211e2c18b2b3b667cf6eaa76a2493e55b1de5ca04c2578e - uri: https://www.ietf.org/rfc/rfc2549.txt - cf_stacks: - - cflinuxfs3 -include_files: -- manifest.yml diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/VERSION deleted file mode 100644 index e7ccb34..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.45.8 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/bin/filename b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/bin/filename deleted file mode 100644 index 80d7e98..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/bin/filename +++ /dev/null @@ -1 +0,0 @@ -awesome content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/hi.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/hi.sh deleted file mode 100755 index f980b46..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/hi.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -echo "running now" -echo "hi mom" > hi.txt \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/manifest.yml deleted file mode 100644 index 51fe8b7..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/missing_included_files/manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -language: ruby -pre_package: ./hi.sh -dependencies: -- name: ruby - version: 1.2.3 - sha256: fffffff - uri: https://www.ietf.org/rfc/rfc2324.txt - cf_stacks: - - cflinuxfs2 -include_files: -- manifest.yml -- VERSION -- bin/filename -- hi.txt -- DOESNOTEXIST.txt diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/manifest.yml deleted file mode 100644 index 313b806..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -language: mylanguage -default_versions: -dependency_deprecation_dates: -dependencies: - -include_files: - - README.md - - VERSION - - bin/detect - - bin/compile - - bin/supply - - bin/finalize - - bin/release - - manifest.yml -pre_package: scripts/build.sh diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/sha.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/sha.yml deleted file mode 100644 index 493b6ba..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/sha.yml +++ /dev/null @@ -1,5 +0,0 @@ -sha: - manifest.yml: 89114cde7614011031eff8ba9135e66a433fbdf58ca375548c897d87ecab5df2 - src/mylanguage/Gopkg.toml: 64e5a2e2aa78477f800ea48f786e70ebf20764d929c14d938070556feb348421 - src/mylanguage/supply/supply.go: aaaaaae23382a5d16c7d7a8e0a837db542f0fd9c079609842d2538f1e31b1957 - src/mylanguage/supply/supply_test.go: 40335b858d6cb58a27bece5a2b61199a48c41dd84af1a6393f706baa4f8a2613 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.lock b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.lock deleted file mode 100644 index 2a09b78..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.lock +++ /dev/null @@ -1,145 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/Masterminds/semver" - packages = ["."] - revision = "15d8430ab86497c5c0da827b748823945e1cf1e1" - version = "v1.4.0" - -[[projects]] - name = "github.com/blang/semver" - packages = ["."] - revision = "2ee87856327ba09384cabd113bc6b5d174e9ec0f" - version = "v3.5.1" - -[[projects]] - branch = "init-155219487" - name = "github.com/cloudfoundry/libbuildpack" - packages = [ - ".", - "bratshelper", - "cutlass", - "packager" - ] - revision = "44c79a01d5fb2b8168d69c445bf6bb9f973062dd" - -[[projects]] - name = "github.com/elazarl/goproxy" - packages = ["."] - revision = "aacba83f36a55ac31cbb71c06547a328c0cd1604" - -[[projects]] - branch = "master" - name = "github.com/google/subcommands" - packages = ["."] - revision = "ce3d4cfc062faac7115d44e5befec8b5a08c3faa" - -[[projects]] - branch = "master" - name = "github.com/onsi/ginkgo" - packages = [ - ".", - "config", - "internal/codelocation", - "internal/containernode", - "internal/failer", - "internal/leafnodes", - "internal/remote", - "internal/spec", - "internal/spec_iterator", - "internal/specrunner", - "internal/suite", - "internal/testingtproxy", - "internal/writer", - "reporters", - "reporters/stenographer", - "reporters/stenographer/support/go-colorable", - "reporters/stenographer/support/go-isatty", - "types" - ] - revision = "9008c7b79f9636c46a0a945141020124702f0ecf" - -[[projects]] - branch = "master" - name = "github.com/onsi/gomega" - packages = [ - ".", - "format", - "internal/assertion", - "internal/asyncassertion", - "internal/oraclematcher", - "internal/testingtsupport", - "matchers", - "matchers/support/goraph/bipartitegraph", - "matchers/support/goraph/edge", - "matchers/support/goraph/node", - "matchers/support/goraph/util", - "types" - ] - revision = "fcebc62b30a95351cb5e56d8a97b6e67cbb85353" - -[[projects]] - name = "github.com/tidwall/gjson" - packages = ["."] - revision = "01f00f129617a6fe98941fb920d6c760241b54d2" - version = "v1.1.0" - -[[projects]] - branch = "master" - name = "github.com/tidwall/match" - packages = ["."] - revision = "1731857f09b1f38450e2c12409748407822dc6be" - -[[projects]] - branch = "master" - name = "golang.org/x/net" - packages = [ - "html", - "html/atom", - "html/charset" - ] - revision = "cbe0f9307d0156177f9dd5dc85da1a31abc5f2fb" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix"] - revision = "c1138c84af3a9927aee1a1b8b7ce06c9b7ea52bc" - -[[projects]] - name = "golang.org/x/text" - packages = [ - "encoding", - "encoding/charmap", - "encoding/htmlindex", - "encoding/internal", - "encoding/internal/identifier", - "encoding/japanese", - "encoding/korean", - "encoding/simplifiedchinese", - "encoding/traditionalchinese", - "encoding/unicode", - "internal/gen", - "internal/tag", - "internal/utf8internal", - "language", - "runes", - "transform", - "unicode/cldr" - ] - revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" - version = "v0.3.0" - -[[projects]] - branch = "v2" - name = "gopkg.in/yaml.v2" - packages = ["."] - revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "0690e470589dba300abed5199bf49a87a54ba4f7a1d3096d04e402c34209073f" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.toml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.toml deleted file mode 100644 index 3ef8423..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/Gopkg.toml +++ /dev/null @@ -1,20 +0,0 @@ -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. - -required = ["github.com/google/subcommands"] - -[[constraint]] -name = "github.com/cloudfoundry/libbuildpack" -branch = "init-155219487" - -[[constraint]] -name = "github.com/onsi/ginkgo" -branch = "master" - -[[constraint]] -name = "github.com/onsi/gomega" -branch = "master" - -[[override]] -name = "github.com/elazarl/goproxy" -revision = "aacba83f36a55ac31cbb71c06547a328c0cd1604" diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply.go deleted file mode 100644 index ed09012..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply.go +++ /dev/null @@ -1,3 +0,0 @@ -package supply - -// a modification diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply_test.go deleted file mode 100644 index 291e72c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modified/src/mylanguage/supply/supply_test.go +++ /dev/null @@ -1,5 +0,0 @@ -package supply_test - -//go:generate mockgen -source=supply.go --destination=mocks_test.go --package=supply_test - -// old version of file (not modified by user) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modules/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modules/manifest.yml deleted file mode 100644 index 56b30cc..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/modules/manifest.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -language: php -dependencies: -- name: php - version: 1.6.1 - uri: https://buildpacks.cloudfoundry.org/dependencies/php/php-5.6.31-linux-x64-2ed515dd.tgz - md5: 2ed515dd61fd09206b8f38edf9de6fee - cf_stacks: - - cflinuxfs2 - modules: - - gearman - - zlib - - geoip -- name: nginx - version: 1.7.3 - uri: https://buildpacks.cloudfoundry.org/dependencies/nginx/nginx-1.13.3-linux-x64-53917f43.tgz - md5: 53917f43684d6ec825ca469ab586c0d2 - cf_stacks: - - cflinuxfs2 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/no_dependencies/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/no_dependencies/manifest.yml deleted file mode 100644 index 10538e2..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/no_dependencies/manifest.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -language: binary -dependencies: [] diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/VERSION deleted file mode 100644 index e7ccb34..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.45.8 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/filename b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/filename deleted file mode 100644 index 80d7e98..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/filename +++ /dev/null @@ -1 +0,0 @@ -awesome content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/ignoredfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/bin/ignoredfile deleted file mode 100644 index e69de29..0000000 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/manifest.yml deleted file mode 100644 index 489b6f1..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -stack: cflinuxfs2 -language: ruby -default_versions: -- name: ruby - version: 1.2.3 -dependencies: -- name: ruby - version: 1.2.3 - sha256: b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596 - uri: https://www.ietf.org/rfc/rfc2324.txt -include_files: -- manifest.yml -- VERSION -- bin/filename -- hi.txt diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/otherfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/prepackaged/otherfile deleted file mode 100644 index e69de29..0000000 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/VERSION deleted file mode 100644 index e7ccb34..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.45.8 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/filename b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/filename deleted file mode 100644 index 80d7e98..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/filename +++ /dev/null @@ -1 +0,0 @@ -awesome content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/ignoredfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/ignoredfile deleted file mode 100644 index 6b584e8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/bin/ignoredfile +++ /dev/null @@ -1 +0,0 @@ -content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/hi.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/hi.sh deleted file mode 100755 index f980b46..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/hi.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -echo "running now" -echo "hi mom" > hi.txt \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/manifest.yml deleted file mode 100644 index 08cf847..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/manifest.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -language: ruby -pre_package: ./hi.sh -default_versions: -- name: ruby - version: 1.2.3 -dependencies: -- name: ruby - version: 1.2.3 - sha256: b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596 - uri: https://www.ietf.org/rfc/rfc2324.txt - cf_stacks: - - cflinuxfs2 -include_files: -- random_dir -- manifest.yml -- VERSION -- bin/filename -- hi.txt -- sym_dir diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/otherfile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/otherfile deleted file mode 100644 index 6b584e8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/otherfile +++ /dev/null @@ -1 +0,0 @@ -content \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/random_dir/.gitkeep b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/random_dir/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/sym_dir b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/sym_dir deleted file mode 120000 index 3f219be..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/fixtures/symlink_dir/sym_dir +++ /dev/null @@ -1 +0,0 @@ -random_dir \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/models_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/models_test.go deleted file mode 100644 index 2e75851..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/models_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package packager_test - -import ( - "sort" - - "github.com/cloudfoundry/libbuildpack/packager" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - httpmock "gopkg.in/jarcoal/httpmock.v1" -) - -var _ = Describe("Packager", func() { - BeforeEach(func() { - httpmock.Reset() - }) - - Describe("Sort Dependencies", func() { - It("....", func() { - deps := packager.Dependencies{ - {Name: "ruby", Version: "1.2.3"}, - {Name: "ruby", Version: "3.2.1"}, - {Name: "zesty", Version: "2.1.3"}, - {Name: "ruby", Version: "1.11.3"}, - {Name: "jruby", Version: "2.1.3"}, - } - sort.Sort(deps) - Expect(deps).To(Equal(packager.Dependencies{ - {Name: "jruby", Version: "2.1.3"}, - {Name: "ruby", Version: "1.2.3"}, - {Name: "ruby", Version: "1.11.3"}, - {Name: "ruby", Version: "3.2.1"}, - {Name: "zesty", Version: "2.1.3"}, - })) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_suite_test.go deleted file mode 100644 index 5f6a051..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_suite_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package packager_test - -import ( - "archive/zip" - "fmt" - "io/ioutil" - "log" - - "github.com/cloudfoundry/libbuildpack/packager" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestPackager(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Packager Suite") -} - -var _ = BeforeSuite(func() { - packager.Stdout = GinkgoWriter - packager.Stderr = GinkgoWriter -}) - -func ZipContents(zipFile, file string) (string, error) { - r, err := zip.OpenReader(zipFile) - if err != nil { - log.Fatal(err) - } - defer r.Close() - - for _, f := range r.File { - if f.Name == file { - rc, err := f.Open() - if err != nil { - return "", err - } - defer rc.Close() - body, err := ioutil.ReadAll(rc) - if err != nil { - return "", err - } - return string(body), nil - } - } - return "", fmt.Errorf("%s not found in %s", file, zipFile) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_test.go deleted file mode 100644 index 53b7423..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/packager_test.go +++ /dev/null @@ -1,368 +0,0 @@ -package packager_test - -import ( - "crypto/md5" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" - - httpmock "gopkg.in/jarcoal/httpmock.v1" - yaml "gopkg.in/yaml.v2" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/packager" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Packager", func() { - var ( - buildpackDir string - version string - cacheDir string - stack string - err error - ) - - BeforeEach(func() { - stack = "cflinuxfs2" - buildpackDir = "./fixtures/good" - cacheDir, err = ioutil.TempDir("", "packager-cachedir") - Expect(err).To(BeNil()) - version = fmt.Sprintf("1.23.45.%s", time.Now().Format("20060102150405")) - - httpmock.Reset() - }) - - Describe("Package", func() { - var zipFile string - var cached bool - AfterEach(func() { os.Remove(zipFile) }) - - AssertStack := func() { - var manifest *packager.Manifest - Context("stack specified and matches any dependency in manifest.yml", func() { - BeforeEach(func() { stack = "cflinuxfs2" }) - JustBeforeEach(func() { - manifestYml, err := ZipContents(zipFile, "manifest.yml") - Expect(err).To(BeNil()) - manifest = &packager.Manifest{} - Expect(yaml.Unmarshal([]byte(manifestYml), manifest)).To(Succeed()) - }) - - It("removes dependencies for other stacks from the manifest", func() { - Expect(len(manifest.Dependencies)).To(Equal(1)) - Expect(manifest.Dependencies[0].SHA256).To(Equal("b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596")) - }) - - It("removes cfstacks from the remaining dependencies", func() { - Expect(manifest.Dependencies[0].Stacks).To(BeNil()) - }) - - It("adds a top-level stack: key to the manifest", func() { - Expect(manifest.Stack).To(Equal(stack)) - }) - }) - - Context("empty stack specified", func() { - BeforeEach(func() { stack = "" }) - JustBeforeEach(func() { - manifestYml, err := ZipContents(zipFile, "manifest.yml") - Expect(err).To(BeNil()) - manifest = &packager.Manifest{} - Expect(yaml.Unmarshal([]byte(manifestYml), manifest)).To(Succeed()) - }) - - It("includes dependencies for all stacks in the manifest", func() { - Expect(len(manifest.Dependencies)).To(Equal(2)) - }) - - It("does not add a top-level stack: key to the manifest", func() { - Expect(manifest.Stack).To(Equal("")) - }) - - It("does not remove cf_stacks from dependencies", func() { - Expect(manifest.Dependencies[0].Stacks).To(Equal([]string{"cflinuxfs2"})) - Expect(manifest.Dependencies[1].Stacks).To(Equal([]string{"cflinuxfs3"})) - }) - }) - } - - Context("uncached", func() { - BeforeEach(func() { cached = false }) - JustBeforeEach(func() { - var err error - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).To(BeNil()) - }) - - AssertStack() - - It("generates a zipfile with name", func() { - dir, err := filepath.Abs(buildpackDir) - Expect(err).To(BeNil()) - Expect(zipFile).To(Equal(filepath.Join(dir, fmt.Sprintf("ruby_buildpack-cflinuxfs2-v%s.zip", version)))) - }) - - It("includes files listed in manifest.yml", func() { - Expect(ZipContents(zipFile, "bin/filename")).To(Equal("awesome content")) - }) - - It("overrides VERSION", func() { - Expect(ZipContents(zipFile, "VERSION")).To(Equal(version)) - }) - - It("runs pre-package script", func() { - Expect(ZipContents(zipFile, "hi.txt")).To(Equal("hi mom\n")) - }) - - It("does not include files not in list", func() { - _, err := ZipContents(zipFile, "ignoredfile") - Expect(err.Error()).To(HavePrefix("ignoredfile not found in")) - }) - - It("does not include dependencies", func() { - _, err := ZipContents(zipFile, "dependencies/d39cae561ec1f485d1a4a58304e87105/rfc2324.txt") - Expect(err.Error()).To(HavePrefix("dependencies/d39cae561ec1f485d1a4a58304e87105/rfc2324.txt not found in")) - }) - - It("does not set file on entries", func() { - manifestYml, err := ZipContents(zipFile, "manifest.yml") - Expect(err).To(BeNil()) - var m packager.Manifest - Expect(yaml.Unmarshal([]byte(manifestYml), &m)).To(Succeed()) - Expect(m.Dependencies).ToNot(BeEmpty()) - Expect(m.Dependencies[0].File).To(Equal("")) - }) - }) - - Context("cached", func() { - BeforeEach(func() { cached = true }) - JustBeforeEach(func() { - var err error - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).To(BeNil()) - }) - - AssertStack() - - It("generates a zipfile with name", func() { - dir, err := filepath.Abs(buildpackDir) - Expect(err).To(BeNil()) - Expect(zipFile).To(Equal(filepath.Join(dir, fmt.Sprintf("ruby_buildpack-cached-cflinuxfs2-v%s.zip", version)))) - }) - - It("includes files listed in manifest.yml", func() { - Expect(ZipContents(zipFile, "bin/filename")).To(Equal("awesome content")) - }) - - It("overrides VERSION", func() { - Expect(ZipContents(zipFile, "VERSION")).To(Equal(version)) - }) - - It("runs pre-package script", func() { - Expect(ZipContents(zipFile, "hi.txt")).To(Equal("hi mom\n")) - }) - - It("does not include files not in list", func() { - _, err := ZipContents(zipFile, "ignoredfile") - Expect(err.Error()).To(HavePrefix("ignoredfile not found in")) - }) - - Describe("including dependencies", func() { - Context("when a stack is specified", func() { - It("includes ONLY dependencies for the specified stack", func() { - Expect(ZipContents(zipFile, "dependencies/d39cae561ec1f485d1a4a58304e87105/rfc2324.txt")).To(ContainSubstring("Hyper Text Coffee Pot Control Protocol")) - _, err := ZipContents(zipFile, "dependencies/ff1eb131521acf5bc95db59b2a2c29c0/rfc2549.txt") - Expect(err.Error()).To(HavePrefix("dependencies/ff1eb131521acf5bc95db59b2a2c29c0/rfc2549.txt not found in")) - }) - }) - Context("when the empty stack is specified", func() { - BeforeEach(func() { stack = "" }) - - It("includes dependencies for ALL stacks if the empty stack is used", func() { - Expect(ZipContents(zipFile, "dependencies/d39cae561ec1f485d1a4a58304e87105/rfc2324.txt")).To(ContainSubstring("Hyper Text Coffee Pot Control Protocol")) - Expect(ZipContents(zipFile, "dependencies/ff1eb131521acf5bc95db59b2a2c29c0/rfc2549.txt")).To(ContainSubstring("IP over Avian Carriers with Quality of Service")) - }) - }) - }) - - It("sets file on entries", func() { - manifestYml, err := ZipContents(zipFile, "manifest.yml") - Expect(err).To(BeNil()) - var m packager.Manifest - Expect(yaml.Unmarshal([]byte(manifestYml), &m)).To(Succeed()) - Expect(m.Dependencies).ToNot(BeEmpty()) - Expect(m.Dependencies[0].File).To(Equal("dependencies/d39cae561ec1f485d1a4a58304e87105/rfc2324.txt")) - }) - - Context("dependency uses file://", func() { - var tempfile string - BeforeEach(func() { - var err error - tempdir, err := ioutil.TempDir("", "bp_fixture") - Expect(err).ToNot(HaveOccurred()) - Expect(libbuildpack.CopyDirectory(buildpackDir, tempdir)).To(Succeed()) - - fh, err := ioutil.TempFile("", "bp_dependency") - Expect(err).ToNot(HaveOccurred()) - fh.WriteString("keaty") - fh.Close() - tempfile = fh.Name() - - manifestyml, err := ioutil.ReadFile(filepath.Join(tempdir, "manifest.yml")) - Expect(err).ToNot(HaveOccurred()) - manifestyml2 := string(manifestyml) - manifestyml2 = strings.Replace(manifestyml2, "https://www.ietf.org/rfc/rfc2324.txt", "file://"+tempfile, -1) - manifestyml2 = strings.Replace(manifestyml2, "b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596", "f909ee4c4bec3280bbbff6b41529479366ab10c602d8aed33e3a86f0a9c5db4e", -1) - Expect(ioutil.WriteFile(filepath.Join(tempdir, "manifest.yml"), []byte(manifestyml2), 0644)).To(Succeed()) - - buildpackDir = tempdir - }) - AfterEach(func() { os.RemoveAll(buildpackDir) }) - - It("includes dependencies", func() { - dest := filepath.Join("dependencies", fmt.Sprintf("%x", md5.Sum([]byte("file://"+tempfile))), filepath.Base(tempfile)) - Expect(ZipContents(zipFile, dest)).To(ContainSubstring("keaty")) - }) - }) - }) - - Context("manifest.yml was already packaged", func() { - Context("setting specific stack", func() { - BeforeEach(func() { stack = "cflinuxfs2" }) - It("returns an error", func() { - zipFile, err = packager.Package("./fixtures/prepackaged", cacheDir, version, stack, cached) - Expect(err).To(MatchError("Cannot package from already packaged buildpack manifest")) - }) - }) - - Context("setting any stack", func() { - - BeforeEach(func() { stack = "" }) - - It("returns an error", func() { - zipFile, err = packager.Package("./fixtures/prepackaged", cacheDir, version, stack, cached) - Expect(err).To(MatchError("Cannot package from already packaged buildpack manifest")) - }) - }) - }) - - Context("manifest.yml has no dependencies", func() { - BeforeEach(func() { stack = "cflinuxfs2" }) - - It("allows stack when packaging", func() { - zipFile, err = packager.Package("./fixtures/no_dependencies", cacheDir, version, stack, cached) - Expect(err).To(BeNil()) - }) - }) - - Context("stack is invalid", func() { - Context("stack not found in any dependencies", func() { - BeforeEach(func() { stack = "nonexistent-stack" }) - - It("returns an error", func() { - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).To(MatchError("Stack `nonexistent-stack` not found in manifest")) - }) - }) - Context("stack not found in any default dependencies", func() { - BeforeEach(func() { - stack = "cflinuxfs3" - buildpackDir = "./fixtures/missing_default_fs3" - }) - - It("returns an error", func() { - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).To(MatchError("No matching default dependency `ruby` for stack `cflinuxfs3`")) - }) - }) - }) - - Context("when buildpack includes symlink to directory", func() { - BeforeEach(func() { - // this is actually a failing test.... - //if runtime.GOOS == "darwin" { - // Skip("io.Copy fails with symlinked directory on Darwin") - //} - cached = true - buildpackDir = "./fixtures/symlink_dir" - }) - JustBeforeEach(func() { - var err error - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).To(BeNil()) - }) - It("gets zipfile name", func() { - Expect(zipFile).ToNot(BeEmpty()) - }) - It("generates a zipfile with name", func() { - var cachedStr string - if cached { - cachedStr = "-cached" - } - dir, err := filepath.Abs(buildpackDir) - Expect(err).To(BeNil()) - Expect(zipFile).To(Equal(filepath.Join(dir, fmt.Sprintf("ruby_buildpack%s-cflinuxfs2-v%s.zip", cachedStr, version)))) - }) - - It("includes files listed in manifest.yml", func() { - Expect(ZipContents(zipFile, "bin/filename")).To(Equal("awesome content")) - }) - - It("overrides VERSION", func() { - Expect(ZipContents(zipFile, "VERSION")).To(Equal(version)) - }) - - It("runs pre-package script", func() { - Expect(ZipContents(zipFile, "hi.txt")).To(Equal("hi mom\n")) - }) - - It("does not include files not in list", func() { - _, err := ZipContents(zipFile, "ignoredfile") - Expect(err.Error()).To(HavePrefix("ignoredfile not found in")) - }) - }) - - Context("cached dependency has wrong md5", func() { - BeforeEach(func() { - cached = true - buildpackDir = "./fixtures/bad" - }) - It("includes dependencies", func() { - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).ToNot(BeNil()) - Expect(err.Error()).To(ContainSubstring("dependency sha256 mismatch: expected sha256 fffffff, actual sha256 b11329c3fd6dbe9dddcb8dd90f18a4bf441858a6b5bfaccae5f91e5c7d2b3596")) - }) - }) - - Context("packaging with no stack", func() { - BeforeEach(func() { - cached = false - stack = "" - }) - - JustBeforeEach(func() { - var err error - zipFile, err = packager.Package(buildpackDir, cacheDir, version, stack, cached) - Expect(err).To(BeNil()) - }) - - It("generates a zipfile with name", func() { - dir, err := filepath.Abs(buildpackDir) - Expect(err).To(BeNil()) - Expect(zipFile).To(Equal(filepath.Join(dir, fmt.Sprintf("ruby_buildpack-v%s.zip", version)))) - }) - }) - - Context("packaging with missing included_files", func() { - It("returns an error", func() { - zipFile, err = packager.Package("./fixtures/missing_included_files", cacheDir, version, stack, cached) - Expect(err.Error()).To(MatchRegexp("failed to open included_file: .*/DOESNOTEXIST.txt")) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.envrc b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.envrc deleted file mode 100644 index c8e74c3..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.envrc +++ /dev/null @@ -1,3 +0,0 @@ -export GOPATH=$PWD -export GOBIN=$PWD/.bin -export PATH=$GOBIN:$PATH \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.gitignore b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.gitignore deleted file mode 100644 index 6d4934c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -pkg -.bin -*.zip \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/README.md b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/README.md deleted file mode 100644 index 98919a1..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/README.md +++ /dev/null @@ -1,70 +0,0 @@ -## Buildpack User Documentation - -### Building the Buildpack - -To build this buildpack, run the following command from the buildpack's directory: - -1. Source the .envrc file in the buildpack directory. - - ```bash - source .envrc - ``` - - To simplify the process in the future, install [direnv](https://direnv.net/) which will automatically source .envrc when you change directories. - -1. Install buildpack-packager - - ```bash - ./scripts/install_tools.sh - ``` - -1. Build the buildpack - - ```bash - buildpack-packager build - ``` - -1. Use in Cloud Foundry - - Upload the buildpack to your Cloud Foundry and optionally specify it by name - - ```bash - cf create-buildpack [BUILDPACK_NAME] [BUILDPACK_ZIP_FILE_PATH] 1 - cf push my_app [-b BUILDPACK_NAME] - ``` - -### Testing - -Buildpacks use the [Cutlass](https://github.com/cloudfoundry/libbuildpack/cutlass) framework for running integration tests. - -To test this buildpack, run the following command from the buildpack's directory: - -1. Source the .envrc file in the buildpack directory. - - ```bash - source .envrc - ``` - - To simplify the process in the future, install [direnv](https://direnv.net/) which will automatically source .envrc when you change directories. - -1. Run unit tests - - ```bash - ./scripts/unit.sh - ``` - -1. Run integration tests - - ```bash - ./scripts/integration.sh - ``` - - More information can be found on Github [cutlass](https://github.com/cloudfoundry/libbuildpack/cutlass). - -### Reporting Issues - -Open an issue on this project - -## Disclaimer - -This buildpack is experimental and not yet intended for production use. diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/VERSION deleted file mode 100644 index bd52db8..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.0 \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/compile b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/compile deleted file mode 100755 index 0ecbe07..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/compile +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# This script is a deprecated but is provided for compatibility with Heroku and older versions of Cloud Foundry -# It is an alternative to bin/supply and bin/finalize - -set -euo pipefail - -BUILD_DIR=$1 -CACHE_DIR=$2 -BUILDPACK_PATH=$(dirname $(readlink -f ${BASH_SOURCE%/*})) -DEPS_DIR="$BUILD_DIR/.cloudfoundry" - -mkdir -p $CACHE_DIR -mkdir -p "$DEPS_DIR/0" -mkdir -p "$BUILD_DIR/.profile.d" - -echo "export DEPS_DIR=\$HOME/.cloudfoundry" > "$BUILD_DIR/.profile.d/0000_set-deps-dir.sh" - -$BUILDPACK_PATH/bin/supply "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" 0 -$BUILDPACK_PATH/bin/finalize "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" 0 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/detect b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/detect deleted file mode 100755 index 175fda9..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/detect +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# bin/detect -# -# -# This script determines whether or not to apply the buildpack to an app -# TODO: Write code here to exit 0 if the buildpack is compatible with the app and exit 1 otherwise - -exit 1 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/finalize b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/finalize deleted file mode 100755 index f52f57c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/finalize +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -# This script prepares and configures the app for launch. - -set -euo pipefail - -BUILD_DIR=$1 -CACHE_DIR=$2 -DEPS_DIR=$3 -DEPS_IDX=$4 -PROFILE_DIR=${5:-} - -export BUILDPACK_DIR=`dirname $(readlink -f ${BASH_SOURCE%/*})` -source "$BUILDPACK_DIR/scripts/install_go.sh" -output_dir=$(mktemp -d -t finalizeXXX) - -echo "-----> Running go build finalize" -GOROOT=$GoInstallDir/go GOPATH=$BUILDPACK_DIR $GoInstallDir/go/bin/go build -o $output_dir/finalize {{LANGUAGE}}/finalize/cli - -$output_dir/finalize "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" "$DEPS_IDX" "$PROFILE_DIR" diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/release b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/release deleted file mode 100755 index e4a9121..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/release +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -# bin/release -# This script provides feedback metadata to Cloud Foundry indicating how the app should be executed - -echo -e "---\ndefault_process_types:\n web: '>&2 echo Please specify a default start command for this buildpack && exit 1'" diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/supply b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/supply deleted file mode 100755 index 5141845..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/bin/supply +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# This script provides dependencies for an app - - -set -euo pipefail - -BUILD_DIR=$1 -CACHE_DIR=$2 -DEPS_DIR=$3 -DEPS_IDX=$4 - -export BUILDPACK_DIR=`dirname $(readlink -f ${BASH_SOURCE%/*})` -source "$BUILDPACK_DIR/scripts/install_go.sh" -output_dir=$(mktemp -d -t supplyXXX) -echo "-----> Running go build supply" -GOROOT=$GoInstallDir/go GOPATH=$BUILDPACK_DIR $GoInstallDir/go/bin/go build -o $output_dir/supply {{LANGUAGE}}/supply/cli -$output_dir/supply "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" "$DEPS_IDX" diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/.gitkeep b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/simple_test/some_file.txt b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/simple_test/some_file.txt deleted file mode 100755 index f534deb..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/fixtures/simple_test/some_file.txt +++ /dev/null @@ -1 +0,0 @@ -Hello World. diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/manifest.yml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/manifest.yml deleted file mode 100644 index 11d298b..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/manifest.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -language: {{LANGUAGE}} -default_versions: -dependency_deprecation_dates: -dependencies: - -include_files: - - README.md - - VERSION - - bin/detect - - bin/compile - - bin/supply - - bin/finalize - - bin/release - - manifest.yml -pre_package: scripts/build.sh diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/brats.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/brats.sh deleted file mode 100755 index 6e9da1b..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/brats.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -# Test that the compiled binaries of the buildpacks are working as expected - -set -euo pipefail - -cd "$( dirname "${BASH_SOURCE[0]}" )/.." -source .envrc -./scripts/install_tools.sh - -GINKGO_NODES=${GINKGO_NODES:-3} -GINKGO_ATTEMPTS=${GINKGO_ATTEMPTS:-1} - -cd src/*/brats - -echo "Run Buildpack Runtime Acceptance Tests" -ginkgo -r --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/build.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/build.sh deleted file mode 100755 index 5ced879..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -exuo pipefail - -cd "$( dirname "${BASH_SOURCE[0]}" )/.." -source .envrc - -GOOS=linux go build -ldflags="-s -w" -o bin/supply {{LANGUAGE}}/supply/cli -GOOS=linux go build -ldflags="-s -w" -o bin/finalize {{LANGUAGE}}/finalize/cli diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_go.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_go.sh deleted file mode 100755 index 25432fe..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_go.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -GO_VERSION="1.12.4" - -if [ $CF_STACK == "cflinuxfs2" ]; then - GO_SHA256="1a6d80b16a845f6a9692857a5978c0d69a89b58af4d50f66209435beafb07b5b" -elif [ $CF_STACK == "cflinuxfs3" ]; then - GO_SHA256="e68279204493307782c51105c3dd5254ab066d0b5d9aafa3ce3a2878ebbef53f" -else - echo " **ERROR** Unsupported stack" - echo " See https://docs.cloudfoundry.org/devguide/deploy-apps/stacks.html for more info" - exit 1 -fi - -export GoInstallDir="/tmp/go$GO_VERSION" -mkdir -p $GoInstallDir - -if [ ! -f $GoInstallDir/go/bin/go ]; then - URL=https://buildpacks.cloudfoundry.org/dependencies/go/go${GO_VERSION}.linux-amd64-${CF_STACK}-${GO_SHA256:0:8}.tar.gz - - echo "-----> Download go ${GO_VERSION}" - curl -s -L --retry 15 --retry-delay 2 $URL -o /tmp/go.tar.gz - - DOWNLOAD_SHA256=$(shasum -a 256 /tmp/go.tar.gz | cut -d ' ' -f 1) - - if [[ $DOWNLOAD_SHA256 != $GO_SHA256 ]]; then - echo " **ERROR** SHA256 mismatch: got $DOWNLOAD_SHA256 expected $GO_SHA256" - exit 1 - fi - - tar xzf /tmp/go.tar.gz -C $GoInstallDir - rm /tmp/go.tar.gz -fi -if [ ! -f $GoInstallDir/go/bin/go ]; then - echo " **ERROR** Could not download go" - exit 1 -fi diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_tools.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_tools.sh deleted file mode 100755 index 3cf8d4f..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/install_tools.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -euo pipefail - -cd "$( dirname "${BASH_SOURCE[0]}" )/.." -source .envrc - -if [ ! -f .bin/ginkgo ]; then -(cd src/*/vendor/github.com/onsi/ginkgo/ginkgo/ && go install) -fi -if [ ! -f .bin/buildpack-packager ]; then -(cd src/*/vendor/github.com/cloudfoundry/libbuildpack/packager/buildpack-packager && go install) -fi \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/integration.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/integration.sh deleted file mode 100755 index 567e1a1..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/integration.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# Runs the integration tests -set -euo pipefail - -cd "$( dirname "${BASH_SOURCE[0]}" )/.." -source .envrc -./scripts/install_tools.sh - -GINKGO_NODES=${GINKGO_NODES:-3} -GINKGO_ATTEMPTS=${GINKGO_ATTEMPTS:-2} - -cd src/*/integration - -echo "Run Uncached Buildpack" -ginkgo -r --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached=false - -echo "Run Cached Buildpack" -ginkgo -r --flakeAttempts=$GINKGO_ATTEMPTS -nodes $GINKGO_NODES --slowSpecThreshold=60 -- --cached diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/unit.sh b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/unit.sh deleted file mode 100755 index 91d3631..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/scripts/unit.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# Runs the unit tests for this buildpack - -set -euo pipefail - -cd "$( dirname "${BASH_SOURCE[0]}" )/.." -source .envrc -./scripts/install_tools.sh - -cd src/*/integration/.. -ginkgo -r -skipPackage=brats,integration diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/Gopkg.toml b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/Gopkg.toml deleted file mode 100644 index 456eb56..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/Gopkg.toml +++ /dev/null @@ -1,24 +0,0 @@ -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. - -required = ["github.com/google/subcommands"] - -[[override]] - source = "https://github.com/fsnotify/fsnotify/archive/v1.4.7.tar.gz" - name = "gopkg.in/fsnotify.v1" - -[[constraint]] -name = "github.com/cloudfoundry/libbuildpack" -branch = "master" - -[[constraint]] -name = "github.com/onsi/ginkgo" -branch = "master" - -[[constraint]] -name = "github.com/onsi/gomega" -branch = "master" - -[[override]] -name = "github.com/elazarl/goproxy" -revision = "aacba83f36a55ac31cbb71c06547a328c0cd1604" diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize.go deleted file mode 100644 index 0b8d00a..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize.go +++ /dev/null @@ -1,48 +0,0 @@ -package finalize - -import ( - "io" - - "github.com/cloudfoundry/libbuildpack" -) - -type Stager interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/stager.go - BuildDir() string - DepDir() string - DepsIdx() string - DepsDir() string -} - -type Manifest interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/manifest.go - AllDependencyVersions(string) []string -} - -type Installer interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/installer.go - DefaultVersion(string) (libbuildpack.Dependency, error) - InstallDependency(libbuildpack.Dependency, string) error - InstallOnlyVersion(string, string) error -} - -type Command interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/command.go - Execute(string, io.Writer, io.Writer, string, ...string) error - Output(dir string, program string, args ...string) (string, error) -} - -type Finalizer struct { - Manifest Manifest - Stager Stager - Command Command - Log *libbuildpack.Logger -} - -func (f *Finalizer) Run() error { - f.Log.BeginStep("Configuring {{LANGUAGE}}") - - // TODO: Prepare app for launch here here... - - return nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_suite_test.go deleted file mode 100644 index 825d5fc..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package finalize_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFinalize(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Finalize Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_test.go deleted file mode 100644 index 00770c3..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/_finalize_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package finalize_test - -//go:generate mockgen -source=finalize.go --destination=mocks_test.go --package=finalize_test -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Finalize", func() { - It("succeeds", func() { - Expect(false).To(Equal(false)) - }) - // TODO: Add tests here to check configure dependency functions work -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_cli_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_cli_suite_test.go deleted file mode 100644 index c93fb2c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_cli_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package main_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestCli(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Finalize Cli Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_main.go deleted file mode 100644 index d23e5f9..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/finalize/cli/_main.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "{{LANGUAGE}}/finalize" - _ "{{LANGUAGE}}/hooks" - "os" - "time" - - "github.com/cloudfoundry/libbuildpack" -) - -func main() { - logger := libbuildpack.NewLogger(os.Stdout) - - buildpackDir, err := libbuildpack.GetBuildpackDir() - if err != nil { - logger.Error("Unable to determine buildpack directory: %s", err.Error()) - os.Exit(9) - } - - manifest, err := libbuildpack.NewManifest(buildpackDir, logger, time.Now()) - if err != nil { - logger.Error("Unable to load buildpack manifest: %s", err.Error()) - os.Exit(10) - } - - stager := libbuildpack.NewStager(os.Args[1:], logger, manifest) - - if err = manifest.ApplyOverride(stager.DepsDir()); err != nil { - logger.Error("Unable to apply override.yml files: %s", err) - os.Exit(17) - } - - if err := stager.SetStagingEnvironment(); err != nil { - logger.Error("Unable to setup environment variables: %s", err.Error()) - os.Exit(11) - } - - f := finalize.Finalizer{ - Manifest: manifest, - Stager: stager, - Command: &libbuildpack.Command{}, - Log: logger, - } - - if err := f.Run(); err != nil { - os.Exit(12) - } - - if err := libbuildpack.RunAfterCompile(stager); err != nil { - logger.Error("After Compile: %s", err.Error()) - os.Exit(13) - } - - if err := stager.SetLaunchEnvironment(); err != nil { - logger.Error("Unable to setup launch environment: %s", err.Error()) - os.Exit(14) - } - - stager.StagingComplete() -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_debug.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_debug.go deleted file mode 100644 index e803430..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_debug.go +++ /dev/null @@ -1,33 +0,0 @@ -package hooks - -import ( - "fmt" - "os" - - "github.com/cloudfoundry/libbuildpack" -) - -type hooks1 struct { - libbuildpack.DefaultHook -} - -type hooks2 struct { - libbuildpack.DefaultHook -} - -func init() { - if os.Getenv("BP_DEBUG") != "" { - libbuildpack.AddHook(hooks1{}) - libbuildpack.AddHook(hooks2{}) - } -} - -func (h hooks1) BeforeCompile(compiler *libbuildpack.Stager) error { - fmt.Println("HOOKS 1: BeforeCompile") - return nil -} - -func (h hooks2) AfterCompile(compiler *libbuildpack.Stager) error { - fmt.Println("HOOKS 2: AfterCompile") - return nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_suite_test.go deleted file mode 100644 index abfdc71..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/hooks/_hooks_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package hooks_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestHooks(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Hooks Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_integration_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_integration_suite_test.go deleted file mode 100644 index ac466dd..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_integration_suite_test.go +++ /dev/null @@ -1,164 +0,0 @@ -package integration_test - -import ( - "encoding/json" - "flag" - "fmt" - "net/url" - "os" - "os/exec" - "path/filepath" - "time" - - "github.com/blang/semver" - "github.com/cloudfoundry/libbuildpack/cutlass" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -var bpDir string -var buildpackVersion string -var packagedBuildpack cutlass.VersionedBuildpackPackage - -func init() { - flag.StringVar(&buildpackVersion, "version", "", "version to use (builds if empty)") - flag.BoolVar(&cutlass.Cached, "cached", true, "cached buildpack") - flag.StringVar(&cutlass.DefaultMemory, "memory", "128M", "default memory for pushed apps") - flag.StringVar(&cutlass.DefaultDisk, "disk", "384M", "default disk for pushed apps") - flag.Parse() -} - -var _ = SynchronizedBeforeSuite(func() []byte { - // Run once - if buildpackVersion == "" { - packagedBuildpack, err := cutlass.PackageUniquelyVersionedBuildpack("") // "" denotes any stack. Use specific stack (e.g. "cflinuxfs2" if desired) - Expect(err).NotTo(HaveOccurred()) - - data, err := json.Marshal(packagedBuildpack) - Expect(err).NotTo(HaveOccurred()) - return data - } - - return []byte{} -}, func(data []byte) { - // Run on all nodes - var err error - if len(data) > 0 { - err = json.Unmarshal(data, &packagedBuildpack) - Expect(err).NotTo(HaveOccurred()) - buildpackVersion = packagedBuildpack.Version - } - - bpDir, err = cutlass.FindRoot() - Expect(err).NotTo(HaveOccurred()) - - Expect(cutlass.CopyCfHome()).To(Succeed()) - cutlass.SeedRandom() - cutlass.DefaultStdoutStderr = GinkgoWriter -}) - -var _ = SynchronizedAfterSuite(func() { - // Run on all nodes -}, func() { - // Run once - Expect(cutlass.RemovePackagedBuildpack(packagedBuildpack)).To(Succeed()) - Expect(cutlass.DeleteOrphanedRoutes()).To(Succeed()) -}) - -func TestIntegration(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Integration Suite") -} - -func PushAppAndConfirm(app *cutlass.App) { - Expect(app.Push()).To(Succeed()) - Eventually(func() ([]string, error) { return app.InstanceStates() }, 20*time.Second).Should(Equal([]string{"RUNNING"})) - Expect(app.ConfirmBuildpack(buildpackVersion)).To(Succeed()) -} - -func Restart(app *cutlass.App) { - Expect(app.Restart()).To(Succeed()) - Eventually(func() ([]string, error) { return app.InstanceStates() }, 20*time.Second).Should(Equal([]string{"RUNNING"})) -} - -func ApiGreaterThan(version string) bool { - apiVersionString, err := cutlass.ApiVersion() - Expect(err).To(BeNil()) - apiVersion, err := semver.Make(apiVersionString) - Expect(err).To(BeNil()) - reqVersion, err := semver.ParseRange(">= " + version) - Expect(err).To(BeNil()) - return reqVersion(apiVersion) -} - -func ApiHasTask() bool { - return ApiGreaterThan("2.75.0") -} -func ApiHasMultiBuildpack() bool { - return ApiGreaterThan("2.90.0") -} - -func AssertUsesProxyDuringStagingIfPresent(fixtureName string) { - Context("with an uncached buildpack", func() { - BeforeEach(func() { - if cutlass.Cached { - Skip("Running cached tests") - } - }) - - It("uses a proxy during staging if present", func() { - proxy, err := cutlass.NewProxy() - Expect(err).To(BeNil()) - defer proxy.Close() - - bpFile := filepath.Join(bpDir, buildpackVersion+"tmp") - cmd := exec.Command("cp", packagedBuildpack.File, bpFile) - err = cmd.Run() - Expect(err).To(BeNil()) - defer os.Remove(bpFile) - - traffic, built, err := cutlass.InternetTraffic( - bpDir, - filepath.Join("fixtures", fixtureName), - bpFile, - []string{"HTTP_PROXY=" + proxy.URL, "HTTPS_PROXY=" + proxy.URL}, - ) - Expect(err).To(BeNil()) - Expect(built).To(BeTrue()) - - destUrl, err := url.Parse(proxy.URL) - Expect(err).To(BeNil()) - - Expect(cutlass.UniqueDestination( - traffic, fmt.Sprintf("%s.%s", destUrl.Hostname(), destUrl.Port()), - )).To(BeNil()) - }) - }) -} - -func AssertNoInternetTraffic(fixtureName string) { - It("has no traffic", func() { - if !cutlass.Cached { - Skip("Running uncached tests") - } - - bpFile := filepath.Join(bpDir, buildpackVersion+"tmp") - cmd := exec.Command("cp", packagedBuildpack.File, bpFile) - err := cmd.Run() - Expect(err).To(BeNil()) - defer os.Remove(bpFile) - - traffic, built, err := cutlass.InternetTraffic( - bpDir, - filepath.Join("fixtures", fixtureName), - bpFile, - []string{}, - ) - Expect(err).To(BeNil()) - Expect(built).To(BeTrue()) - Expect(traffic).To(BeEmpty()) - }) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_simple_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_simple_test.go deleted file mode 100644 index ebf5260..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/integration/_simple_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package integration_test - -import ( - "path/filepath" - - "github.com/cloudfoundry/libbuildpack/cutlass" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Simple Integration Test", func() { - var app *cutlass.App - AfterEach(func() { - if app != nil { - app.Destroy() - } - app = nil - }) - - // TODO This test is pending because it currently fails. It is just an example - PIt("app deploys", func() { - app = cutlass.New(filepath.Join(bpDir, "fixtures", "simple_test")) - app.Buildpacks = []string{"{{LANGUAGE}}_buildpack"} - PushAppAndConfirm(app) - Expect(app.GetBody("/")).To(ContainSubstring("Something on your website")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply.go deleted file mode 100644 index 5af7b8c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply.go +++ /dev/null @@ -1,49 +0,0 @@ -package supply - -import ( - "io" - - "github.com/cloudfoundry/libbuildpack" -) - -type Stager interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/stager.go - BuildDir() string - DepDir() string - DepsIdx() string - DepsDir() string -} - -type Manifest interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/manifest.go - AllDependencyVersions(string) []string - DefaultVersion(string) (libbuildpack.Dependency, error) -} - -type Installer interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/installer.go - InstallDependency(libbuildpack.Dependency, string) error - InstallOnlyVersion(string, string) error -} - -type Command interface { - //TODO: See more options at https://github.com/cloudfoundry/libbuildpack/blob/master/command.go - Execute(string, io.Writer, io.Writer, string, ...string) error - Output(dir string, program string, args ...string) (string, error) -} - -type Supplier struct { - Manifest Manifest - Installer Installer - Stager Stager - Command Command - Log *libbuildpack.Logger -} - -func (s *Supplier) Run() error { - s.Log.BeginStep("Supplying {{LANGUAGE}}") - - // TODO: Install any dependencies here... - - return nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_suite_test.go deleted file mode 100644 index 04bdd6c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package supply_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestSupply(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Supply Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_test.go deleted file mode 100644 index e15c243..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/_supply_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package supply_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -//go:generate mockgen -source=supply.go --destination=mocks_test.go --package=supply_test - -var _ = Describe("Supply", func() { - It("example test", func() { - Expect(false).To(Equal(false)) - }) - // TODO: Add tests here to check install dependency functions work -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_cli_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_cli_suite_test.go deleted file mode 100644 index 3d4ced4..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_cli_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package main_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestCli(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Supply Cli Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_main.go deleted file mode 100644 index c6ed7ec..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold/src/LANGUAGE/supply/cli/_main.go +++ /dev/null @@ -1,85 +0,0 @@ -package main - -import ( - _ "{{LANGUAGE}}/hooks" - "{{LANGUAGE}}/supply" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack" -) - -func main() { - logger := libbuildpack.NewLogger(os.Stdout) - - buildpackDir, err := libbuildpack.GetBuildpackDir() - if err != nil { - logger.Error("Unable to determine buildpack directory: %s", err.Error()) - os.Exit(9) - } - - manifest, err := libbuildpack.NewManifest(buildpackDir, logger, time.Now()) - if err != nil { - logger.Error("Unable to load buildpack manifest: %s", err.Error()) - os.Exit(10) - } - installer := libbuildpack.NewInstaller(manifest) - - stager := libbuildpack.NewStager(os.Args[1:], logger, manifest) - if err := stager.CheckBuildpackValid(); err != nil { - os.Exit(11) - } - - os.MkdirAll(filepath.Join(stager.DepDir(), "bin"), 0755) - os.MkdirAll(filepath.Join(stager.DepDir(), "lib"), 0755) - - if err = installer.SetAppCacheDir(stager.CacheDir()); err != nil { - logger.Error("Unable to setup app cache dir: %s", err) - os.Exit(18) - } - if err = manifest.ApplyOverride(stager.DepsDir()); err != nil { - logger.Error("Unable to apply override.yml files: %s", err) - os.Exit(17) - } - - err = libbuildpack.RunBeforeCompile(stager) - if err != nil { - logger.Error("Before Compile: %s", err.Error()) - os.Exit(12) - } - - if err := os.MkdirAll(filepath.Join(stager.DepDir(), "bin"), 0755); err != nil { - logger.Error("Unable to create bin directory: %s", err.Error()) - os.Exit(13) - } - - err = stager.SetStagingEnvironment() - if err != nil { - logger.Error("Unable to setup environment variables: %s", err.Error()) - os.Exit(14) - } - - s := supply.Supplier{ - Manifest: manifest, - Installer: installer, - Stager: stager, - Command: &libbuildpack.Command{}, - Log: logger, - } - - err = s.Run() - if err != nil { - logger.Error("Error: %s", err) - os.Exit(15) - } - - if err := stager.WriteConfigYml(nil); err != nil { - logger.Error("Error writing config.yml: %s", err.Error()) - os.Exit(16) - } - if err = installer.CleanupAppCache(); err != nil { - logger.Error("Unable clean up app cache: %s", err) - os.Exit(19) - } -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold_test.go deleted file mode 100644 index c6afe41..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/scaffold_test.go +++ /dev/null @@ -1,166 +0,0 @@ -package packager_test - -import ( - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "time" - - httpmock "gopkg.in/jarcoal/httpmock.v1" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/packager" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Scaffold", func() { - - var err error - - BeforeEach(func() { - httpmock.Reset() - }) - - Describe("Init", func() { - var baseDir string - BeforeEach(func() { - baseDir, err = ioutil.TempDir("", "scaffold-basedir") - Expect(err).To(BeNil()) - - // run the code under test - Expect(packager.Scaffold(filepath.Join(baseDir, "bpdir"), "mylanguage")).To(Succeed()) - }) - AfterEach(func() { - os.RemoveAll(baseDir) - }) - - checkfileexists := func(path string) func() { - return func() { - Expect(libbuildpack.FileExists(filepath.Join(baseDir, path))).To(BeTrue()) - } - } - - It("Creates all of the files", func() { - // top-level directories - By("creates a named directory", checkfileexists("bpdir")) - By("creates a bin directory", checkfileexists("bpdir/bin")) - By("creates a scripts directory", checkfileexists("bpdir/scripts")) - By("creates a src directory", checkfileexists("bpdir/src")) - By("creates a fixtures directory", checkfileexists("bpdir/fixtures")) - - // top-level files - By("creates a .envrc file", checkfileexists("bpdir/.envrc")) - By("creates a .envrc file", checkfileexists("bpdir/.gitignore")) - By("creates a manifest.yml file", checkfileexists("bpdir/manifest.yml")) - By("creates a VERSION file", checkfileexists("bpdir/VERSION")) - By("creates a README file", checkfileexists("bpdir/README.md")) - - // bin directory files - By("creates a detect script", checkfileexists("bpdir/bin/detect")) - By("creates a compile script", checkfileexists("bpdir/bin/compile")) - By("creates a supply script", checkfileexists("bpdir/bin/supply")) - By("creates a finalize script", checkfileexists("bpdir/bin/finalize")) - By("creates a release script", checkfileexists("bpdir/bin/release")) - - // scripts directory files - By("creates a brats test script", checkfileexists("bpdir/scripts/brats.sh")) - By("creates a build script", checkfileexists("bpdir/scripts/build.sh")) - By("creates a install_go script", checkfileexists("bpdir/scripts/install_go.sh")) - By("creates a install_tools script", checkfileexists("bpdir/scripts/install_tools.sh")) - By("creates a integration test script", checkfileexists("bpdir/scripts/integration.sh")) - By("creates a unit test script", checkfileexists("bpdir/scripts/unit.sh")) - - By("creates a Gopkg.toml", checkfileexists("bpdir/src/mylanguage/Gopkg.toml")) - - // src/supply files - By("creates a supply src directory", checkfileexists("bpdir/src/mylanguage/supply")) - By("creates a supply src file", checkfileexists("bpdir/src/mylanguage/supply/supply.go")) - By("creates a supply test file", checkfileexists("bpdir/src/mylanguage/supply/supply_test.go")) - By("creates a supply cli src file", checkfileexists("bpdir/src/mylanguage/supply/cli/main.go")) - - // src/finalize files - By("creates a finalize src directory", checkfileexists("bpdir/src/mylanguage/finalize")) - By("creates a finalize src file", checkfileexists("bpdir/src/mylanguage/finalize/finalize.go")) - By("creates a finalize test file", checkfileexists("bpdir/src/mylanguage/finalize/finalize.go")) - By("creates a finalize cli src file", checkfileexists("bpdir/src/mylanguage/finalize/cli/main.go")) - - By("creating unit tests that pass", func() { - //TODO: this is an integration test; move this into integration - command := exec.Command("./scripts/unit.sh") - command.Dir = filepath.Join(baseDir, "bpdir") - session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter) - Expect(err).ToNot(HaveOccurred()) - - Eventually(session, 1*time.Minute).Should(gexec.Exit(0)) - Expect(string(session.Out.Contents())).To(ContainSubstring("Supply Suite")) - Expect(string(session.Out.Contents())).To(ContainSubstring("Finalize Suite")) - }) - }) - }) - - Describe("Upgrade", func() { - var baseDir string - BeforeEach(func() { - var err error - baseDir, err = ioutil.TempDir("", "scaffold-basedir") - Expect(err).To(BeNil()) - - Expect(libbuildpack.CopyDirectory("fixtures/modified", baseDir)).To(Succeed()) - }) - AfterEach(func() { - os.RemoveAll(baseDir) - }) - - Context("Force flag not set", func() { - BeforeEach(func() { - Expect(packager.Upgrade(baseDir, false)).To(Succeed()) - }) - It("updates files user has NOT modified", func() { - file := "src/mylanguage/supply/supply_test.go" - current, err := ioutil.ReadFile(filepath.Join(baseDir, file)) - Expect(err).ToNot(HaveOccurred()) - previous, err := ioutil.ReadFile(filepath.Join("fixtures", "modified", file)) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(current)).ToNot(Equal(string(previous))) - }) - It("leaves files user HAS modified", func() { - file := "src/mylanguage/supply/supply.go" - current, err := ioutil.ReadFile(filepath.Join(baseDir, file)) - Expect(err).ToNot(HaveOccurred()) - previous, err := ioutil.ReadFile(filepath.Join("fixtures", "modified", file)) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(current)).To(Equal(string(previous))) - }) - }) - - Context("force flag is set", func() { - BeforeEach(func() { - Expect(packager.Upgrade(baseDir, true)).To(Succeed()) - }) - It("updates files user has NOT modified", func() { - file := "src/mylanguage/supply/supply_test.go" - current, err := ioutil.ReadFile(filepath.Join(baseDir, file)) - Expect(err).ToNot(HaveOccurred()) - previous, err := ioutil.ReadFile(filepath.Join("fixtures", "modified", file)) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(current)).ToNot(Equal(string(previous))) - }) - It("updates files user HAS modified", func() { - file := "src/mylanguage/supply/supply.go" - current, err := ioutil.ReadFile(filepath.Join(baseDir, file)) - Expect(err).ToNot(HaveOccurred()) - previous, err := ioutil.ReadFile(filepath.Join("fixtures", "modified", file)) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(current)).ToNot(Equal(string(previous))) - }) - }) - - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/summary_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/summary_test.go deleted file mode 100644 index 9e68602..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/packager/summary_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package packager_test - -import ( - "github.com/cloudfoundry/libbuildpack/packager" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - httpmock "gopkg.in/jarcoal/httpmock.v1" -) - -var _ = Describe("Packager", func() { - var ( - buildpackDir string - ) - BeforeEach(func() { - buildpackDir = "./fixtures/good" - - httpmock.Reset() - }) - - Describe("Summary", func() { - It("Renders tables of dependencies", func() { - s, e := packager.Summary(buildpackDir) - Expect(e).NotTo(HaveOccurred()) - Expect(s, e).To(Equal(` -Packaged binaries: - -| name | version | cf_stacks | -|-|-|-| -| ruby | 1.2.3 | cflinuxfs2 | -| ruby | 1.2.3 | cflinuxfs3 | - -Default binary versions: - -| name | version | -|-|-| -| ruby | 1.2.3 | -`)) - }) - - Context("modules exist", func() { - BeforeEach(func() { - buildpackDir = "./fixtures/modules" - }) - It("Renders tables of dependencies (including modules)", func() { - Expect(packager.Summary(buildpackDir)).To(Equal(` -Packaged binaries: - -| name | version | cf_stacks | modules | -|-|-|-|-| -| nginx | 1.7.3 | cflinuxfs2 | | -| php | 1.6.1 | cflinuxfs2 | gearman, geoip, zlib | -`)) - }) - }) - - Context("no dependencies", func() { - BeforeEach(func() { - buildpackDir = "./fixtures/no_dependencies" - }) - It("Produces no output", func() { - Expect(packager.Summary(buildpackDir)).To(Equal("")) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/detect/main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/detect/main.go deleted file mode 100644 index 3ac7814..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/detect/main.go +++ /dev/null @@ -1,81 +0,0 @@ -package main - -import ( - "io/ioutil" - "os" - "path/filepath" - "time" - - "github.com/pkg/errors" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/shims" -) - -var logger = libbuildpack.NewLogger(os.Stderr) - -func init() { - if len(os.Args) != 2 { - logger.Error("Incorrect number of arguments") - os.Exit(1) - } -} - -func main() { - exit(detect(logger)) -} - -func exit(err error) { - if err == nil { - os.Exit(0) - } - logger.Error("Failed detect step: %s", err.Error()) - os.Exit(1) -} - -func detect(logger *libbuildpack.Logger) error { - v2AppDir := os.Args[1] - - v2BuildpackDir, err := libbuildpack.GetBuildpackDir() - if err != nil { - return err - } - - tempDir, err := ioutil.TempDir("", "temp") - if err != nil { - return errors.Wrap(err, "unable to create temp dir") - } - defer os.RemoveAll(tempDir) - - v3BuildpacksDir := shims.V3BuildpacksDir - if err := os.MkdirAll(v3BuildpacksDir, 0777); err != nil { - return err - } - - metadataDir := shims.V3MetadataDir - if err := os.MkdirAll(metadataDir, 0777); err != nil { - return err - } - orderMetadata := filepath.Join(v2BuildpackDir, "order.toml") - groupMetadata := filepath.Join(metadataDir, "group.toml") - planMetadata := filepath.Join(metadataDir, "plan.toml") - - manifest, err := libbuildpack.NewManifest(v2BuildpackDir, logger, time.Now()) - if err != nil { - return err - } - - installer := shims.NewCNBInstaller(manifest) - - detector := shims.DefaultDetector{ - V3LifecycleDir: tempDir, - AppDir: v2AppDir, - V3BuildpacksDir: v3BuildpacksDir, - OrderMetadata: orderMetadata, - GroupMetadata: groupMetadata, - PlanMetadata: planMetadata, - Installer: installer, - } - - return detector.Detect() -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/finalize/main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/finalize/main.go deleted file mode 100644 index 6de3bac..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/finalize/main.go +++ /dev/null @@ -1,117 +0,0 @@ -package main - -import ( - "errors" - "io/ioutil" - "log" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/shims" -) - -var logger = libbuildpack.NewLogger(os.Stdout) - -func init() { - if len(os.Args) != 6 { - log.Fatal(errors.New("incorrect number of arguments")) - } -} - -func main() { - exit(finalize(logger)) -} - -func exit(err error) { - if err == nil { - os.Exit(0) - } - logger.Error("Failed finalize step: %s", err.Error()) - os.Exit(1) -} - -func finalize(logger *libbuildpack.Logger) error { - v2AppDir := os.Args[1] - v2CacheDir := os.Args[2] - v2DepsDir := os.Args[3] - v2DepsIndex := os.Args[4] - profileDir := os.Args[5] - - tempDir, err := ioutil.TempDir("", "temp") - if err != nil { - return err - } - - defer os.RemoveAll(tempDir) - - v3AppDir := shims.V3AppDir - v3LayersDir := shims.V3LayersDir - - storedOrderDir := shims.V3StoredOrderDir - defer os.RemoveAll(storedOrderDir) - - v3BuildpacksDir := shims.V3BuildpacksDir - defer os.RemoveAll(v3BuildpacksDir) - - metadataDir := shims.V3MetadataDir - if err := os.MkdirAll(metadataDir, 0777); err != nil { - return err - } - defer os.RemoveAll(metadataDir) - - orderMetadata := filepath.Join(metadataDir, "order.toml") - groupMetadata := filepath.Join(metadataDir, "group.toml") - planMetadata := filepath.Join(metadataDir, "plan.toml") - - v3LauncherDir := filepath.Join(v3AppDir, ".cloudfoundry") // We need to put the launcher binary somewhere in the droplet so it can run at launch. Can we put this here? If it is in depsDir/launcher could overlap with a v3 buildpack called "launcher" - if err := os.MkdirAll(v3LauncherDir, 0777); err != nil { - return err - } - - buildpackDir, err := libbuildpack.GetBuildpackDir() - if err != nil { - return err - } - - manifest, err := libbuildpack.NewManifest(buildpackDir, logger, time.Now()) - if err != nil { - return err - } - - installer := shims.NewCNBInstaller(manifest) - - detector := shims.DefaultDetector{ - AppDir: v3AppDir, - V3LifecycleDir: tempDir, - V3BuildpacksDir: v3BuildpacksDir, - OrderMetadata: orderMetadata, - GroupMetadata: groupMetadata, - PlanMetadata: planMetadata, - Installer: installer, - } - - finalizer := shims.Finalizer{ - V2AppDir: v2AppDir, - V3AppDir: v3AppDir, - V2DepsDir: v2DepsDir, - V2CacheDir: v2CacheDir, - V3LayersDir: v3LayersDir, - V3BuildpacksDir: v3BuildpacksDir, - DepsIndex: v2DepsIndex, - OrderDir: storedOrderDir, - OrderMetadata: orderMetadata, - GroupMetadata: groupMetadata, - PlanMetadata: planMetadata, - V3LifecycleDir: tempDir, - V3LauncherDir: v3LauncherDir, - ProfileDir: profileDir, - Detector: detector, - Installer: installer, - Manifest: manifest, - Logger: logger, - } - - return finalizer.Finalize() -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/release/main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/release/main.go deleted file mode 100644 index d3c2599..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/release/main.go +++ /dev/null @@ -1,38 +0,0 @@ -package main - -import ( - "errors" - "log" - "os" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack/shims" -) - -func init() { - if len(os.Args) != 2 { - log.Fatal(errors.New("incorrect number of arguments")) - } -} - -func main() { - exit(run()) -} - -func run() error { - metadataPath := filepath.Join(os.Args[1], ".cloudfoundry", "metadata.toml") - releaser := shims.Releaser{MetadataPath: metadataPath, Writer: os.Stdout} - - if err := releaser.Release(); err != nil { - return err - } - return nil -} - -func exit(err error) { - if err == nil { - os.Exit(0) - } - log.Printf("Failed release step: %s\n", err) - os.Exit(1) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/supply/main.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/supply/main.go deleted file mode 100644 index 1db23e1..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/cmd/supply/main.go +++ /dev/null @@ -1,80 +0,0 @@ -package main - -import ( - "os" - "time" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/shims" -) - -var logger = libbuildpack.NewLogger(os.Stdout) - -func init() { - if len(os.Args) != 5 { - logger.Error("Incorrect number of arguments") - os.Exit(1) - } -} - -func main() { - exit(supply(logger)) -} - -func exit(err error) { - if err == nil { - os.Exit(0) - } - logger.Error("Failed supply step: %s", err.Error()) - os.Exit(1) -} - -func supply(logger *libbuildpack.Logger) error { - v2AppDir := os.Args[1] - v2CacheDir := os.Args[2] - v2DepsDir := os.Args[3] - depsIndex := os.Args[4] - - buildpackDir, err := libbuildpack.GetBuildpackDir() - if err != nil { - return err - } - - v3AppDir := shims.V3AppDir - if err := os.MkdirAll(v3AppDir, 0777); err != nil { - return err - } - - storedOrderDir := shims.V3StoredOrderDir - if err := os.MkdirAll(storedOrderDir, 0777); err != nil { - return err - } - - v3BuildpacksDir := shims.V3BuildpacksDir - err = os.MkdirAll(v3BuildpacksDir, 0777) - if err != nil { - return err - } - - manifest, err := libbuildpack.NewManifest(buildpackDir, logger, time.Now()) - if err != nil { - return err - } - installer := shims.NewCNBInstaller(manifest) - - supplier := shims.Supplier{ - V2AppDir: v2AppDir, - V3AppDir: v3AppDir, - V2DepsDir: v2DepsDir, - V2CacheDir: v2CacheDir, - DepsIndex: depsIndex, - V2BuildpackDir: buildpackDir, - V3BuildpacksDir: v3BuildpacksDir, - OrderDir: storedOrderDir, - Installer: installer, - Manifest: manifest, - Logger: logger, - } - - return supplier.Supply() -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector.go deleted file mode 100644 index 2ab6178..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector.go +++ /dev/null @@ -1,55 +0,0 @@ -package shims - -import ( - "os" - "os/exec" - "path/filepath" - - "github.com/pkg/errors" -) - -type Installer interface { - InstallCNBS(orderFile string, installDir string) error - InstallLifecycle(dst string) error -} - -type DefaultDetector struct { - V3LifecycleDir string - - AppDir string - - V3BuildpacksDir string - - OrderMetadata string - GroupMetadata string - PlanMetadata string - - Installer Installer -} - -func (d DefaultDetector) Detect() error { - if err := d.Installer.InstallCNBS(d.OrderMetadata, d.V3BuildpacksDir); err != nil { - return errors.Wrap(err, "failed to install buildpacks for detection") - } - - return d.RunLifecycleDetect() -} - -func (d DefaultDetector) RunLifecycleDetect() error { - if err := d.Installer.InstallLifecycle(d.V3LifecycleDir); err != nil { - return errors.Wrap(err, "failed to install v3 lifecycle binaries") - } - - cmd := exec.Command( - filepath.Join(d.V3LifecycleDir, V3Detector), - "-app", d.AppDir, - "-buildpacks", d.V3BuildpacksDir, - "-order", d.OrderMetadata, - "-group", d.GroupMetadata, - "-plan", d.PlanMetadata, - ) - - cmd.Stderr = os.Stderr - cmd.Env = append(os.Environ(), "CNB_STACK_ID=org.cloudfoundry.stacks."+os.Getenv("CF_STACK")) - return cmd.Run() -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector_test.go deleted file mode 100644 index 5a0845d..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/detector_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package shims_test - -import ( - "io/ioutil" - "os" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack/shims" - "github.com/golang/mock/gomock" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -//go:generate mockgen -source=detector.go --destination=mocks_detector_shims_test.go --package=shims_test - -var _ = Describe("Detector", func() { - var ( - detector shims.DefaultDetector - v3BuildpacksDir string - v3AppDir string - tempDir string - v3LifecycleDir string - groupMetadata string - orderMetadata string - planMetadata string - mockInstaller *MockInstaller - mockCtrl *gomock.Controller - ) - - BeforeEach(func() { - var err error - mockCtrl = gomock.NewController(GinkgoT()) - mockInstaller = NewMockInstaller(mockCtrl) - - tempDir, err = ioutil.TempDir("", "tmp") - Expect(err).NotTo(HaveOccurred()) - - v3AppDir = filepath.Join(tempDir, "cnb-app") - - v3LifecycleDir = filepath.Join(tempDir, "lifecycle-dir") - Expect(os.MkdirAll(v3LifecycleDir, 0777)).To(Succeed()) - - groupMetadata = filepath.Join(tempDir, "metadata", "group.toml") - orderMetadata = filepath.Join(tempDir, "metadata", "order.toml") - planMetadata = filepath.Join(tempDir, "metadata", "plan.toml") - - v3BuildpacksDir = filepath.Join(tempDir, "buildpacks") - - detector = shims.DefaultDetector{ - AppDir: v3AppDir, - V3BuildpacksDir: v3BuildpacksDir, - V3LifecycleDir: v3LifecycleDir, - OrderMetadata: orderMetadata, - GroupMetadata: groupMetadata, - PlanMetadata: planMetadata, - Installer: mockInstaller, - } - }) - - AfterEach(func() { - Expect(os.RemoveAll(tempDir)).To(Succeed()) - }) - - Context("Running Detect", func() { - It("should Run v3-detector", func() { - mockInstaller.EXPECT().InstallCNBS(orderMetadata, v3BuildpacksDir) - mockInstaller.EXPECT().InstallLifecycle(v3LifecycleDir).Do(func(path string) error { - contents := "#!/usr/bin/env bash\nexit 0\n" - return ioutil.WriteFile(filepath.Join(path, "detector"), []byte(contents), os.ModePerm) - }) - Expect(detector.Detect()).ToNot(HaveOccurred()) - }) - }) - -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer.go deleted file mode 100644 index 0658a01..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer.go +++ /dev/null @@ -1,367 +0,0 @@ -package shims - -import ( - "fmt" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strconv" - - "github.com/BurntSushi/toml" - "github.com/cloudfoundry/libbuildpack" - "github.com/pkg/errors" -) - -var ( - V3LifecycleDep = "lifecycle" - V3Detector = "detector" - V3Builder = "builder" - V3Launcher = "launcher" - V3LaunchScript = "0_shim.sh" - V3AppDir = filepath.Join(string(filepath.Separator), "home", "vcap", "app") - V3LayersDir = filepath.Join(string(filepath.Separator), "home", "vcap", "deps") - V3MetadataDir = filepath.Join(string(filepath.Separator), "home", "vcap", "metadata") - V3StoredOrderDir = filepath.Join(string(filepath.Separator), "home", "vcap", "order") - V3BuildpacksDir = filepath.Join(string(filepath.Separator), "home", "vcap", "cnbs") -) - -type Detector interface { - RunLifecycleDetect() error -} - -type LayerMetadata struct { - Build bool `toml:"build"` - Launch bool `toml:"launch"` - Cache bool `toml:"cache"` -} - -type Finalizer struct { - V2AppDir string - V3AppDir string - V2DepsDir string - V2CacheDir string - V3LayersDir string - V3BuildpacksDir string - DepsIndex string - OrderDir string - OrderMetadata string - GroupMetadata string - PlanMetadata string - V3LifecycleDir string - V3LauncherDir string - ProfileDir string - Detector Detector - Installer Installer - Manifest *libbuildpack.Manifest - Logger *libbuildpack.Logger -} - -func (f *Finalizer) Finalize() error { - if err := os.RemoveAll(f.V2AppDir); err != nil { - return errors.Wrap(err, "failed to remove error file") - } - - if err := f.MergeOrderTOMLs(); err != nil { - return errors.Wrap(err, "failed to merge order metadata") - } - - if err := f.RunV3Detect(); err != nil { - return errors.Wrap(err, "failed to run V3 detect") - } - - if err := f.IncludePreviousV2Buildpacks(); err != nil { - return errors.Wrap(err, "failed to include previous v2 buildpacks") - } - - if err := f.Installer.InstallLifecycle(f.V3LifecycleDir); err != nil { - return errors.Wrap(err, "failed to install "+V3Builder) - } - - if err := f.RestoreV3Cache(); err != nil { - return errors.Wrap(err, "failed to restore v3 cache") - } - - if err := f.RunLifeycleBuild(); err != nil { - return errors.Wrap(err, "failed to run v3 lifecycle builder") - } - - if err := os.Rename(filepath.Join(f.V3LifecycleDir, V3Launcher), filepath.Join(f.V3LauncherDir, V3Launcher)); err != nil { - return errors.Wrap(err, "failed to move launcher") - } - - if err := os.Rename(f.V3AppDir, f.V2AppDir); err != nil { - return errors.Wrap(err, "failed to move app") - } - - if err := f.MoveV3Layers(); err != nil { - return errors.Wrap(err, "failed to move V3 dependencies") - } - - if err := f.Manifest.StoreBuildpackMetadata(f.V2CacheDir); err != nil { - return err - } - - return f.WriteProfileLaunch() -} - -func (f *Finalizer) MergeOrderTOMLs() error { - var orders []order - - if err := parseOrderTOMLs(&orders, f.OrderDir); err != nil { - return err - } - - if len(orders) == 0 { - return errors.New("no order.toml found") - } - - return encodeTOML(f.OrderMetadata, combineOrders(orders)) -} - -func (f *Finalizer) RunV3Detect() error { - _, groupErr := os.Stat(f.GroupMetadata) - _, planErr := os.Stat(f.PlanMetadata) - - if os.IsNotExist(groupErr) || os.IsNotExist(planErr) { - return f.Detector.RunLifecycleDetect() - } - - return nil -} - -func (f *Finalizer) IncludePreviousV2Buildpacks() error { - myIDx, err := strconv.Atoi(f.DepsIndex) - if err != nil { - return err - } - - if err := os.RemoveAll(filepath.Join(f.V2DepsDir, f.DepsIndex)); err != nil { - return err - } - - for supplyDepsIndex := myIDx - 1; supplyDepsIndex >= 0; supplyDepsIndex-- { - v2Layer := filepath.Join(f.V2DepsDir, strconv.Itoa(supplyDepsIndex)) - if _, err := os.Stat(v2Layer); os.IsNotExist(err) { - continue - } - - buildpackID := fmt.Sprintf("buildpack.%d", supplyDepsIndex) - v3Layer := filepath.Join(f.V3LayersDir, buildpackID, "layer") - - if err := f.MoveV2Layers(v2Layer, v3Layer); err != nil { - return err - } - if err := f.WriteLayerMetadata(v3Layer); err != nil { - return err - } - if err := f.RenameEnvDir(v3Layer); err != nil { - return err - } - if err := f.UpdateGroupTOML(buildpackID); err != nil { - return err - } - if err := f.AddFakeCNBBuildpack(buildpackID); err != nil { - return err - } - } - - return nil -} - -func (f *Finalizer) MoveV3Layers() error { - bpLayers, err := filepath.Glob(filepath.Join(f.V3LayersDir, "*")) - if err != nil { - return err - } - for _, bpLayerPath := range bpLayers { - base := filepath.Base(bpLayerPath) - if base == "config" { - if err := f.moveV3Config(); err != nil { - return err - } - } else { - if err := f.moveV3Layer(bpLayerPath); err != nil { - return err - } - } - } - - return nil -} - -func (f *Finalizer) RestoreV3Cache() error { - //Copies cache over, and unused layers will get automatically cleaned up after successful build - cnbCache := filepath.Join(f.V2CacheDir, "cnb") - if exists, err := libbuildpack.FileExists(cnbCache); err != nil { - return err - } else if exists { - return libbuildpack.MoveDirectory(cnbCache, f.V3LayersDir) - } - return nil -} - -func (f *Finalizer) RunLifeycleBuild() error { - cmd := exec.Command( - filepath.Join(f.V3LifecycleDir, V3Builder), - "-app", f.V3AppDir, - "-buildpacks", f.V3BuildpacksDir, - "-group", f.GroupMetadata, - "-layers", f.V3LayersDir, - "-plan", f.PlanMetadata, - ) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - cmd.Env = append(os.Environ(), "CNB_STACK_ID=org.cloudfoundry.stacks."+os.Getenv("CF_STACK")) - - return cmd.Run() -} - -func (f *Finalizer) MoveV2Layers(src, dst string) error { - if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil { - return err - } - - return os.Rename(src, dst) -} - -func (f *Finalizer) WriteLayerMetadata(path string) error { - contents := LayerMetadata{true, true, false} - return encodeTOML(path+".toml", contents) -} - -func (f *Finalizer) ReadLayerMetadata(path string) (LayerMetadata, error) { - contents := LayerMetadata{} - if _, err := toml.DecodeFile(path, &contents); err != nil { - return LayerMetadata{}, err - } - return contents, nil -} - -func (f *Finalizer) RenameEnvDir(dst string) error { - if err := os.Rename(filepath.Join(dst, "env"), filepath.Join(dst, "env.build")); err != nil && !os.IsNotExist(err) { - return err - } - return nil -} - -func (f *Finalizer) UpdateGroupTOML(buildpackID string) error { - var groupMetadata group - - if _, err := toml.DecodeFile(f.GroupMetadata, &groupMetadata); err != nil { - return err - } - - groupMetadata.Buildpacks = append([]buildpack{{ID: buildpackID}}, groupMetadata.Buildpacks...) - - return encodeTOML(f.GroupMetadata, groupMetadata) -} - -func (f *Finalizer) AddFakeCNBBuildpack(buildpackID string) error { - buildpackPath := filepath.Join(f.V3BuildpacksDir, buildpackID, "latest") - if err := os.MkdirAll(buildpackPath, 0777); err != nil { - return err - } - - buildpackMetadataFile, err := os.Create(filepath.Join(buildpackPath, "buildpack.toml")) - if err != nil { - return err - } - defer buildpackMetadataFile.Close() - - if err = encodeTOML(filepath.Join(buildpackPath, "buildpack.toml"), struct { - Buildpack buildpack `toml:"buildpack"` - Stacks []stack `toml:"stacks"` - }{ - Buildpack: buildpack{ - ID: buildpackID, - Name: buildpackID, - Version: "latest", - }, - Stacks: []stack{{ - ID: "org.cloudfoundry.stacks." + os.Getenv("CF_STACK"), - }}, - }); err != nil { - return err - } - - if err := os.MkdirAll(filepath.Join(buildpackPath, "bin"), 0777); err != nil { - return err - } - - return ioutil.WriteFile(filepath.Join(buildpackPath, "bin", "build"), []byte(`#!/bin/bash`), 0777) -} - -func (f *Finalizer) WriteProfileLaunch() error { - profileContents := fmt.Sprintf( - `export CNB_STACK_ID="org.cloudfoundry.stacks.%s" -export CNB_LAYERS_DIR="$DEPS_DIR" -export CNB_APP_DIR="$HOME" -exec $HOME/.cloudfoundry/%s "$2" -`, - os.Getenv("CF_STACK"), V3Launcher) - - return ioutil.WriteFile(filepath.Join(f.ProfileDir, V3LaunchScript), []byte(profileContents), 0666) -} - -func (f *Finalizer) moveV3Config() error { - if err := os.Rename(filepath.Join(f.V3LayersDir, "config"), filepath.Join(f.V2DepsDir, "config")); err != nil { - return err - } - - if err := os.MkdirAll(filepath.Join(f.V2AppDir, ".cloudfoundry"), 0777); err != nil { - return err - } - - if err := libbuildpack.CopyFile(filepath.Join(f.V2DepsDir, "config", "metadata.toml"), filepath.Join(f.V2AppDir, ".cloudfoundry", "metadata.toml")); err != nil { - return err - } - return nil -} - -func (f *Finalizer) moveV3Layer(layersPath string) error { - layersName := filepath.Base(layersPath) - tomls, err := filepath.Glob(filepath.Join(layersPath, "*.toml")) - if err != nil { - return err - } - - for _, tomlFile := range tomls { - decodedToml, err := f.ReadLayerMetadata(tomlFile) - if err != nil { - return err - } - - tomlSize := len(".toml") - if decodedToml.Cache { - layerPath := tomlFile[:len(tomlFile)-tomlSize] - layerName := filepath.Base(layerPath) - if err := f.cacheLayer(layerPath, layersName, layerName); err != nil { - return err - } - } - - } - - if err := os.MkdirAll(filepath.Join(f.V2DepsDir, layersName), os.ModePerm); err != nil { - return err - } - - if err := libbuildpack.CopyDirectory(layersPath, filepath.Join(f.V2DepsDir, layersName)); err != nil { - return err - } - - return nil -} - -func (f *Finalizer) cacheLayer(v3Path, layersName, layerName string) error { - cacheDir := filepath.Join(f.V2CacheDir, "cnb", layersName, layerName) - if err := os.MkdirAll(cacheDir, os.ModePerm); err != nil { - return err - } - err := libbuildpack.CopyFile(v3Path+".toml", cacheDir+".toml") - if err != nil { - return err - } - return libbuildpack.CopyDirectory(v3Path, cacheDir) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer_test.go deleted file mode 100644 index c24de41..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/finalizer_test.go +++ /dev/null @@ -1,706 +0,0 @@ -package shims_test - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack" - - "github.com/cloudfoundry/libbuildpack/shims" - "github.com/golang/mock/gomock" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -//go:generate mockgen -source=finalizer.go --destination=mocks_shims_test.go --package=shims_test -//go:generate mockgen -source=detector.go --destination=mocks_detector_shims_test.go --package=shims_test - -var _ = Describe("Finalizer", func() { - var ( - finalizer shims.Finalizer - mockCtrl *gomock.Controller - mockDetector *MockDetector - tempDir, - v2AppDir, - v3AppDir, - v2DepsDir, - v2CacheDir, - v3LayersDir, - v3LauncherDir, - v3BuildpacksDir, - orderDir, - orderMetadata, - planMetadata, - groupMetadata, - profileDir, - binDir, - depsIndex string - finalizeLogger *libbuildpack.Logger - ) - - BeforeEach(func() { - var err error - - mockCtrl = gomock.NewController(GinkgoT()) - mockDetector = NewMockDetector(mockCtrl) - - depsIndex = "0" - - tempDir, err = ioutil.TempDir("", "tmp") - Expect(err).NotTo(HaveOccurred()) - - v2AppDir = filepath.Join(tempDir, "v2_app") - Expect(os.MkdirAll(v2AppDir, 0777)).To(Succeed()) - - v3AppDir = filepath.Join(tempDir, "v3_app") - Expect(os.MkdirAll(v3AppDir, 0777)).To(Succeed()) - - v2DepsDir = filepath.Join(tempDir, "deps") - - v2CacheDir = filepath.Join(tempDir, "cache") - Expect(os.MkdirAll(tempDir, 0777)).To(Succeed()) - - v3LayersDir = filepath.Join(tempDir, "layers") - Expect(os.MkdirAll(v3LayersDir, 0777)).To(Succeed()) - - v3LauncherDir = filepath.Join(tempDir, "launch") - Expect(os.MkdirAll(v3LauncherDir, 0777)).To(Succeed()) - - v3BuildpacksDir = filepath.Join(tempDir, "cnbs") - Expect(os.MkdirAll(v3BuildpacksDir, 0777)).To(Succeed()) - - orderDir = filepath.Join(tempDir, "order") - Expect(os.MkdirAll(orderDir, 0777)).To(Succeed()) - - orderMetadata = filepath.Join(tempDir, "order.toml") - planMetadata = filepath.Join(tempDir, "plan.toml") - groupMetadata = filepath.Join(tempDir, "group.toml") - - profileDir = filepath.Join(tempDir, "profile") - Expect(os.MkdirAll(profileDir, 0777)).To(Succeed()) - - binDir = filepath.Join(tempDir, "bin") - Expect(os.MkdirAll(binDir, 0777)).To(Succeed()) - - Expect(os.Setenv("CF_STACK", "some-stack")).To(Succeed()) - - finalizeLogger = &libbuildpack.Logger{} - }) - - JustBeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(v2DepsDir, depsIndex), 0777)).To(Succeed()) - - finalizer = shims.Finalizer{ - V2AppDir: v2AppDir, - V3AppDir: v3AppDir, - V2DepsDir: v2DepsDir, - V2CacheDir: v2CacheDir, - V3LayersDir: v3LayersDir, - V3LauncherDir: v3LauncherDir, - V3BuildpacksDir: v3BuildpacksDir, - DepsIndex: depsIndex, - OrderDir: orderDir, - OrderMetadata: orderMetadata, - PlanMetadata: planMetadata, - GroupMetadata: groupMetadata, - ProfileDir: profileDir, - V3LifecycleDir: binDir, - Detector: mockDetector, - Logger: finalizeLogger, - } - }) - - AfterEach(func() { - mockCtrl.Finish() - Expect(os.Unsetenv("CF_STACK")).To(Succeed()) - Expect(os.RemoveAll(tempDir)).To(Succeed()) - }) - - Context("MergeOrderTOMLs", func() { - var ( - orderFileA, orderFileB, orderFileC string - ) - - BeforeEach(func() { - orderFileA = filepath.Join(orderDir, "orderA.toml") - orderFileB = filepath.Join(orderDir, "orderB.toml") - }) - - Context("group A has one group, group B has one groups", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(orderFileA, []byte(generateOrderTOMLGroupString("X", []bp{{id: "bpA", optional: false}, {id: "bpB", optional: true}})), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(orderFileB, []byte(generateOrderTOMLGroupString("Y", []bp{{id: "bpC", optional: false}, {id: "bpD", optional: false}})), 0777)).To(Succeed()) - }) - - It("merges the order files", func() { - Expect(finalizer.MergeOrderTOMLs()).To(Succeed()) - orderTOML, err := ioutil.ReadFile(orderMetadata) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(orderTOML)).To(ContainSubstring(`[[groups]] - labels = ["X", "Y"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - optional = true - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest"`)) - }) - }) - - Context("group A has one group, group B has two groups", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(orderFileA, []byte(generateOrderTOMLGroupString("X", []bp{{id: "bpA", optional: false}, {id: "bpB", optional: true}})), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(orderFileB, []byte( - generateOrderTOMLGroupString("Y", []bp{{id: "bpC", optional: false}, {id: "bpD", optional: false}})+"\n"+ - generateOrderTOMLGroupString("Z", []bp{{id: "bpC", optional: false}, {id: "bpE", optional: false}}), - ), 0777)).To(Succeed()) - }) - - It("merges the order files", func() { - Expect(finalizer.MergeOrderTOMLs()).To(Succeed()) - orderTOML, err := ioutil.ReadFile(orderMetadata) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(orderTOML)).To(ContainSubstring(`[[groups]] - labels = ["X", "Y"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - optional = true - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - -[[groups]] - labels = ["X", "Z"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - optional = true - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpE" - version = "latest"`)) - }) - }) - - Context("group A has two group, group B has two groups", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(orderFileA, []byte( - generateOrderTOMLGroupString("X1", []bp{{id: "bpA", optional: false}, {id: "bpB", optional: false}})+ - "\n"+ - generateOrderTOMLGroupString("X2", []bp{{id: "bpA", optional: false}, {id: "bpC", optional: false}}), - ), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(orderFileB, []byte( - generateOrderTOMLGroupString("Y1", []bp{{id: "bpD", optional: false}, {id: "bpE", optional: false}})+ - "\n"+ - generateOrderTOMLGroupString("Y2", []bp{{id: "bpD", optional: false}, {id: "bpF", optional: false}}), - ), 0777)).To(Succeed()) - }) - - It("merges the order files", func() { - Expect(finalizer.MergeOrderTOMLs()).To(Succeed()) - orderTOML, err := ioutil.ReadFile(orderMetadata) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(orderTOML)).To(ContainSubstring(`[[groups]] - labels = ["X1", "Y1"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpE" - version = "latest" - -[[groups]] - labels = ["X1", "Y2"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpF" - version = "latest" - -[[groups]] - labels = ["X2", "Y1"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpE" - version = "latest" - -[[groups]] - labels = ["X2", "Y2"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpF" - version = "latest"`)) - }) - }) - - Context("group A has one group, group B has one groups, groupC has two groups", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(orderFileA, []byte(generateOrderTOMLGroupString("X", []bp{{id: "bpA", optional: false}, {id: "bpB", optional: true}})), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(orderFileB, []byte(generateOrderTOMLGroupString("Y", []bp{{id: "bpC", optional: false}, {id: "bpD", optional: false}})), 0777)).To(Succeed()) - orderFileC = filepath.Join(orderDir, "orderC.toml") - Expect(ioutil.WriteFile(orderFileC, []byte( - generateOrderTOMLGroupString("Z1", []bp{{id: "bpE", optional: false}, {id: "bpF", optional: false}})+ - "\n"+ - generateOrderTOMLGroupString("Z2", []bp{{id: "bpE", optional: false}, {id: "bpG", optional: false}}), - ), 0777)).To(Succeed()) - }) - - It("merges the order files", func() { - Expect(finalizer.MergeOrderTOMLs()).To(Succeed()) - orderTOML, err := ioutil.ReadFile(orderMetadata) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(orderTOML)).To(ContainSubstring(`[[groups]] - labels = ["X", "Y", "Z1"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - optional = true - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpE" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpF" - version = "latest" - -[[groups]] - labels = ["X", "Y", "Z2"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - optional = true - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpD" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpE" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpG" - version = "latest" -`)) - }) - }) - - Context("group A has one group, group B has one group with a duplicate buildpack", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(orderFileA, []byte(generateOrderTOMLGroupString("X", []bp{{id: "bpA", optional: false}, {id: "bpB", optional: false}})), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(orderFileB, []byte(generateOrderTOMLGroupString("Y", []bp{{id: "bpA", optional: false}, {id: "bpC", optional: false}})), 0777)).To(Succeed()) - }) - - It("merges the order files", func() { - Expect(finalizer.MergeOrderTOMLs()).To(Succeed()) - orderTOML, err := ioutil.ReadFile(orderMetadata) - Expect(err).ToNot(HaveOccurred()) - - Expect(string(orderTOML)).To(ContainSubstring(`[[groups]] - labels = ["X", "Y"] - - [[groups.buildpacks]] - id = "this.is.a.fake.bpA" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpB" - version = "latest" - - [[groups.buildpacks]] - id = "this.is.a.fake.bpC" - version = "latest"`)) - }) - }) - }) - - Context("RunV3Detect", func() { - It("runs detection when group or plan metadata does not exist", func() { - mockDetector. - EXPECT(). - RunLifecycleDetect() - Expect(finalizer.RunV3Detect()).To(Succeed()) - }) - - It("does NOT run detection when group and plan metadata exists", func() { - Expect(ioutil.WriteFile(groupMetadata, []byte(""), 0666)).To(Succeed()) - Expect(ioutil.WriteFile(planMetadata, []byte(""), 0666)).To(Succeed()) - - mockDetector. - EXPECT(). - RunLifecycleDetect(). - Times(0) - Expect(finalizer.RunV3Detect()).To(Succeed()) - }) - }) - - Context("IncludePreviousV2Buildpacks", func() { - var ( - createDirs, createFiles []string - ) - - BeforeEach(func() { - depsIndex = "2" - createDirs = []string{"bin", "lib"} - createFiles = []string{"config.yml"} - for _, dir := range createDirs { - Expect(os.MkdirAll(filepath.Join(v2DepsDir, "0", dir), 0777)).To(Succeed()) - } - - for _, file := range createFiles { - Expect(ioutil.WriteFile(filepath.Join(v2DepsDir, "0", file), []byte(file), 0666)).To(Succeed()) - } - - Expect(ioutil.WriteFile(groupMetadata, []byte(`[[buildpacks]] - id = "buildpack.1" - version = "" -[[buildpacks]] - id = "buildpack.2" - version = ""`), 0666)).To(Succeed()) - Expect(ioutil.WriteFile(planMetadata, []byte(""), 0666)).To(Succeed()) - }) - - It("copies v2 layers and metadata where v3 lifecycle expects them for build and launch", func() { - By("not failing if a layer has already been moved") - Expect(finalizer.IncludePreviousV2Buildpacks()).To(Succeed()) - - By("putting the v2 layers in the corrent directory structure") - for _, dir := range createDirs { - Expect(filepath.Join(v3LayersDir, "buildpack.0", "layer", dir)).To(BeADirectory()) - } - - for _, file := range createFiles { - Expect(filepath.Join(v3LayersDir, "buildpack.0", "layer", file)).To(BeAnExistingFile()) - } - - By("writing the group metadata in the order the buildpacks should be sourced") - groupMetadataContents, err := ioutil.ReadFile(groupMetadata) - Expect(err).ToNot(HaveOccurred()) - Expect(string(groupMetadataContents)).To(Equal(`[[buildpacks]] - id = "buildpack.0" - version = "" - -[[buildpacks]] - id = "buildpack.1" - version = "" - -[[buildpacks]] - id = "buildpack.2" - version = "" -`)) - }) - }) - - Context("RestoreV3Cache", func() { - BeforeEach(func() { - cloudfoundryV3Cache := filepath.Join(v2CacheDir, "cnb") - testLayers := filepath.Join(cloudfoundryV3Cache, "org.cloudfoundry.generic.buildpack") - Expect(os.MkdirAll(cloudfoundryV3Cache, 0777)).To(Succeed()) - Expect(os.MkdirAll(filepath.Join(testLayers, "layer"), 0777)).To(Succeed()) - Expect(os.MkdirAll(filepath.Join(testLayers, "anotherLayer"), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(testLayers, "anotherLayer", "cachedContents"), []byte("cached contents"), 0666)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(testLayers, "anotherLayer", "anotherLayer.toml"), []byte("cache=true"), 0666)).To(Succeed()) - }) - - It("should restore cache before building", func() { - restoredLayers := filepath.Join(finalizer.V3LayersDir, "org.cloudfoundry.generic.buildpack") - Expect(finalizer.RestoreV3Cache()).ToNot(HaveOccurred()) - Expect(filepath.Join(restoredLayers, "layer")).To(BeADirectory()) - Expect(filepath.Join(restoredLayers, "anotherLayer")).To(BeADirectory()) - Expect(filepath.Join(restoredLayers, "anotherLayer", "cachedContents")).To(BeAnExistingFile()) - contents, err := ioutil.ReadFile(filepath.Join(restoredLayers, "anotherLayer", "cachedContents")) - Expect(err).ToNot(HaveOccurred()) - Expect(contents).To(ContainSubstring("cached contents")) - }) - }) - - Context("MoveV3Layers", func() { - BeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(v3LayersDir, "config"), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(v3LayersDir, "config", "metadata.toml"), []byte(""), 0666)).To(Succeed()) - - Expect(os.MkdirAll(filepath.Join(v3LayersDir, "layers"), 0777)).To(Succeed()) - Expect(os.MkdirAll(filepath.Join(v3LayersDir, "anotherLayers", "innerLayer"), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(v3LayersDir, "anotherLayers", "innerLayer.toml"), []byte("cache=true"), 0666)).To(Succeed()) - }) - - It("moves the layers to deps dir and metadata to build dir", func() { - Expect(finalizer.MoveV3Layers()).To(Succeed()) - Expect(filepath.Join(v2AppDir, ".cloudfoundry", "metadata.toml")).To(BeAnExistingFile()) - Expect(filepath.Join(v2DepsDir, "layers")).To(BeAnExistingFile()) - Expect(filepath.Join(v2DepsDir, "anotherLayers")).To(BeAnExistingFile()) - }) - - It("copies cacheable layers to the cache/cnb directory", func() { - Expect(filepath.Join(v2CacheDir, "cnb")).ToNot(BeADirectory()) - Expect(finalizer.MoveV3Layers()).To(Succeed()) - Expect(filepath.Join(v2CacheDir, "cnb", "anotherLayers", "innerLayer")).To(BeADirectory()) - }) - }) - - Context("MoveV2Layers", func() { - It("moves directories and creates the dst dir if it doesn't exist", func() { - Expect(finalizer.MoveV2Layers(filepath.Join(v2DepsDir, depsIndex), filepath.Join(v3LayersDir, "buildpack.0", "layers.0"))).To(Succeed()) - Expect(filepath.Join(v3LayersDir, "buildpack.0", "layers.0")).To(BeADirectory()) - }) - }) - - Context("RenameEnvDir", func() { - It("renames the env dir to env.build", func() { - Expect(os.Mkdir(filepath.Join(v3LayersDir, "env"), 0777)).To(Succeed()) - Expect(finalizer.RenameEnvDir(v3LayersDir)).To(Succeed()) - Expect(filepath.Join(v3LayersDir, "env.build")).To(BeADirectory()) - }) - - It("does nothing when the env dir does NOT exist", func() { - Expect(finalizer.RenameEnvDir(v3LayersDir)).To(Succeed()) - Expect(filepath.Join(v3LayersDir, "env.build")).NotTo(BeADirectory()) - }) - }) - - Context("UpdateGroupTOML", func() { - BeforeEach(func() { - depsIndex = "1" - Expect(ioutil.WriteFile(groupMetadata, []byte(`[[buildpacks]] - id = "org.cloudfoundry.buildpacks.nodejs" - version = "0.0.2" - [[buildpacks]] - id = "org.cloudfoundry.buildpacks.npm" - version = "0.0.3"`), 0777)).To(Succeed()) - }) - - It("adds v2 buildpacks to the group.toml", func() { - Expect(finalizer.UpdateGroupTOML("buildpack.0")).To(Succeed()) - groupMetadataContents, err := ioutil.ReadFile(groupMetadata) - Expect(err).ToNot(HaveOccurred()) - Expect(string(groupMetadataContents)).To(Equal(`[[buildpacks]] - id = "buildpack.0" - version = "" - -[[buildpacks]] - id = "org.cloudfoundry.buildpacks.nodejs" - version = "0.0.2" - -[[buildpacks]] - id = "org.cloudfoundry.buildpacks.npm" - version = "0.0.3" -`)) - }) - }) - - Context("In V3 Layers Dir", func() { - var ( - testLayers string - Dep1LayerMetadataPath string - Dep2LayerMetadataPath string - ) - - JustBeforeEach(func() { - testLayers = filepath.Join(finalizer.V3LayersDir, "org.cloudfoundry.generic.buildpack") - Expect(os.MkdirAll(testLayers, os.ModePerm)).To(Succeed()) - Dep1LayerMetadataPath = filepath.Join(testLayers, "dep1.toml") - Dep2LayerMetadataPath = filepath.Join(testLayers, "dep2.toml") - Dep1LayerPath := filepath.Join(testLayers, "dep1") - Dep2LayerPath := filepath.Join(testLayers, "dep2") - Expect(os.MkdirAll(Dep2LayerPath, os.ModePerm)).To(Succeed()) - Expect(os.MkdirAll(Dep1LayerPath, os.ModePerm)).To(Succeed()) - - Expect(ioutil.WriteFile(Dep1LayerMetadataPath, []byte(`launch = true - build = false - cache = true - - [metadata] - extradata = "shamoo"`), 0777)).To(Succeed()) - - Expect(ioutil.WriteFile(Dep2LayerMetadataPath, []byte(`launch = true - build = true - cache = true - [metadata] - extradata = "shamwow"`), 0777)).To(Succeed()) - }) - - It("can read layer.toml", func() { - dep1Metadata, err := finalizer.ReadLayerMetadata(Dep1LayerMetadataPath) - Expect(err).NotTo(HaveOccurred()) - Expect(dep1Metadata.Launch).To(Equal(true)) - Expect(dep1Metadata.Build).To(Equal(false)) - Expect(dep1Metadata.Cache).To(Equal(true)) - - dep2Metadata, err := finalizer.ReadLayerMetadata(Dep2LayerMetadataPath) - Expect(err).NotTo(HaveOccurred()) - Expect(dep2Metadata.Launch).To(Equal(true)) - Expect(dep2Metadata.Build).To(Equal(true)) - Expect(dep2Metadata.Cache).To(Equal(true)) - }) - - It("can move layer to cache if needed", func() { - Expect(finalizer.MoveV3Layers()).To(Succeed()) - layersCacheDir := filepath.Join(v2CacheDir, "cnb", "org.cloudfoundry.generic.buildpack") - Expect(filepath.Join(layersCacheDir, "dep1")).To(BeADirectory()) - Expect(filepath.Join(layersCacheDir, "dep2")).To(BeADirectory()) - - }) - }) - - Context("AddFakeCNBBuildpack", func() { - It("adds the v2 buildpack as a no-op cnb buildpack", func() { - Expect(os.Setenv("CF_STACK", "cflinuxfs3")).To(Succeed()) - Expect(finalizer.AddFakeCNBBuildpack("buildpack.0")).To(Succeed()) - buildpackTOML, err := ioutil.ReadFile(filepath.Join(v3BuildpacksDir, "buildpack.0", "latest", "buildpack.toml")) - Expect(err).ToNot(HaveOccurred()) - Expect(string(buildpackTOML)).To(Equal(`[buildpack] - id = "buildpack.0" - name = "buildpack.0" - version = "latest" - -[[stacks]] - id = "org.cloudfoundry.stacks.cflinuxfs3" -`)) - - Expect(filepath.Join(v3BuildpacksDir, "buildpack.0", "latest", "bin", "build")).To(BeAnExistingFile()) - }) - }) - - Context("WriteProfileLaunch", func() { - It("writes a profile script that execs the v3 launcher", func() { - Expect(finalizer.WriteProfileLaunch()).To(Succeed()) - contents, err := ioutil.ReadFile(filepath.Join(profileDir, shims.V3LaunchScript)) - Expect(err).NotTo(HaveOccurred()) - Expect(string(contents)).To(Equal(fmt.Sprintf(`export CNB_STACK_ID="org.cloudfoundry.stacks.%s" -export CNB_LAYERS_DIR="$DEPS_DIR" -export CNB_APP_DIR="$HOME" -exec $HOME/.cloudfoundry/%s "$2" -`, os.Getenv("CF_STACK"), shims.V3Launcher))) - }) - }) -}) - -type bp struct { - id string - optional bool -} - -func generateOrderTOMLGroupString(label string, bps []bp) string { - orderToml := fmt.Sprintf(`[[groups]] - labels = ["%s"]`, label) - - for _, bp := range bps { - orderToml += - fmt.Sprintf(` - - [[groups.buildpacks]] - id = "this.is.a.fake.%s" - version = "latest"`, bp.id) - if bp.optional { - orderToml += ` - optional = true` - } - } - - return orderToml -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer.go deleted file mode 100644 index 074d86d..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer.go +++ /dev/null @@ -1,115 +0,0 @@ -package shims - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - - "github.com/pkg/errors" - - "github.com/BurntSushi/toml" - "github.com/cloudfoundry/libbuildpack" -) - -type buildpack struct { - ID string `toml:"id"` - Name string `toml:"name,omitempty"` - Version string `toml:"version"` - Optional bool `toml:"optional,omitempty"` -} - -type group struct { - Labels []string `toml:"labels"` - Buildpacks []buildpack `toml:"buildpacks"` -} - -type order struct { - Groups []group `toml:"groups"` -} - -type stack struct { - ID string `toml:"id"` -} - -type CNBInstaller struct { - *libbuildpack.Installer - manifest *libbuildpack.Manifest -} - -func NewCNBInstaller(manifest *libbuildpack.Manifest) *CNBInstaller { - return &CNBInstaller{libbuildpack.NewInstaller(manifest), manifest} -} - -func (c *CNBInstaller) InstallCNBS(orderFile string, installDir string) error { - o := order{} - _, err := toml.DecodeFile(orderFile, &o) - if err != nil { - return err - } - - bpSet := make(map[string]interface{}) - for _, group := range o.Groups { - for _, bp := range group.Buildpacks { - bpSet[bp.ID] = nil - } - } - - for buildpack := range bpSet { - versions := c.manifest.AllDependencyVersions(buildpack) - if len(versions) != 1 { - return fmt.Errorf("unable to find a unique version of %s in the manifest", buildpack) - } - - buildpackDest := filepath.Join(installDir, buildpack, versions[0]) - if exists, err := libbuildpack.FileExists(buildpackDest); err != nil { - return err - } else if exists { - continue - } - - err := c.InstallOnlyVersion(buildpack, buildpackDest) - if err != nil { - return err - } - - err = os.Symlink(buildpackDest, filepath.Join(installDir, buildpack, "latest")) - if err != nil { - return err - } - } - - return nil -} - -func (c *CNBInstaller) InstallLifecycle(dst string) error { - tempDir, err := ioutil.TempDir("", "lifecycle") - if err != nil { - return errors.Wrap(err, "InstallLifecycle issue creating tempdir") - } - - defer os.RemoveAll(tempDir) - - if err := c.InstallOnlyVersion(V3LifecycleDep, tempDir); err != nil { - return err - } - - firstDir, err := filepath.Glob(filepath.Join(tempDir, "*")) - if err != nil { - return err - } - - if len(firstDir) != 1 { - return errors.Errorf("issue unpacking lifecycle : incorrect dir format : %s", firstDir) - } - - for _, binary := range []string{V3Detector, V3Builder, V3Launcher} { - srcBinary := filepath.Join(firstDir[0], binary) - dstBinary := filepath.Join(dst, binary) - if err := os.Rename(srcBinary, dstBinary); err != nil { - return errors.Wrapf(err, "issue copying lifecycle binary: %s", srcBinary) - } - } - - return nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer_test.go deleted file mode 100644 index 601848a..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/installer_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package shims_test - -import ( - "bytes" - "io/ioutil" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/ansicleaner" - "github.com/cloudfoundry/libbuildpack/shims" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - httpmock "gopkg.in/jarcoal/httpmock.v1" -) - -var _ = Describe("Installer", func() { - var ( - installer *shims.CNBInstaller - tmpDir string - buffer *bytes.Buffer - err error - ) - - BeforeEach(func() { - Expect(os.Setenv("CF_STACK", "cflinuxfs3")).To(Succeed()) - httpmock.Reset() - tmpDir, err = ioutil.TempDir("", "") - Expect(err).ToNot(HaveOccurred()) - - buffer = new(bytes.Buffer) - logger := libbuildpack.NewLogger(ansicleaner.New(buffer)) - - manifest, err := libbuildpack.NewManifest(filepath.Join("testdata", "buildpack"), logger, time.Now()) - Expect(err).To(BeNil()) - - installer = shims.NewCNBInstaller(manifest) - }) - - AfterEach(func() { - Expect(os.Unsetenv("CF_STACK")).To(Succeed()) - os.RemoveAll(tmpDir) - }) - - Context("InstallCNBs", func() { - BeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(tmpDir, "this.is.a.fake.bpC", "1.0.2"), 0777)).To(Succeed()) - contents, err := ioutil.ReadFile(filepath.Join("testdata", "buildpack", "bpA.tgz")) - Expect(err).ToNot(HaveOccurred()) - - httpmock.RegisterResponder("GET", "https://a-fake-url.com/bpA.tgz", - httpmock.NewStringResponder(200, string(contents))) - - contents, err = ioutil.ReadFile(filepath.Join("testdata", "buildpack", "bpB.tgz")) - Expect(err).ToNot(HaveOccurred()) - - httpmock.RegisterResponder("GET", "https://a-fake-url.com/bpB.tgz", - httpmock.NewStringResponder(200, string(contents))) - }) - - It("installs the latest/unique buildpacks from an order.toml that are not already installed", func() { - Expect(installer.InstallCNBS(filepath.Join("testdata", "buildpack", "order.toml"), tmpDir)).To(Succeed()) - Expect(filepath.Join(tmpDir, "this.is.a.fake.bpA", "1.0.1", "a.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(tmpDir, "this.is.a.fake.bpB", "1.0.2", "b.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(tmpDir, "this.is.a.fake.bpA", "latest")).To(BeAnExistingFile()) - Expect(filepath.Join(tmpDir, "this.is.a.fake.bpB", "latest")).To(BeAnExistingFile()) - - Expect(buffer.String()).ToNot(ContainSubstring("Installing this.is.a.fake.bpC")) - Expect(filepath.Join(tmpDir, "this.is.a.fake.bpC")).To(BeADirectory()) - }) - }) - - Context("InstallLifecycle", func() { - BeforeEach(func() { - contents, err := ioutil.ReadFile(filepath.Join("testdata", "buildpack", "lifecycle-bundle.tgz")) - Expect(err).ToNot(HaveOccurred()) - - httpmock.RegisterResponder("GET", "https://a-fake-url.com/lifecycle-bundle.tgz", - httpmock.NewStringResponder(200, string(contents))) - }) - - It("unpacks the lifecycle bundle and globs the contents of the subfolder and copies it somewhere", func() { - Expect(installer.InstallLifecycle(tmpDir)).To(Succeed()) - keepBinaries := []string{"detector", "builder", "launcher"} - - for _, binary := range keepBinaries { - Expect(filepath.Join(tmpDir, binary)).To(BeAnExistingFile()) - } - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_detector_shims_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_detector_shims_test.go deleted file mode 100644 index 57cfffa..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_detector_shims_test.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: detector.go - -// Package shims_test is a generated GoMock package. -package shims_test - -import ( - reflect "reflect" - - gomock "github.com/golang/mock/gomock" -) - -// MockInstaller is a mock of Installer interface -type MockInstaller struct { - ctrl *gomock.Controller - recorder *MockInstallerMockRecorder -} - -// MockInstallerMockRecorder is the mock recorder for MockInstaller -type MockInstallerMockRecorder struct { - mock *MockInstaller -} - -// NewMockInstaller creates a new mock instance -func NewMockInstaller(ctrl *gomock.Controller) *MockInstaller { - mock := &MockInstaller{ctrl: ctrl} - mock.recorder = &MockInstallerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockInstaller) EXPECT() *MockInstallerMockRecorder { - return m.recorder -} - -// InstallCNBS mocks base method -func (m *MockInstaller) InstallCNBS(orderFile, installDir string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InstallCNBS", orderFile, installDir) - ret0, _ := ret[0].(error) - return ret0 -} - -// InstallCNBS indicates an expected call of InstallCNBS -func (mr *MockInstallerMockRecorder) InstallCNBS(orderFile, installDir interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstallCNBS", reflect.TypeOf((*MockInstaller)(nil).InstallCNBS), orderFile, installDir) -} - -// InstallLifecycle mocks base method -func (m *MockInstaller) InstallLifecycle(dst string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InstallLifecycle", dst) - ret0, _ := ret[0].(error) - return ret0 -} - -// InstallLifecycle indicates an expected call of InstallLifecycle -func (mr *MockInstallerMockRecorder) InstallLifecycle(dst interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InstallLifecycle", reflect.TypeOf((*MockInstaller)(nil).InstallLifecycle), dst) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_shims_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_shims_test.go deleted file mode 100644 index e48b40a..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/mocks_shims_test.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: finalizer.go - -// Package shims_test is a generated GoMock package. -package shims_test - -import ( - reflect "reflect" - - gomock "github.com/golang/mock/gomock" -) - -// MockDetector is a mock of Detector interface -type MockDetector struct { - ctrl *gomock.Controller - recorder *MockDetectorMockRecorder -} - -// MockDetectorMockRecorder is the mock recorder for MockDetector -type MockDetectorMockRecorder struct { - mock *MockDetector -} - -// NewMockDetector creates a new mock instance -func NewMockDetector(ctrl *gomock.Controller) *MockDetector { - mock := &MockDetector{ctrl: ctrl} - mock.recorder = &MockDetectorMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (m *MockDetector) EXPECT() *MockDetectorMockRecorder { - return m.recorder -} - -// RunLifecycleDetect mocks base method -func (m *MockDetector) RunLifecycleDetect() error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RunLifecycleDetect") - ret0, _ := ret[0].(error) - return ret0 -} - -// RunLifecycleDetect indicates an expected call of RunLifecycleDetect -func (mr *MockDetectorMockRecorder) RunLifecycleDetect() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunLifecycleDetect", reflect.TypeOf((*MockDetector)(nil).RunLifecycleDetect)) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser.go deleted file mode 100644 index 60d6e1f..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser.go +++ /dev/null @@ -1,53 +0,0 @@ -package shims - -import ( - "fmt" - "io" - "os" - - "github.com/BurntSushi/toml" - yaml "gopkg.in/yaml.v2" -) - -type inputMetadata struct { - Processes []struct { - Type string `toml:"type"` - Command string `toml:"command"` - } -} - -type defaultProcessTypes struct { - Web string `yaml:"web"` -} - -type outputMetadata struct { - DefaultProcessTypes defaultProcessTypes `yaml:"default_process_types"` -} - -type Releaser struct { - MetadataPath string - Writer io.Writer -} - -func (r *Releaser) Release() error { - metadataFile, input := r.MetadataPath, inputMetadata{} - _, err := toml.DecodeFile(metadataFile, &input) - defer os.Remove(metadataFile) - - webCommand, err := input.findCommand("web") - if err != nil { - return err - } - - output := outputMetadata{DefaultProcessTypes: defaultProcessTypes{Web: webCommand}} - return yaml.NewEncoder(r.Writer).Encode(output) -} - -func (i *inputMetadata) findCommand(processType string) (string, error) { - for _, p := range i.Processes { - if p.Type == processType { - return p.Command, nil - } - } - return "", fmt.Errorf("unable to find process with type %s in launch metadata %v", processType, i.Processes) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser_test.go deleted file mode 100644 index b7293bd..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/releaser_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package shims_test - -import ( - "bytes" - "io/ioutil" - "os" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack/shims" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Releaser", func() { - var ( - releaser shims.Releaser - v2AppDir string - buf *bytes.Buffer - ) - - BeforeEach(func() { - var err error - - v2AppDir, err = ioutil.TempDir("", "build") - Expect(err).NotTo(HaveOccurred()) - - contents := ` - buildpacks = ["some.buildpacks", "some.other.buildpack"] - [[processes]] - type = "web" - command = "npm start" - ` - Expect(os.MkdirAll(filepath.Join(v2AppDir, ".cloudfoundry"), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(v2AppDir, ".cloudfoundry", "metadata.toml"), []byte(contents), 0666)).To(Succeed()) - - buf = &bytes.Buffer{} - - releaser = shims.Releaser{ - MetadataPath: filepath.Join(v2AppDir, ".cloudfoundry", "metadata.toml"), - Writer: buf, - } - }) - - AfterEach(func() { - Expect(os.RemoveAll(v2AppDir)).To(Succeed()) - }) - - It("runs with the correct arguments and moves things to the correct place", func() { - Expect(releaser.Release()).To(Succeed()) - Expect(buf.Bytes()).To(Equal([]byte("default_process_types:\n web: npm start\n"))) - Expect(filepath.Join(v2AppDir, ".cloudfoundry", "metadata.toml")).NotTo(BeAnExistingFile()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/shims_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/shims_suite_test.go deleted file mode 100644 index fa184bc..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/shims_suite_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package shims_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - httpmock "gopkg.in/jarcoal/httpmock.v1" - - "testing" -) - -var _ = BeforeSuite(func() { - httpmock.Activate() -}) - -var _ = AfterSuite(func() { - httpmock.DeactivateAndReset() -}) - -func TestShims(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Shims Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier.go deleted file mode 100644 index 754b295..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier.go +++ /dev/null @@ -1,154 +0,0 @@ -package shims - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/pkg/errors" - - "github.com/cloudfoundry/libbuildpack" -) - -type Supplier struct { - V2AppDir string - V3AppDir string - V2DepsDir string - V2CacheDir string - DepsIndex string - V2BuildpackDir string - V3BuildpacksDir string - OrderDir string - Installer Installer - Manifest *libbuildpack.Manifest - Logger *libbuildpack.Logger -} - -const ( - ERROR_FILE = "Error V2 buildpack After V3 buildpack" -) - -func (s *Supplier) Supply() error { - if err := s.CheckBuildpackValid(); err != nil { - return errors.Wrap(err, "failed to check that buildpack is correct") - } - - if err := s.SetUpFirstV3Buildpack(); err != nil { - return errors.Wrap(err, "failed to set up first shimmed buildpack") - } - - if err := s.RemoveV2DepsIndex(); err != nil { - return errors.Wrap(err, "failed to remove v2 deps index dir") - } - - orderFile, err := s.SaveOrderToml() - if err != nil { - return errors.Wrap(err, "failed to save shimmed CNB order.toml") - } - - return s.Installer.InstallCNBS(orderFile, s.V3BuildpacksDir) -} - -func (s *Supplier) SetUpFirstV3Buildpack() error { - exists, err := v3symlinkExists(s.V2AppDir) - if err != nil { - return err - } - if exists { - return nil - } - - if err := moveContent(s.V2AppDir, s.V3AppDir); err != nil { - return err - } - - if err := os.Symlink(ERROR_FILE, s.V2AppDir); err != nil { - return err - } - - appCFPath := filepath.Join(s.V3AppDir, ".cloudfoundry") - if err := os.MkdirAll(appCFPath, 0777); err != nil { - return errors.Wrap(err, "could not open the cloudfoundry dir") - } - - if _, err := os.OpenFile(filepath.Join(appCFPath, libbuildpack.SENTINEL), os.O_RDONLY|os.O_CREATE, 0666); err != nil { - return err - } - - return nil -} - -func (s *Supplier) RemoveV2DepsIndex() error { - return os.RemoveAll(filepath.Join(s.V2DepsDir, s.DepsIndex)) -} - -func (s *Supplier) SaveOrderToml() (string, error) { - orderFile := filepath.Join(s.OrderDir, fmt.Sprintf("order%s.toml", s.DepsIndex)) - if err := libbuildpack.CopyFile(filepath.Join(s.V2BuildpackDir, "order.toml"), orderFile); err != nil { - return "", err - } - return orderFile, nil -} - -func (s *Supplier) CheckBuildpackValid() error { - version, err := s.Manifest.Version() - if err != nil { - return errors.Wrap(err, "Could not determine buildpack version") - } - - s.Logger.BeginStep("%s Buildpack version %s", strings.Title(s.Manifest.Language()), version) - - err = s.Manifest.CheckStackSupport() - if err != nil { - return errors.Wrap(err, "Stack not supported by buildpack") - } - - s.Manifest.CheckBuildpackVersion(s.V2CacheDir) - - return nil -} - -func moveContent(src, dst string) error { - if err := os.RemoveAll(dst); err != nil { - return err - } - - if err := os.MkdirAll(dst, os.ModePerm); err != nil { - return err - } - - if err := filepath.Walk(src, func(path string, info os.FileInfo, err error) error { - relPath, err := filepath.Rel(src, path) - - dstPath := filepath.Join(dst, relPath) - if info.IsDir() { - os.MkdirAll(dstPath, 0777) - - return nil - } - if err != nil { - return err - } - if err := os.Rename(path, dstPath); err != nil { - return err - } - return nil - }); err != nil { - return err - } - - return os.RemoveAll(src) -} - -func v3symlinkExists(path string) (bool, error) { - fi, err := os.Lstat(path) - if err != nil { - return false, err - } - - if fi.Mode()&os.ModeSymlink == os.ModeSymlink { - return true, nil - } - return false, nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier_test.go deleted file mode 100644 index 0da5dbd..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/supplier_test.go +++ /dev/null @@ -1,147 +0,0 @@ -package shims_test - -import ( - "bytes" - "io/ioutil" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack" - "github.com/cloudfoundry/libbuildpack/shims" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Supplier", func() { - var ( - supplier shims.Supplier - v2AppDir string - v2BuildpacksDir string - v3AppDir string - v3BuildpacksDir string - v2DepsDir string - v2CacheDir string - depsIndex string - tempDir string - orderDir string - installer *shims.CNBInstaller - manifest *libbuildpack.Manifest - buffer *bytes.Buffer - logger *libbuildpack.Logger - ) - - BeforeEach(func() { - var err error - - tempDir, err = ioutil.TempDir("", "tmp") - Expect(err).NotTo(HaveOccurred()) - - v2AppDir = filepath.Join(tempDir, "app") - Expect(os.MkdirAll(v2AppDir, 0777)).To(Succeed()) - - v3AppDir = filepath.Join(tempDir, "cnb-app") - - v2DepsDir = filepath.Join(tempDir, "deps") - depsIndex = "0" - Expect(os.MkdirAll(filepath.Join(v2DepsDir, depsIndex), 0777)).To(Succeed()) - - v2CacheDir = filepath.Join(tempDir, "cache") - Expect(os.MkdirAll(v2CacheDir, 0777)).To(Succeed()) - - buffer = new(bytes.Buffer) - logger = libbuildpack.NewLogger(buffer) - - manifest, err = libbuildpack.NewManifest(filepath.Join("testdata", "buildpack"), logger, time.Now()) - Expect(err).ToNot(HaveOccurred()) - installer = shims.NewCNBInstaller(manifest) - - orderDir = filepath.Join(tempDir, "order") - Expect(os.MkdirAll(orderDir, 0777)).To(Succeed()) - - v3BuildpacksDir = filepath.Join(tempDir, "v3Buildpacks") - - v2BuildpacksDir = filepath.Join(tempDir, "v2Buildpacks") - }) - - JustBeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(v2DepsDir, depsIndex), 0777)).To(Succeed()) - - Expect(os.MkdirAll(filepath.Join(v2BuildpacksDir, depsIndex), 0777)).To(Succeed()) - - supplier = shims.Supplier{ - V2AppDir: v2AppDir, - V2BuildpackDir: filepath.Join(v2BuildpacksDir, depsIndex), - V3AppDir: v3AppDir, - V2DepsDir: v2DepsDir, - V2CacheDir: v2CacheDir, - DepsIndex: depsIndex, - V3BuildpacksDir: v3BuildpacksDir, - OrderDir: orderDir, - Installer: installer, - Manifest: manifest, - Logger: logger, - } - }) - - AfterEach(func() { - Expect(os.RemoveAll(tempDir)).To(Succeed()) - }) - - Context("SetUpFirstV3Buildpack", func() { - It("Moves V2AppDir to V3AppDir if it has not already been moved", func() { - Expect(v3AppDir).NotTo(BeADirectory()) - Expect(supplier.SetUpFirstV3Buildpack()).To(Succeed()) - Expect(v3AppDir).To(BeADirectory()) - }) - - It("Writes a sentinel file in the app dir", func() { - Expect(supplier.SetUpFirstV3Buildpack()).To(Succeed()) - Expect(filepath.Join(v3AppDir, ".cloudfoundry", libbuildpack.SENTINEL)).To(BeAnExistingFile()) - }) - - It("Writes a symlink at the V2AppDir to a fake file with a clear error message", func() { - Expect(supplier.SetUpFirstV3Buildpack()).To(Succeed()) - linkDst, err := os.Readlink(v2AppDir) - Expect(err).NotTo(HaveOccurred()) - Expect(linkDst).To(Equal(shims.ERROR_FILE)) - }) - - It("Does nothing if V2AppDir has already been moved", func() { - Expect(os.Remove(v2AppDir)).To(Succeed()) - Expect(os.Symlink("some-file", v2AppDir)).To(Succeed()) - Expect(supplier.SetUpFirstV3Buildpack()).To(Succeed()) - }) - }) - - Context("RemoveV2DepsIndex", func() { - It("removes the V2 deps index so no one writes to it", func() { - Expect(supplier.RemoveV2DepsIndex()).To(Succeed()) - Expect(filepath.Join(v2DepsDir, depsIndex)).ToNot(BeAnExistingFile()) - }) - }) - - Context("SaveOrderToml", func() { - It("copies the order metadata to be used for finalize", func() { - Expect(ioutil.WriteFile(filepath.Join(v2BuildpacksDir, depsIndex, "order.toml"), []byte(""), 0666)).To(Succeed()) - orderFile, err := supplier.SaveOrderToml() - Expect(err).NotTo(HaveOccurred()) - Expect(orderFile).To(Equal(filepath.Join(orderDir, "order"+depsIndex+".toml"))) - Expect(orderFile).To(BeAnExistingFile()) - }) - }) - - Context("CheckBuildpackValid", func() { - BeforeEach(func() { - Expect(os.Setenv("CF_STACK", "cflinuxfs2")).To(Succeed()) - }) - - Context("buildpack is valid", func() { - It("it logs the buildpack name and version", func() { - Expect(supplier.CheckBuildpackValid()).To(Succeed()) - - Expect(buffer.String()).To(ContainSubstring("-----> SomeName Buildpack version 0.0.1")) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/VERSION b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/VERSION deleted file mode 100644 index 8a9ecc2..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/bpA.tgz b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/bpA.tgz deleted file mode 100644 index a49246612bee88c688f4c12eaefa0ac689ef0158..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmb2|=3tO|_Ai=&`R#dMu0swyZ4cMky80>1Ja_-r;vTPs5gT5F*z8MYzq56RrqZ7C z&y)oYP2Y0<{GA-{(B|S#=Oq5jxpi%)kzdbN!(R!fRkCh9NLJoexc+9z`Ilj%@N2vBp8EZDvHPjs7i>T0c*(94iQixAF(8A6_j?&8sLv8-&|qKy0Hps$g8%>k diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/bpB.tgz b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/bpB.tgz deleted file mode 100644 index 43729ed1d337b3fcad21a03c25e7d05f573dbc70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 147 zcmb2|=3vl&_Ai=&`R#c}u0sYQEf3e(9<^@VW0JY)yV}a70Xh*TqW$@|8g_ThRyy=Q zx9z}(8C#Bj@wvJ$mwL67#IM{9zvJ^ diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/lifecycle-bundle.tgz b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/shims/testdata/buildpack/lifecycle-bundle.tgz deleted file mode 100644 index 47e9618b89d8b6b7a88b7933dea585109413dfe1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmV+h0r~zPiwFSZC8k^e1MSw)YJ)HshG8$o8yHREpWo|AW28dRVq;l%^$TqoY@wq_ z8Yz6wNe&DeeKG2X-r0-w?qk1e(a00000000000036` M2Fb{@= 0; i-- { - var combinedGroups []group - for _, currGroup := range orders[i].Groups { - combinedGroups = prependCurrentGroup(finalOrder.Groups, currGroup, combinedGroups) - } - - finalOrder.Groups = combinedGroups - } - - return finalOrder -} - -func prependCurrentGroup(groupsSoFar []group, currGroup group, combinedGroups []group) []group { - for _, soFar := range groupsSoFar { - labels := append(currGroup.Labels, soFar.Labels...) - buildpacks := append(currGroup.Buildpacks, soFar.Buildpacks...) - filterDuplicateBuildpacks(&buildpacks) - - combinedGroup := group{ - Labels: labels, - Buildpacks: buildpacks, - } - combinedGroups = append(combinedGroups, combinedGroup) - } - return combinedGroups -} - -func filterDuplicateBuildpacks(bps *[]buildpack) { - for i := range *bps { - for j := i + 1; j < len(*bps); { - if (*bps)[i].ID == (*bps)[j].ID { - *bps = append((*bps)[:j], (*bps)[j+1:]...) - } else { - j++ - } - } - } -} - -func encodeTOML(dest string, data interface{}) error { - destFile, err := os.Create(dest) - if err != nil { - return err - } - defer destFile.Close() - - return toml.NewEncoder(destFile).Encode(data) -} - -func initOrder() order { - return order{Groups: []group{{ - Labels: []string{}, - Buildpacks: []buildpack{}, - }}} -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/mocks_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/mocks_test.go deleted file mode 100644 index f5e5b27..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/mocks_test.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: snapshot.go - -package snapshot_test - -import ( - reflect "reflect" - - gomock "github.com/golang/mock/gomock" -) - -// MockLogger is a mock of Logger interface -type MockLogger struct { - ctrl *gomock.Controller - recorder *MockLoggerMockRecorder -} - -// MockLoggerMockRecorder is the mock recorder for MockLogger -type MockLoggerMockRecorder struct { - mock *MockLogger -} - -// NewMockLogger creates a new mock instance -func NewMockLogger(ctrl *gomock.Controller) *MockLogger { - mock := &MockLogger{ctrl: ctrl} - mock.recorder = &MockLoggerMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use -func (_m *MockLogger) EXPECT() *MockLoggerMockRecorder { - return _m.recorder -} - -// Debug mocks base method -func (_m *MockLogger) Debug(format string, args ...interface{}) { - _s := []interface{}{format} - for _, _x := range args { - _s = append(_s, _x) - } - _m.ctrl.Call(_m, "Debug", _s...) -} - -// Debug indicates an expected call of Debug -func (_mr *MockLoggerMockRecorder) Debug(arg0 interface{}, arg1 ...interface{}) *gomock.Call { - _s := append([]interface{}{arg0}, arg1...) - return _mr.mock.ctrl.RecordCallWithMethodType(_mr.mock, "Debug", reflect.TypeOf((*MockLogger)(nil).Debug), _s...) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot.go deleted file mode 100644 index 4f87c4f..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot.go +++ /dev/null @@ -1,129 +0,0 @@ -package snapshot - -import ( - "crypto/md5" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/cloudfoundry/libbuildpack" -) - -type DirSnapshot struct { - dir string - initialPaths []string - initialChecksum string - logger Logger - command libbuildpack.Command -} - -type Logger interface { - Debug(format string, args ...interface{}) -} - -func Dir(dir string, logger Logger) *DirSnapshot { - dirSnapshot := &DirSnapshot{ - dir: dir, - initialPaths: []string{}, - logger: logger, - command: libbuildpack.Command{}, - } - - if os.Getenv("BP_DEBUG") != "" { - if paths, checksum, err := dirSnapshot.calcChecksum(); err == nil { - logger.Debug("Initial dir checksum %s", checksum) - dirSnapshot.initialPaths = paths - dirSnapshot.initialChecksum = checksum - } - - dirSnapshot.command.Execute(dir, ioutil.Discard, ioutil.Discard, "touch", "/tmp/checkpoint") - } - - return dirSnapshot -} - -func (d *DirSnapshot) Diff() { - if d.initialChecksum == "" { - return - } - if paths, checksum, err := d.calcChecksum(); err == nil { - if checksum == d.initialChecksum { - d.logger.Debug("Dir checksum unchanged") - } else { - d.logger.Debug("New dir checksum is %s", checksum) - d.logger.Debug("paths changed:") - d.logDiffs(paths) - } - } -} - -func (d *DirSnapshot) logDiffs(newPaths []string) { - if filesChanged, err := d.command.Output(d.dir, "find", ".", "-newer", "/tmp/checkpoint", "-not", "-path", "./.cloudfoundry/*", "-not", "-path", "./.cloudfoundry"); err == nil && filesChanged != "" { - changedFiles := strings.Split(filesChanged, "\n") - for _, file := range changedFiles { - if file != "." && file != "" { - d.logger.Debug(file) - } - } - } - for _, path := range d.initialPaths { - found := false - for _, newPath := range newPaths { - if newPath == path { - found = true - break - } - } - if !found { - d.logger.Debug(fmt.Sprintf("./%s", path)) - } - } -} - -func (d *DirSnapshot) calcChecksum() ([]string, string, error) { - paths := []string{} - h := md5.New() - err := filepath.Walk(d.dir, func(path string, info os.FileInfo, err error) error { - relpath, err := filepath.Rel(d.dir, path) - if err != nil { - return err - } - if strings.HasPrefix(relpath, ".cloudfoundry/") || relpath == ".cloudfoundry" { - return nil - } - paths = append(paths, relpath) - if _, err := io.WriteString(h, relpath); err != nil { - return err - } - - if info.Mode().IsRegular() { - if f, err := os.Open(path); err != nil { - return err - } else { - if _, err := io.Copy(h, f); err != nil { - return err - } - } - } else if info.Mode()&os.ModeSymlink != 0 { - if dest, err := os.Readlink(path); err != nil { - return err - } else { - reldestpath, err := filepath.Rel(d.dir, dest) - if err != nil { - return err - } - if _, err := io.WriteString(h, reldestpath); err != nil { - return err - } - } - } - return nil - }) - if err != nil { - return paths, "", err - } - return paths, fmt.Sprintf("%x", h.Sum(nil)), nil -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_suite_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_suite_test.go deleted file mode 100644 index d3a9c1c..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package snapshot_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestSnapshot(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Snapshot Suite") -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_test.go deleted file mode 100644 index 413f653..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/snapshot/snapshot_test.go +++ /dev/null @@ -1,219 +0,0 @@ -package snapshot_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "time" - - "github.com/cloudfoundry/libbuildpack/snapshot" - gomock "github.com/golang/mock/gomock" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -//go:generate mockgen -source=snapshot.go --destination=mocks_test.go --package=snapshot_test - -var _ = Describe("Snapshot", func() { - var ( - origBPDebug string - tmpDir string - mockCtrl *gomock.Controller - mockLogger *MockLogger - err error - ) - - BeforeEach(func() { - origBPDebug = os.Getenv("BP_DEBUG") - - tmpDir, err = ioutil.TempDir("", "libbuildpack.snapshot.build.") - Expect(err).To(BeNil()) - - Expect(ioutil.WriteFile(filepath.Join(tmpDir, "Gemfile"), []byte("source \"https://rubygems.org\"\r\ngem \"rack\"\r\n"), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(tmpDir, "other"), []byte("other"), 0644)).To(Succeed()) - Expect(os.MkdirAll(filepath.Join(tmpDir, "dir"), 0755)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(tmpDir, "dir", "other"), []byte("other"), 0644)).To(Succeed()) - Expect(os.Symlink(filepath.Join(tmpDir, "Gemfile"), filepath.Join(tmpDir, "mySymLink"))).To(Succeed()) - Expect(os.MkdirAll(filepath.Join(tmpDir, "myEmptyDir"), 0755)).To(Succeed()) - - mockCtrl = gomock.NewController(GinkgoT()) - mockLogger = NewMockLogger(mockCtrl) - }) - - AfterEach(func() { - os.Setenv("BP_DEBUG", origBPDebug) - - mockCtrl.Finish() - - err = os.RemoveAll(tmpDir) - Expect(err).To(BeNil()) - }) - - Context("BP_DEBUG is set", func() { - BeforeEach(func() { - os.Setenv("BP_DEBUG", "1") - }) - - It("Initially logs an MD5 of the full contents", func() { - mockLogger.EXPECT().Debug("Initial dir checksum %s", "6fac581b4f82368eb477e733400db4b7") - snapshot.Dir(tmpDir, mockLogger) - }) - - Context(".cloudfoundry directory", func() { - BeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(tmpDir, ".cloudfoundry", "dir"), 0755)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(tmpDir, ".cloudfoundry", "other"), []byte("other"), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(tmpDir, ".cloudfoundry", "dir", "other"), []byte("other"), 0644)).To(Succeed()) - }) - - It("excludes .cloudfoundry directory in the checksum calcuation", func() { - mockLogger.EXPECT().Debug("Initial dir checksum %s", "6fac581b4f82368eb477e733400db4b7") - snapshot.Dir(tmpDir, mockLogger) - }) - }) - - Describe("Diff()", func() { - var dirSnapshot *snapshot.DirSnapshot - BeforeEach(func() { - mockLogger.EXPECT().Debug("Initial dir checksum %s", "6fac581b4f82368eb477e733400db4b7") - dirSnapshot = snapshot.Dir(tmpDir, mockLogger) - time.Sleep(1 * time.Second) //TODO: don't rely on `find` - }) - - Context("when a directory is added", func() { - BeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(tmpDir, "myNewDir"), 0755)).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "2c5c0c34c2311ddc82a6f10a241f0bfb") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./myNewDir") - dirSnapshot.Diff() - }) - }) - - Context("when a directory is removed", func() { - BeforeEach(func() { - Expect(os.Remove(filepath.Join(tmpDir, "myEmptyDir"))).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "23015917a95569c120e6daf29e2d49d6") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./myEmptyDir") - dirSnapshot.Diff() - }) - }) - - Context("when a symlink is added", func() { - BeforeEach(func() { - Expect(os.Symlink(filepath.Join(tmpDir, "Gemfile"), filepath.Join(tmpDir, "myNewSymLink"))).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "50e11a9949ef9345b8786bfbbcee836e") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./myNewSymLink") - dirSnapshot.Diff() - }) - }) - - Context("when a symlink is removed", func() { - BeforeEach(func() { - Expect(os.Remove(filepath.Join(tmpDir, "mySymLink"))).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "7fda572908dba44c22a193b46be0b792") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./mySymLink") - dirSnapshot.Diff() - }) - }) - - Context("when a symlink is changed to point elsewhere", func() { - BeforeEach(func() { - Expect(os.Remove(filepath.Join(tmpDir, "mySymLink"))).To(Succeed()) - Expect(os.Symlink(filepath.Join(tmpDir, "other"), filepath.Join(tmpDir, "mySymLink"))).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "a640f5e0955c19ab97e6e13311d233c7") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./mySymLink") - dirSnapshot.Diff() - }) - }) - - Context("when a file is added", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(filepath.Join(tmpDir, "extrafile"), []byte("extrafile"), 0644)).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "b80ec5942c0a305c6c00c61468986526") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./extrafile") - dirSnapshot.Diff() - }) - }) - - Context("when a file is removed", func() { - BeforeEach(func() { - Expect(os.Remove(filepath.Join(tmpDir, "other"))).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "4343e8dc600a5771210ac833699258fc") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./other") - dirSnapshot.Diff() - }) - }) - - Context("when a files contents have changed", func() { - BeforeEach(func() { - Expect(ioutil.WriteFile(filepath.Join(tmpDir, "other"), []byte("other other"), 0644)).To(Succeed()) - }) - - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("New dir checksum is %s", "1545570abe7d2068ae20085e63f89bc5") - mockLogger.EXPECT().Debug("paths changed:") - mockLogger.EXPECT().Debug("./other") - dirSnapshot.Diff() - }) - }) - - Context("when no changes have been made", func() { - It("logs the new MD5 sum as well as changed paths", func() { - mockLogger.EXPECT().Debug("Dir checksum unchanged") - dirSnapshot.Diff() - }) - }) - }) - }) - - Context("BP_DEBUG is not set", func() { - BeforeEach(func() { - os.Setenv("BP_DEBUG", "") - }) - - It("Does not log anything", func() { - snapshot.Dir(tmpDir, mockLogger) - }) - - Describe("Diff()", func() { - var dirSnapshot *snapshot.DirSnapshot - BeforeEach(func() { - dirSnapshot = snapshot.Dir(tmpDir, mockLogger) - Expect(ioutil.WriteFile(filepath.Join(tmpDir, "other"), []byte("other other"), 0644)).To(Succeed()) - }) - It("Does not log anything", func() { - dirSnapshot.Diff() - }) - }) - }) - -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/stager_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/stager_test.go deleted file mode 100644 index 0a81dd9..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/stager_test.go +++ /dev/null @@ -1,662 +0,0 @@ -package libbuildpack_test - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "runtime" - "time" - - "github.com/cloudfoundry/libbuildpack" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Stager", func() { - var ( - manifest *libbuildpack.Manifest - buildDir string - cacheDir string - depsDir string - depsIdx string - profileDir string - logger *libbuildpack.Logger - s *libbuildpack.Stager - err error - buffer *bytes.Buffer - manifestDir string - ) - - BeforeEach(func() { - buildDir, err = ioutil.TempDir("", "build") - Expect(err).To(BeNil()) - - cacheDir, err = ioutil.TempDir("", "cache") - Expect(err).To(BeNil()) - - depsDir, err = ioutil.TempDir("", "deps") - Expect(err).To(BeNil()) - - depsIdx = "0" - err = os.MkdirAll(filepath.Join(depsDir, depsIdx), 0755) - Expect(err).To(BeNil()) - - profileDir, err = ioutil.TempDir("", "profiled") - Expect(err).To(BeNil()) - - manifestDir = filepath.Join("fixtures", "manifest", "standard") - - manifest, err = libbuildpack.NewManifest(manifestDir, logger, time.Now()) - Expect(err).To(BeNil()) - - buffer = new(bytes.Buffer) - - logger = libbuildpack.NewLogger(buffer) - - s = libbuildpack.NewStager([]string{buildDir, cacheDir, depsDir, depsIdx, profileDir}, logger, manifest) - }) - - AfterEach(func() { - err = os.RemoveAll(buildDir) - Expect(err).To(BeNil()) - - err = os.RemoveAll(cacheDir) - Expect(err).To(BeNil()) - - err = os.RemoveAll(depsDir) - Expect(err).To(BeNil()) - - err = os.RemoveAll(profileDir) - Expect(err).To(BeNil()) - }) - - Describe("NewStager", func() { - var args []string - - Context("A deps dir is provided", func() { - It("sets it in the Stager struct", func() { - args = []string{"buildDir", "cacheDir", "depsDir", "idx"} - s = libbuildpack.NewStager(args, logger, manifest) - Expect(err).To(BeNil()) - Expect(s.BuildDir()).To(Equal("buildDir")) - Expect(s.CacheDir()).To(Equal("cacheDir")) - Expect(s.DepsIdx()).To(Equal("idx")) - Expect(s.DepDir()).To(Equal(filepath.Join("depsDir", "idx"))) - Expect(s.ProfileDir()).To(Equal(filepath.Join("buildDir", ".profile.d"))) - }) - }) - - Context("A deps dir is not provided", func() { - It("sets DepsDir to the empty string", func() { - args = []string{"buildDir", "cacheDir"} - s = libbuildpack.NewStager(args, logger, manifest) - Expect(err).To(BeNil()) - Expect(s.BuildDir()).To(Equal("buildDir")) - Expect(s.CacheDir()).To(Equal("cacheDir")) - Expect(s.DepsIdx()).To(Equal("")) - Expect(s.DepDir()).To(Equal("")) - Expect(s.ProfileDir()).To(Equal(filepath.Join("buildDir", ".profile.d"))) - }) - }) - - Context("A profile.d dir is provided", func() { - It("sets ProfileDir", func() { - args = []string{"buildDir", "cacheDir", "depsDir", "idx", "rootProfileD"} - s = libbuildpack.NewStager(args, logger, manifest) - Expect(err).To(BeNil()) - Expect(s.ProfileDir()).To(Equal("rootProfileD")) - }) - }) - }) - - Describe("WriteConfigYml", func() { - It("creates a file in the /idx directory", func() { - Expect(s.WriteConfigYml(nil)).To(Succeed()) - - config := struct { - Name string `yaml:"name"` - }{} - Expect(libbuildpack.NewYAML().Load(filepath.Join(s.DepDir(), "config.yml"), &config)).To(Succeed()) - - Expect(config.Name).To(Equal("dotnet-core")) - }) - - It("sets buildpack version in file", func() { - Expect(s.WriteConfigYml(nil)).To(Succeed()) - - config := struct { - Version string `yaml:"version"` - }{} - libbuildpack.NewYAML().Load(filepath.Join(s.DepDir(), "config.yml"), &config) - - Expect(config.Version).To(Equal("99.99")) - }) - - It("writes passed config struct to file", func() { - Expect(s.WriteConfigYml(map[string]string{"key": "value", "a": "b"})).To(Succeed()) - - config := struct { - Config map[string]string `yaml:"config"` - }{} - Expect(libbuildpack.NewYAML().Load(filepath.Join(s.DepDir(), "config.yml"), &config)).To(Succeed()) - - Expect(config.Config).To(Equal(map[string]string{ - "key": "value", - "a": "b", - })) - }) - }) - - Describe("CheckBuildpackValid", func() { - BeforeEach(func() { - err = os.Setenv("CF_STACK", "cflinuxfs2") - Expect(err).To(BeNil()) - }) - - Context("buildpack is valid", func() { - It("it logs the buildpack name and version", func() { - err := s.CheckBuildpackValid() - Expect(err).To(BeNil()) - Expect(buffer.String()).To(ContainSubstring("-----> Dotnet-Core Buildpack version 99.99")) - }) - }) - }) - - Describe("ClearCache", func() { - Context("already empty", func() { - It("returns successfully", func() { - err = s.ClearCache() - Expect(err).To(BeNil()) - Expect(cacheDir).To(BeADirectory()) - }) - }) - - Context("cache dir does not exist", func() { - BeforeEach(func() { - cacheDir = filepath.Join("not", "real") - }) - - It("returns successfully", func() { - err = s.ClearCache() - Expect(err).To(BeNil()) - Expect(cacheDir).ToNot(BeADirectory()) - }) - }) - - Context("not empty", func() { - BeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(cacheDir, "fred", "jane"), 0755)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(cacheDir, "fred", "jane", "jack.txt"), []byte("content"), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(cacheDir, "jill.txt"), []byte("content"), 0644)).To(Succeed()) - - fi, err := ioutil.ReadDir(cacheDir) - Expect(err).To(BeNil()) - Expect(len(fi)).To(Equal(2)) - }) - - It("it clears the cache", func() { - err = s.ClearCache() - Expect(err).To(BeNil()) - Expect(cacheDir).To(BeADirectory()) - - fi, err := ioutil.ReadDir(cacheDir) - Expect(err).To(BeNil()) - Expect(len(fi)).To(Equal(0)) - }) - }) - }) - - Describe("ClearDepDir", func() { - Context("already empty", func() { - It("returns successfully", func() { - err = s.ClearDepDir() - Expect(err).To(BeNil()) - Expect(s.DepDir()).To(BeADirectory()) - }) - }) - - Context("not empty", func() { - BeforeEach(func() { - Expect(os.MkdirAll(filepath.Join(depsDir, depsIdx, "fred", "jane"), 0755)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(depsDir, depsIdx, "fred", "jane", "jack.txt"), []byte("content"), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(depsDir, depsIdx, "jill.txt"), []byte("content"), 0644)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(depsDir, depsIdx, "config.yml"), []byte("yaml"), 0644)).To(Succeed()) - - fi, err := ioutil.ReadDir(filepath.Join(depsDir, depsIdx)) - Expect(err).To(BeNil()) - Expect(len(fi)).To(Equal(3)) - }) - - It("it clears the depDir, leaving config.yml", func() { - err = s.ClearDepDir() - Expect(err).To(BeNil()) - Expect(s.DepDir()).To(BeADirectory()) - - fi, err := ioutil.ReadDir(s.DepDir()) - Expect(err).To(BeNil()) - Expect(len(fi)).To(Equal(1)) - - content, err := ioutil.ReadFile(filepath.Join(s.DepDir(), "config.yml")) - Expect(err).To(BeNil()) - Expect(string(content)).To(Equal("yaml")) - }) - }) - }) - - Describe("WriteEnvFile", func() { - It("creates a file in the /env directory", func() { - err := s.WriteEnvFile("ENVVAR", "value") - Expect(err).To(BeNil()) - - contents, err := ioutil.ReadFile(filepath.Join(s.DepDir(), "env", "ENVVAR")) - Expect(err).To(BeNil()) - - Expect(string(contents)).To(Equal("value")) - }) - }) - - Describe("AddBinDependencyLink", func() { - It("creates a symlink /bin/ with the relative path to dest", func() { - var err error - destDir := filepath.Join(depsDir, depsIdx, "some", "long") - dest := filepath.Join(destDir, "path") - - /* Windows uses hard links, the file must already exist and - * be an actual file (not a directory) - */ - if runtime.GOOS == "windows" { - err = os.MkdirAll(destDir, 0777) - Expect(err).To(BeNil()) - f, err := os.Create(dest) - Expect(err).To(BeNil()) - f.Close() - } - - err = s.AddBinDependencyLink(dest, "dep") - Expect(err).To(BeNil()) - - linkSource := filepath.Join(s.DepDir(), "bin", "dep") - - if runtime.GOOS == "windows" { - f1, err := os.Stat(linkSource) - Expect(err).To(BeNil()) - f2, err := os.Stat(dest) - Expect(err).To(BeNil()) - Expect(os.SameFile(f1, f2)).To(BeTrue()) - } else { - link, err := os.Readlink(linkSource) - Expect(err).To(BeNil()) - Expect(link).To(Equal(filepath.Join("..", "some", "long", "path"))) - } - }) - }) - - Describe("LinkDirectoryInDepDir", func() { - var destDir string - - BeforeEach(func() { - destDir, err = ioutil.TempDir("", "untarred-dependencies") - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(destDir, "thing1"), []byte("xxx"), 0644) - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(destDir, "thing2"), []byte("yyy"), 0644) - Expect(err).To(BeNil()) - }) - - AfterEach(func() { - err = os.RemoveAll(destDir) - Expect(err).To(BeNil()) - }) - - It("it creates a symlink // pointing to each file in dest dir", func() { - err := s.LinkDirectoryInDepDir(destDir, "include") - Expect(err).To(BeNil()) - - link, err := os.Readlink(filepath.Join(s.DepDir(), "include", "thing1")) - Expect(err).To(BeNil()) - Expect(link).To(Equal(filepath.Join("..", "..", "..", filepath.Base(destDir), "thing1"))) - - data, err := ioutil.ReadFile(filepath.Join(s.DepDir(), "include", "thing1")) - Expect(err).To(BeNil()) - Expect(string(data)).To(Equal("xxx")) - - link, err = os.Readlink(filepath.Join(s.DepDir(), "include", "thing2")) - Expect(err).To(BeNil()) - Expect(link).To(Equal(filepath.Join("..", "..", "..", filepath.Base(destDir), "thing2"))) - - data, err = ioutil.ReadFile(filepath.Join(s.DepDir(), "include", "thing2")) - Expect(err).To(BeNil()) - Expect(string(data)).To(Equal("yyy")) - }) - - It("overwrites existing links", func() { - Expect(os.MkdirAll(filepath.Join(s.DepDir(), "include"), 0755)).To(Succeed()) - Expect(os.Symlink(filepath.Join(destDir, "thing2"), filepath.Join(s.DepDir(), "include", "thing1"))).To(Succeed()) - - err := s.LinkDirectoryInDepDir(destDir, "include") - Expect(err).To(BeNil()) - - link, err := os.Readlink(filepath.Join(s.DepDir(), "include", "thing1")) - Expect(err).To(BeNil()) - Expect(link).To(Equal(filepath.Join("..", "..", "..", filepath.Base(destDir), "thing1"))) - }) - }) - - Describe("WriteProfileD", func() { - var ( - info os.FileInfo - profileDScript string - name string - contents string - ) - - JustBeforeEach(func() { - profileDScript = filepath.Join(s.DepDir(), "profile.d", name) - - err = s.WriteProfileD(name, contents) - Expect(err).To(BeNil()) - }) - - Context("profile.d directory exists", func() { - BeforeEach(func() { - name = "dir-exists.sh" - contents = "used the dir" - - err = os.MkdirAll(filepath.Join(depsDir, depsIdx, "profile.d"), 0755) - Expect(err).To(BeNil()) - }) - - It("creates the file as an executable", func() { - Expect(profileDScript).To(BeAnExistingFile()) - - if runtime.GOOS != "windows" { // executable file permissions not relevant for Windows - info, err = os.Stat(profileDScript) - Expect(err).To(BeNil()) - - // make sure at least 1 executable bit is set - Expect(info.Mode().Perm() & 0111).NotTo(Equal(os.FileMode(0000))) - } - }) - - It("the script has the correct contents", func() { - data, err := ioutil.ReadFile(profileDScript) - Expect(err).To(BeNil()) - - Expect(data).To(Equal([]byte("used the dir"))) - }) - }) - - Context("profile.d directory does not exist", func() { - BeforeEach(func() { - name = "no-dir.sh" - contents = "made the dir" - }) - - It("creates the file as an executable", func() { - Expect(profileDScript).To(BeAnExistingFile()) - - info, err = os.Stat(profileDScript) - Expect(err).To(BeNil()) - - // make sure at least 1 executable bit is set - Expect(info.Mode().Perm() & 0111).NotTo(Equal(0000)) - }) - }) - - It("the script has the correct contents", func() { - data, err := ioutil.ReadFile(profileDScript) - Expect(err).To(BeNil()) - - Expect(data).To(Equal([]byte("made the dir"))) - }) - }) - - Describe("Supply Environment", func() { - BeforeEach(func() { - err = os.MkdirAll(filepath.Join(depsDir, "00", "bin"), 0755) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "01", "bin"), 0755) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "01", "lib"), 0755) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "02", "lib"), 0755) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "03", "include"), 0755) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "04", "pkgconfig"), 0755) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "05", "env"), 0755) - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(depsDir, "05", "env", "ENV_VAR"), []byte("value"), 0644) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "00", "profile.d"), 0755) - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(depsDir, "00", "profile.d", "supplied-script.sh"), []byte("first"), 0644) - Expect(err).To(BeNil()) - - err = os.MkdirAll(filepath.Join(depsDir, "01", "profile.d"), 0755) - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(depsDir, "01", "profile.d", "supplied-script.sh"), []byte("second"), 0644) - Expect(err).To(BeNil()) - - err = ioutil.WriteFile(filepath.Join(depsDir, "some-file.yml"), []byte("things"), 0644) - Expect(err).To(BeNil()) - }) - - Describe("SetStagingEnvironment", func() { - var envVars = map[string]string{} - - BeforeEach(func() { - vars := []string{"PATH", "LD_LIBRARY_PATH", "LIBRARY_PATH", "CPATH", "PKG_CONFIG_PATH", "ENV_VAR"} - - for _, envVar := range vars { - envVars[envVar] = os.Getenv(envVar) - os.Setenv(envVar, "existing_"+envVar) - } - }) - - AfterEach(func() { - for key, val := range envVars { - err = os.Setenv(key, val) - Expect(err).To(BeNil()) - } - }) - - It("sets PATH based on the supplied deps", func() { - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("PATH") - if runtime.GOOS == "windows" { - Expect(newPath).To(Equal(fmt.Sprintf("%s\\01\\bin;%s\\00\\bin;existing_PATH", depsDir, depsDir))) - } else { - Expect(newPath).To(Equal(fmt.Sprintf("%s/01/bin:%s/00/bin:existing_PATH", depsDir, depsDir))) - } - }) - - It("sets LD_LIBRARY_PATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use LD_LIBRARY_PATH on Windows.") - } - - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("LD_LIBRARY_PATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/02/lib:%s/01/lib:existing_LD_LIBRARY_PATH", depsDir, depsDir))) - }) - - It("sets LIBRARY_PATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use LIBRARY_PATH on Windows.") - } - - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("LIBRARY_PATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/02/lib:%s/01/lib:existing_LIBRARY_PATH", depsDir, depsDir))) - }) - - It("sets CPATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use CPATH on Windows.") - } - - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("CPATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/03/include:existing_CPATH", depsDir))) - }) - - It("sets PKG_CONFIG_PATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use PKG_CONFIG_PATH on Windows.") - } - - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("PKG_CONFIG_PATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/04/pkgconfig:existing_PKG_CONFIG_PATH", depsDir))) - }) - - It("sets environment variables from the env/ dir", func() { - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("ENV_VAR") - Expect(newPath).To(Equal("value")) - }) - - Context("relevant env variable is empty", func() { - BeforeEach(func() { - for key, _ := range envVars { - os.Setenv(key, "") - } - }) - - It("sets PATH based on the supplied deps", func() { - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("PATH") - if runtime.GOOS == "windows" { - Expect(newPath).To(Equal(fmt.Sprintf("%s\\01\\bin;%s\\00\\bin", depsDir, depsDir))) - } else { - Expect(newPath).To(Equal(fmt.Sprintf("%s/01/bin:%s/00/bin", depsDir, depsDir))) - } - }) - - It("sets LD_LIBRARY_PATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use LD_LIBRARY_PATH on Windows.") - } - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("LD_LIBRARY_PATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/02/lib:%s/01/lib", depsDir, depsDir))) - }) - - It("sets LIBRARY_PATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use LIBRARY_PATH on Windows.") - } - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("LIBRARY_PATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/02/lib:%s/01/lib", depsDir, depsDir))) - }) - - It("sets CPATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use CPATH on Windows.") - } - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("CPATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/03/include", depsDir))) - }) - - It("sets PKG_CONFIG_PATH based on the supplied deps", func() { - if runtime.GOOS == "windows" { - Skip("We don't use PKG_CONFIG_PATH on Windows.") - } - err = s.SetStagingEnvironment() - Expect(err).To(BeNil()) - - newPath := os.Getenv("PKG_CONFIG_PATH") - Expect(newPath).To(Equal(fmt.Sprintf("%s/04/pkgconfig", depsDir))) - }) - }) - }) - - Describe("BuildpackLanguage", func() { - It("gets buildpack language", func() { - Expect(s.BuildpackLanguage()).To(Equal("dotnet-core")) - }) - }) - - Describe("BuildpackVersion", func() { - It("gets buildpack version", func() { - ver, err := s.BuildpackVersion() - Expect(err).To(BeNil()) - Expect(ver).To(Equal("99.99")) - }) - }) - - Describe("SetLaunchEnvironment", func() { - It("writes a .profile.d script allowing the runtime container to use the supplied deps", func() { - err = s.SetLaunchEnvironment() - Expect(err).To(BeNil()) - - if runtime.GOOS == "windows" { - contents, err := ioutil.ReadFile(filepath.Join(profileDir, "000_multi-supply.bat")) - Expect(err).To(BeNil()) - Expect(string(contents)).To(ContainSubstring(`set PATH=%DEPS_DIR%\01\bin;%DEPS_DIR%\00\bin;%PATH%`)) - } else { - contents, err := ioutil.ReadFile(filepath.Join(profileDir, "000_multi-supply.sh")) - Expect(err).To(BeNil()) - Expect(string(contents)).To(ContainSubstring(`export LIBRARY_PATH=$DEPS_DIR/02/lib:$DEPS_DIR/01/lib$([[ ! -z "${LIBRARY_PATH:-}" ]] && echo ":$LIBRARY_PATH")`)) - Expect(string(contents)).To(ContainSubstring(`export LD_LIBRARY_PATH=$DEPS_DIR/02/lib:$DEPS_DIR/01/lib$([[ ! -z "${LD_LIBRARY_PATH:-}" ]] && echo ":$LD_LIBRARY_PATH")`)) - Expect(string(contents)).To(ContainSubstring(`export LIBRARY_PATH=$DEPS_DIR/02/lib:$DEPS_DIR/01/lib$([[ ! -z "${LIBRARY_PATH:-}" ]] && echo ":$LIBRARY_PATH")`)) - } - }) - - It("copies scripts from //profile.d to the .profile.d directory, prepending ", func() { - err = s.SetLaunchEnvironment() - Expect(err).To(BeNil()) - - contents, err := ioutil.ReadFile(filepath.Join(profileDir, "00_supplied-script.sh")) - Expect(err).To(BeNil()) - - Expect(string(contents)).To(Equal("first")) - - contents, err = ioutil.ReadFile(filepath.Join(profileDir, "01_supplied-script.sh")) - Expect(err).To(BeNil()) - - Expect(string(contents)).To(Equal("second")) - }) - }) - }) - -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_unix_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_unix_test.go deleted file mode 100644 index a243b06..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_unix_test.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !windows - -package libbuildpack_test - -import "syscall" - -func umask(newmask int) (oldmask int) { - return syscall.Umask(newmask) -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_windows_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_windows_test.go deleted file mode 100644 index 6446bb0..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/umask_windows_test.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build windows - -package libbuildpack_test - -func umask(newmask int) (oldmask int) { - return 0 -} diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/util_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/util_test.go deleted file mode 100644 index 7f1c374..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/util_test.go +++ /dev/null @@ -1,425 +0,0 @@ -package libbuildpack_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "runtime" - - "github.com/cloudfoundry/libbuildpack" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Util", func() { - const windowsFileModeWarning = "Windows does not respect file mode bits as Linux does, see https://golang.org/pkg/os/#Chmod" - - Describe("ExtractZip", func() { - var ( - tmpdir string - err error - fileInfo os.FileInfo - ) - BeforeEach(func() { - tmpdir, err = ioutil.TempDir("", "exploded") - Expect(err).To(BeNil()) - }) - AfterEach(func() { err = os.RemoveAll(tmpdir); Expect(err).To(BeNil()) }) - - Context("with a valid zip file", func() { - It("extracts a file at the root", func() { - err = libbuildpack.ExtractZip("fixtures/thing.zip", tmpdir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "root.txt")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(tmpdir, "root.txt"))).To(Equal([]byte("root\n"))) - }) - - It("extracts a nested file", func() { - err = libbuildpack.ExtractZip("fixtures/thing.zip", tmpdir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(tmpdir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - - It("preserves the file mode", func() { - if runtime.GOOS == "windows" { - Skip(windowsFileModeWarning) - } - - err = libbuildpack.ExtractZip("fixtures/thing.zip", tmpdir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - fileInfo, err = os.Stat(filepath.Join(tmpdir, "thing", "bin", "file2.exe")) - - Expect(fileInfo.Mode()).To(Equal(os.FileMode(0755))) - }) - }) - - Context("with a missing zip file", func() { - It("returns an error", func() { - err = libbuildpack.ExtractZip("fixtures/notexist.zip", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("with an invalid zip file", func() { - It("returns an error", func() { - err = libbuildpack.ExtractZip("fixtures/manifest.yml", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - Context("with a malicious local symlink", func() { - It("writes all symlinks as empty directory", func() { - err := libbuildpack.ExtractZip("fixtures/maliciousRelativeSymlink.zip", tmpdir) - Expect(err).To(BeNil()) - Expect(filepath.Join(tmpdir, "link")).To(BeADirectory()) - }) - }) - Context("with a malicious global symlink", func() { - It("writes symlink as empty directory", func() { - err := libbuildpack.ExtractZip("fixtures/maliciousGlobalSymlink.zip", tmpdir) - Expect(err).To(BeNil()) - Expect(filepath.Join(tmpdir, "passwdLink")).To(BeADirectory()) - }) - }) - }) - - Describe("GetBuildpackDir", func() { - var ( - parentDir string - testBpDir string - oldBpDir string - err error - ) - - BeforeEach(func() { - parentDir, err = filepath.Abs(filepath.Join(filepath.Dir(os.Args[0]), "..")) - Expect(err).To(BeNil()) - }) - - JustBeforeEach(func() { - oldBpDir = os.Getenv("BUILDPACK_DIR") - err = os.Setenv("BUILDPACK_DIR", testBpDir) - Expect(err).To(BeNil()) - }) - - AfterEach(func() { - err = os.Setenv("BUILDPACK_DIR", oldBpDir) - Expect(err).To(BeNil()) - }) - - Context("BUILDPACK_DIR is set", func() { - BeforeEach(func() { - testBpDir = "buildpack_root_directory" - }) - It("returns the value for BUILDPACK_DIR", func() { - dir, err := libbuildpack.GetBuildpackDir() - Expect(err).To(BeNil()) - Expect(dir).To(Equal("buildpack_root_directory")) - }) - }) - Context("BUILDPACK_DIR is not set", func() { - BeforeEach(func() { - testBpDir = "" - }) - It("returns the parent of the directory containing the executable", func() { - dir, err := libbuildpack.GetBuildpackDir() - Expect(err).To(BeNil()) - Expect(dir).To(Equal(parentDir)) - }) - }) - }) - - Describe("Untar", func() { - var ( - tmpdir string - err error - fileInfo os.FileInfo - ) - BeforeEach(func() { - tmpdir, err = ioutil.TempDir("", "exploded") - Expect(err).To(BeNil()) - }) - AfterEach(func() { err = os.RemoveAll(tmpdir); Expect(err).To(BeNil()) }) - - Context("with a valid tar file", func() { - It("extracts a file at the root", func() { - err = libbuildpack.ExtractTarGz("fixtures/thing.tgz", tmpdir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "root.txt")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(tmpdir, "root.txt"))).To(Equal([]byte("root\n"))) - }) - - It("extracts a nested file", func() { - err = libbuildpack.ExtractTarGz("fixtures/thing.tgz", tmpdir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(tmpdir, "thing", "bin", "file2.exe"))).To(Equal([]byte("progam2\n"))) - }) - - It("preserves the file mode", func() { - if runtime.GOOS == "windows" { - Skip(windowsFileModeWarning) - } - - err = libbuildpack.ExtractTarGz("fixtures/thing.tgz", tmpdir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "thing", "bin", "file2.exe")).To(BeAnExistingFile()) - fileInfo, err = os.Stat(filepath.Join(tmpdir, "thing", "bin", "file2.exe")) - - Expect(fileInfo.Mode()).To(Equal(os.FileMode(0755))) - }) - - It("handles symlinks", func() { - err = libbuildpack.ExtractTarGz("fixtures/symlink.tgz", tmpdir) - Expect(err).To(BeNil()) - - path := filepath.Join(tmpdir, "other", "file.txt") - Expect(path).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(path)).To(Equal([]byte("content\n"))) - - fi, err := os.Lstat(path) - Expect(err).To(BeNil()) - Expect(fi.Mode() & os.ModeSymlink).ToNot(Equal(0)) - }) - It("handles malicious global symlinks", func() { - err = libbuildpack.ExtractTarGz("fixtures/maliciousGlobalSymlink.tar.gz", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("with a missing tar file", func() { - It("returns an error", func() { - err = libbuildpack.ExtractTarGz("fixtures/notexist.tgz", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("with an invalid tar file", func() { - It("returns an error", func() { - err = libbuildpack.ExtractTarGz("fixtures/manifest.yml", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("when a tar file contains path traversal", func() { - It("returns an error", func() { - err = libbuildpack.ExtractTarGz("fixtures/path_traversal.tgz", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - }) - - Describe("CopyFile", func() { - var ( - tmpdir string - err error - fileInfo os.FileInfo - oldMode os.FileMode - oldUmask int - ) - BeforeEach(func() { - var fh *os.File - sourceFile := "fixtures/source.txt" - - tmpdir, err = ioutil.TempDir("", "copy") - Expect(err).To(BeNil()) - - fileInfo, err = os.Stat(sourceFile) - Expect(err).To(BeNil()) - oldMode = fileInfo.Mode() - - fh, err = os.Open(sourceFile) - Expect(err).To(BeNil()) - defer fh.Close() - - if runtime.GOOS != "windows" { - err = fh.Chmod(0742) - Expect(err).To(BeNil()) - } - - oldUmask = umask(0000) - }) - AfterEach(func() { - var fh *os.File - sourceFile := "fixtures/source.txt" - - fh, err = os.Open(sourceFile) - Expect(err).To(BeNil()) - defer fh.Close() - - if runtime.GOOS != "windows" { - err = fh.Chmod(oldMode) - Expect(err).To(BeNil()) - } - - err = os.RemoveAll(tmpdir) - Expect(err).To(BeNil()) - - umask(oldUmask) - }) - - Context("with a valid source file", func() { - It("copies the file", func() { - err = libbuildpack.CopyFile("fixtures/source.txt", filepath.Join(tmpdir, "out.txt")) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "out.txt")).To(BeAnExistingFile()) - Expect(ioutil.ReadFile(filepath.Join(tmpdir, "out.txt"))).To(Equal([]byte("a file\n"))) - }) - - It("preserves the file mode", func() { - if runtime.GOOS == "windows" { - Skip(windowsFileModeWarning) - } - - err = libbuildpack.CopyFile("fixtures/source.txt", filepath.Join(tmpdir, "out.txt")) - Expect(err).To(BeNil()) - - Expect(filepath.Join(tmpdir, "out.txt")).To(BeAnExistingFile()) - fileInfo, err = os.Stat(filepath.Join(tmpdir, "out.txt")) - - Expect(fileInfo.Mode()).To(Equal(os.FileMode(0742))) - }) - }) - - Context("with a missing file", func() { - It("returns an error", func() { - err = libbuildpack.ExtractTarGz("fixtures/notexist.txt", tmpdir) - Expect(err).ToNot(BeNil()) - }) - }) - }) - - Describe("CopyDirectory", func() { - var ( - destDir string - err error - ) - - BeforeEach(func() { - destDir, err = ioutil.TempDir("", "destDir") - Expect(err).To(BeNil()) - }) - - It("copies source to destination", func() { - srcDir := filepath.Join("fixtures", "copydir") - err = libbuildpack.CopyDirectory(srcDir, destDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(srcDir, "source.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(srcDir, "standard", "manifest.yml")).To(BeAnExistingFile()) - - Expect(filepath.Join(destDir, "source.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(destDir, "standard", "manifest.yml")).To(BeAnExistingFile()) - }) - - It("handles symlink to directory", func() { - if runtime.GOOS == "windows" { - Skip("Symlinks require administrator privileges on windows and are not used") - } - - srcDir := filepath.Join("fixtures", "copydir_symlinks") - err = libbuildpack.CopyDirectory(srcDir, destDir) - Expect(err).To(BeNil()) - - Expect(filepath.Join(srcDir, "source.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(srcDir, "sym_source.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(srcDir, "standard", "manifest.yml")).To(BeAnExistingFile()) - Expect(filepath.Join(srcDir, "sym_standard", "manifest.yml")).To(BeAnExistingFile()) - - Expect(filepath.Join(destDir, "source.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(destDir, "sym_source.txt")).To(BeAnExistingFile()) - Expect(filepath.Join(destDir, "standard", "manifest.yml")).To(BeAnExistingFile()) - Expect(filepath.Join(destDir, "sym_standard", "manifest.yml")).To(BeAnExistingFile()) - }) - }) - - Describe("MoveDirectory", func() { - var ( - srcDir string - destDir string - err error - ) - - BeforeEach(func() { - srcDir, err = ioutil.TempDir("", "dir1") - Expect(err).ToNot(HaveOccurred()) - destDir, err = ioutil.TempDir("", "") - Expect(err).ToNot(HaveOccurred()) - }) - - Context("destination directory does not exist", func() { - Context("source directory does exist", func() { - It("should move source to dest", func() { - innerDir := filepath.Join(srcDir, "inner_dir") - innerDestDir := filepath.Join(destDir, "inner_dir") - Expect(os.MkdirAll(innerDir, os.ModePerm)).ToNot(HaveOccurred()) - Expect(libbuildpack.MoveDirectory(srcDir, destDir)).To(Succeed()) - Expect(innerDestDir).To(BeADirectory()) - }) - }) - }) - - Context("destination directory does exist", func() { - Context("source directory does exist", func() { - It("should move source to dest but not overwrite existing files", func() { - innerDir := filepath.Join(srcDir, "inner_dir") - innerDestDir := filepath.Join(destDir, "inner_dir") - Expect(os.MkdirAll(innerDir, 0777)).To(Succeed()) - Expect(os.MkdirAll(innerDestDir, 0777)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(innerDir, "test_file"), []byte("contentsA"), 0777)).To(Succeed()) - Expect(ioutil.WriteFile(filepath.Join(innerDestDir, "test_file"), []byte("contentsB"), 0777)).To(Succeed()) - Expect(os.MkdirAll(innerDir, os.ModePerm)).ToNot(HaveOccurred()) - Expect(libbuildpack.MoveDirectory(srcDir, destDir)).To(Succeed()) - Expect(innerDestDir).To(BeADirectory()) - destFile := filepath.Join(innerDestDir, "test_file") - Expect(destFile).To(BeAnExistingFile()) - contents, err := ioutil.ReadFile(destFile) - Expect(err).ToNot(HaveOccurred()) - Expect(string(contents)).To(ContainSubstring("contentsB")) - }) - }) - }) - }) - - Describe("FileExists", func() { - Context("the file exists", func() { - var ( - dir string - err error - ) - - BeforeEach(func() { - dir, err = ioutil.TempDir("", "file.exists") - Expect(err).To(BeNil()) - }) - - AfterEach(func() { - err = os.RemoveAll(dir) - Expect(err).To(BeNil()) - }) - - It("returns true", func() { - exists, err := libbuildpack.FileExists(dir) - Expect(err).To(BeNil()) - Expect(exists).To(BeTrue()) - }) - }) - - Context("the file does not exist", func() { - It("returns false", func() { - exists, err := libbuildpack.FileExists("not/exist") - Expect(err).To(BeNil()) - Expect(exists).To(BeFalse()) - }) - }) - - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/versions_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/versions_test.go deleted file mode 100644 index 15592df..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/versions_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package libbuildpack_test - -import ( - "fmt" - - bp "github.com/cloudfoundry/libbuildpack" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("versions", func() { - - Describe("FindMatchingVersion", func() { - var versions []string - - BeforeEach(func() { - versions = []string{"1.2.3", "1.2.4", "1.2.2", "1.3.3", "1.3.4", "1.3.2", "2.0.0"} - }) - - It("returns the greatest version", func() { - ver, err := bp.FindMatchingVersion("x", versions) - Expect(err).To(BeNil()) - Expect(ver).To(Equal("2.0.0")) - }) - - It("returns the greatest version in a minor line", func() { - ver, err := bp.FindMatchingVersion("1.x", versions) - Expect(err).To(BeNil()) - Expect(ver).To(Equal("1.3.4")) - }) - - It("returns the greatest version in a patch line", func() { - ver, err := bp.FindMatchingVersion("1.2.x", versions) - Expect(err).To(BeNil()) - Expect(ver).To(Equal("1.2.4")) - }) - - It("returns the greatest version less than the above", func() { - ver, err := bp.FindMatchingVersion(">=1.2.0, <1.2.4", versions) - Expect(err).To(BeNil()) - Expect(ver).To(Equal("1.2.3")) - }) - - It("returns the greatest version less than the above (without comma)", func() { - ver, err := bp.FindMatchingVersion(">=1.2.0 <1.2.4", versions) - Expect(err).To(BeNil()) - Expect(ver).To(Equal("1.2.3")) - }) - - It("returns the greatest version less or equal than the above (without comma)", func() { - ver, err := bp.FindMatchingVersion(">1.2.0 <=1.2.4", versions) - Expect(err).To(BeNil()) - Expect(ver).To(Equal("1.2.4")) - }) - - It("returns an error if nothing matches", func() { - _, err := bp.FindMatchingVersion("1.4.x", versions) - Expect(err).ToNot(BeNil()) - Expect(err.Error()).To(Equal(fmt.Sprintf("no match found for 1.4.x in %v", versions))) - }) - }) - Describe("FindMatchingVersions", func() { - var versions []string - - BeforeEach(func() { - versions = []string{"1.2.3", "1.2.4", "1.2.2", "1.3.3", "1.3.4", "1.3.2", "2.0.0"} - }) - - It("Returns every version for x, sorted", func() { - vers, err := bp.FindMatchingVersions("x", versions) - Expect(err).To(BeNil()) - Expect(vers).To(Equal([]string{"1.2.2", "1.2.3", "1.2.4", "1.3.2", "1.3.3", "1.3.4", "2.0.0"})) - }) - - It("returns all versions in a minor line, sorted", func() { - vers, err := bp.FindMatchingVersions("1.x", versions) - Expect(err).To(BeNil()) - Expect(vers).To(Equal([]string{"1.2.2", "1.2.3", "1.2.4", "1.3.2", "1.3.3", "1.3.4"})) - }) - - It("returns all versions in a patch line", func() { - vers, err := bp.FindMatchingVersions("1.2.x", versions) - Expect(err).To(BeNil()) - Expect(vers).To(Equal([]string{"1.2.2", "1.2.3", "1.2.4"})) - }) - - It("returns all versions less than the above", func() { - vers, err := bp.FindMatchingVersions(">=1.2.0, <1.2.4", versions) - Expect(err).To(BeNil()) - Expect(vers).To(Equal([]string{"1.2.2", "1.2.3"})) - }) - - It("returns all versions less than the above (without comma)", func() { - vers, err := bp.FindMatchingVersions(">=1.2.0 <1.2.4", versions) - Expect(err).To(BeNil()) - Expect(vers).To(Equal([]string{"1.2.2", "1.2.3"})) - }) - - It("returns all versions less or equal than the above (without comma)", func() { - vers, err := bp.FindMatchingVersions(">1.2.2 <=1.2.4", versions) - Expect(err).To(BeNil()) - Expect(vers).To(Equal([]string{"1.2.3", "1.2.4"})) - }) - - It("returns an error if nothing matches", func() { - _, err := bp.FindMatchingVersions("1.4.x", versions) - Expect(err).ToNot(BeNil()) - Expect(err.Error()).To(Equal(fmt.Sprintf("no match found for 1.4.x in %v", versions))) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/yaml_test.go b/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/yaml_test.go deleted file mode 100644 index ffb0c88..0000000 --- a/src/imagemagick/vendor/github.com/cloudfoundry/libbuildpack/yaml_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package libbuildpack_test - -import ( - "io/ioutil" - "os" - "path/filepath" - - "github.com/cloudfoundry/libbuildpack" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("YAML", func() { - var ( - yaml *libbuildpack.YAML - tmpDir string - err error - ) - - BeforeEach(func() { - tmpDir, err = ioutil.TempDir("", "yaml") - Expect(err).To(BeNil()) - - yaml = &libbuildpack.YAML{} - }) - - AfterEach(func() { - err = os.RemoveAll(tmpDir) - Expect(err).To(BeNil()) - }) - - Describe("Load", func() { - Context("file is valid yaml", func() { - BeforeEach(func() { - ioutil.WriteFile(filepath.Join(tmpDir, "valid.yml"), []byte("key: value"), 0666) - }) - It("returns an error", func() { - obj := make(map[string]string) - err = yaml.Load(filepath.Join(tmpDir, "valid.yml"), &obj) - - Expect(err).To(BeNil()) - Expect(obj["key"]).To(Equal("value")) - }) - }) - - Context("file is NOT valid yaml", func() { - BeforeEach(func() { - ioutil.WriteFile(filepath.Join(tmpDir, "invalid.yml"), []byte("not valid yml"), 0666) - }) - It("returns an error", func() { - obj := make(map[string]string) - err = yaml.Load(filepath.Join(tmpDir, "invalid.yml"), &obj) - Expect(err).ToNot(BeNil()) - }) - }) - - Context("file does not exist", func() { - It("returns an error", func() { - obj := make(map[string]string) - err = yaml.Load(filepath.Join(tmpDir, "does_not_exist.yml"), &obj) - Expect(err).ToNot(BeNil()) - }) - }) - }) - - Describe("Write", func() { - Context("directory exists", func() { - It("writes the yaml to a file ", func() { - obj := map[string]string{ - "key": "val", - } - err = yaml.Write(filepath.Join(tmpDir, "file.yml"), obj) - Expect(err).To(BeNil()) - - Expect(ioutil.ReadFile(filepath.Join(tmpDir, "file.yml"))).To(Equal([]byte("key: val\n"))) - }) - }) - - Context("directory does not exist", func() { - It("creates the directory ", func() { - obj := map[string]string{ - "key": "val", - } - err = yaml.Write(filepath.Join(tmpDir, "extradir", "file.yml"), obj) - Expect(err).To(BeNil()) - - Expect(ioutil.ReadFile(filepath.Join(tmpDir, "extradir", "file.yml"))).To(Equal([]byte("key: val\n"))) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl-gen.sh b/src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl-gen.sh deleted file mode 100755 index fdaab6a..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl-gen.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -ex -# generate CA's key -openssl genrsa -aes256 -passout pass:1 -out ca.key.pem 4096 -openssl rsa -passin pass:1 -in ca.key.pem -out ca.key.pem.tmp -mv ca.key.pem.tmp ca.key.pem - -openssl req -config openssl.cnf -key ca.key.pem -new -x509 -days 7300 -sha256 -extensions v3_ca -out ca.pem diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl.cnf b/src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl.cnf deleted file mode 100644 index 2fbb5e5..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/certs/openssl.cnf +++ /dev/null @@ -1,39 +0,0 @@ -[ ca ] -default_ca = CA_default -[ CA_default ] -default_md = sha256 -[ v3_ca ] -subjectKeyIdentifier=hash -authorityKeyIdentifier=keyid:always,issuer -basicConstraints = critical,CA:true -[ req ] -distinguished_name = req_distinguished_name -[ req_distinguished_name ] -countryName = Country Name (2 letter code) -countryName_default = IL -countryName_min = 2 -countryName_max = 2 - -stateOrProvinceName = State or Province Name (full name) -stateOrProvinceName_default = Center - -localityName = Locality Name (eg, city) -localityName_default = Lod - -0.organizationName = Organization Name (eg, company) -0.organizationName_default = GoProxy - -# we can do this but it is not needed normally :-) -#1.organizationName = Second Organization Name (eg, company) -#1.organizationName_default = World Wide Web Pty Ltd - -organizationalUnitName = Organizational Unit Name (eg, section) -organizationalUnitName_default = GoProxy - -commonName = Common Name (e.g. server FQDN or YOUR name) -commonName_default = goproxy.github.io -commonName_max = 64 - -emailAddress = Email Address -emailAddress_default = elazarl@gmail.com -emailAddress_max = 64 diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/counterecryptor_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/counterecryptor_test.go deleted file mode 100644 index 12b31e1..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/counterecryptor_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package goproxy_test - -import ( - "bytes" - "crypto/rsa" - "encoding/binary" - "github.com/elazarl/goproxy" - "io" - "math" - "math/rand" - "testing" -) - -type RandSeedReader struct { - r rand.Rand -} - -func (r *RandSeedReader) Read(b []byte) (n int, err error) { - for i := range b { - b[i] = byte(r.r.Int() & 0xFF) - } - return len(b), nil -} - -func TestCounterEncDifferentConsecutive(t *testing.T) { - k, err := rsa.GenerateKey(&RandSeedReader{*rand.New(rand.NewSource(0xFF43109))}, 128) - fatalOnErr(err, "rsa.GenerateKey", t) - c, err := goproxy.NewCounterEncryptorRandFromKey(k, []byte("the quick brown fox run over the lazy dog")) - fatalOnErr(err, "NewCounterEncryptorRandFromKey", t) - for i := 0; i < 100*1000; i++ { - var a, b int64 - binary.Read(&c, binary.BigEndian, &a) - binary.Read(&c, binary.BigEndian, &b) - if a == b { - t.Fatal("two consecutive equal int64", a, b) - } - } -} - -func TestCounterEncIdenticalStreams(t *testing.T) { - k, err := rsa.GenerateKey(&RandSeedReader{*rand.New(rand.NewSource(0xFF43109))}, 128) - fatalOnErr(err, "rsa.GenerateKey", t) - c1, err := goproxy.NewCounterEncryptorRandFromKey(k, []byte("the quick brown fox run over the lazy dog")) - fatalOnErr(err, "NewCounterEncryptorRandFromKey", t) - c2, err := goproxy.NewCounterEncryptorRandFromKey(k, []byte("the quick brown fox run over the lazy dog")) - fatalOnErr(err, "NewCounterEncryptorRandFromKey", t) - nout := 1000 - out1, out2 := make([]byte, nout), make([]byte, nout) - io.ReadFull(&c1, out1) - tmp := out2[:] - rand.Seed(0xFF43109) - for len(tmp) > 0 { - n := 1 + rand.Intn(256) - if n > len(tmp) { - n = len(tmp) - } - n, err := c2.Read(tmp[:n]) - fatalOnErr(err, "CounterEncryptorRand.Read", t) - tmp = tmp[n:] - } - if !bytes.Equal(out1, out2) { - t.Error("identical CSPRNG does not produce the same output") - } -} - -func stddev(data []int) float64 { - var sum, sum_sqr float64 = 0, 0 - for _, h := range data { - sum += float64(h) - sum_sqr += float64(h) * float64(h) - } - n := float64(len(data)) - variance := (sum_sqr - ((sum * sum) / n)) / (n - 1) - return math.Sqrt(variance) -} - -func TestCounterEncStreamHistogram(t *testing.T) { - k, err := rsa.GenerateKey(&RandSeedReader{*rand.New(rand.NewSource(0xFF43109))}, 128) - fatalOnErr(err, "rsa.GenerateKey", t) - c, err := goproxy.NewCounterEncryptorRandFromKey(k, []byte("the quick brown fox run over the lazy dog")) - fatalOnErr(err, "NewCounterEncryptorRandFromKey", t) - nout := 100 * 1000 - out := make([]byte, nout) - io.ReadFull(&c, out) - refhist := make([]int, 256) - for i := 0; i < nout; i++ { - refhist[rand.Intn(256)]++ - } - hist := make([]int, 256) - for _, b := range out { - hist[int(b)]++ - } - refstddev, stddev := stddev(refhist), stddev(hist) - // due to lack of time, I guestimate - t.Logf("ref:%v - act:%v = %v", refstddev, stddev, math.Abs(refstddev-stddev)) - if math.Abs(refstddev-stddev) >= 1 { - t.Errorf("stddev of ref histogram different than regular PRNG: %v %v", refstddev, stddev) - } -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md deleted file mode 100644 index 8778f2a..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Simple HTTP Proxy - -`goproxy-basic` starts an HTTP proxy on :8080. It only handles explicit CONNECT -requests. - -Start it in one shell: - -```sh -goproxy-basic -v -``` - -Fetch goproxy homepage in another: - -```sh -http_proxy=http://127.0.0.1:8080 wget -O - \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -The homepage HTML content should be displayed in the console. The proxy should -have logged the request being processed: - -```sh -2015/04/09 18:19:17 [001] INFO: Got request /p/introducing-goproxy-light-http-proxy/ ripper234.com GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -2015/04/09 18:19:17 [001] INFO: Sending request GET http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -2015/04/09 18:19:18 [001] INFO: Received response 200 OK -2015/04/09 18:19:18 [001] INFO: Copying response to client 200 OK [200] -2015/04/09 18:19:18 [001] INFO: Copied 44333 bytes to client error= -``` - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go deleted file mode 100644 index 22dc4a9..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-basic/main.go +++ /dev/null @@ -1,17 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "flag" - "net/http" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/cert.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/cert.go deleted file mode 100644 index f4fb578..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/cert.go +++ /dev/null @@ -1,75 +0,0 @@ -package main - -import ( - "crypto/tls" - "crypto/x509" - - "github.com/elazarl/goproxy" -) - -var caCert = []byte(`-----BEGIN CERTIFICATE----- -MIIDkzCCAnugAwIBAgIJAKe/ZGdfcHdPMA0GCSqGSIb3DQEBCwUAMGAxCzAJBgNV -BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX -aWRnaXRzIFB0eSBMdGQxGTAXBgNVBAMMEGRlbW8gZm9yIGdvcHJveHkwHhcNMTYw -OTI3MTQzNzQ3WhcNMTkwOTI3MTQzNzQ3WjBgMQswCQYDVQQGEwJBVTETMBEGA1UE -CAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRk -MRkwFwYDVQQDDBBkZW1vIGZvciBnb3Byb3h5MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA2+W48YZoch72zj0a+ZlyFVY2q2MWmqsEY9f/u53fAeTxvPE6 -1/DnqsydnA3FnGvxw9Dz0oZO6xG+PZvp+lhN07NZbuXK1nie8IpxCa342axpu4C0 -69lZwxikpGyJO4IL5ywp/qfb5a2DxPTAyQOQ8ROAaydoEmktRp25yicnQ2yeZW// -1SIQxt7gRxQIGmuOQ/Gqr/XN/z2cZdbGJVRUvQXk7N6NhQiCX1zlmp1hzUW9jwC+ -JEKKF1XVpQbc94Bo5supxhkKJ70CREPy8TH9mAUcQUZQRohnPvvt/lKneYAGhjHK -vhpajwlbMMSocVXFvY7o/IqIE/+ZUeQTs1SUwQIDAQABo1AwTjAdBgNVHQ4EFgQU -GnlWcIbfsWJW7GId+6xZIK8YlFEwHwYDVR0jBBgwFoAUGnlWcIbfsWJW7GId+6xZ -IK8YlFEwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAoFUjSD15rKlY -xudzyVlr6n0fRNhITkiZMX3JlFOvtHNYif8RfK4TH/oHNBTmle69AgixjMgy8GGd -H90prytGQ5zCs1tKcCFsN5gRSgdAkc2PpRFOK6u8HwOITV5lV7sjucsddXJcOJbQ -4fyVe47V9TTxI+A7lRnUP2HYTR1Bd0R/IgRAH57d1ZHs7omHIuQ+Ea8ph2ppXMnP -DXVOlZ9zfczSnPnQoomqULOU9Fq2ycyi8Y/ROtAHP6O7wCFbYHXhxojdaHSdhkcd -troTflFMD2/4O6MtBKbHxSmEG6H0FBYz5xUZhZq7WUH24V3xYsfge29/lOCd5/Xf -A+j0RJc/lQ== ------END CERTIFICATE-----`) - -var caKey = []byte(`-----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEA2+W48YZoch72zj0a+ZlyFVY2q2MWmqsEY9f/u53fAeTxvPE6 -1/DnqsydnA3FnGvxw9Dz0oZO6xG+PZvp+lhN07NZbuXK1nie8IpxCa342axpu4C0 -69lZwxikpGyJO4IL5ywp/qfb5a2DxPTAyQOQ8ROAaydoEmktRp25yicnQ2yeZW// -1SIQxt7gRxQIGmuOQ/Gqr/XN/z2cZdbGJVRUvQXk7N6NhQiCX1zlmp1hzUW9jwC+ -JEKKF1XVpQbc94Bo5supxhkKJ70CREPy8TH9mAUcQUZQRohnPvvt/lKneYAGhjHK -vhpajwlbMMSocVXFvY7o/IqIE/+ZUeQTs1SUwQIDAQABAoIBAHK94ww8W0G5QIWL -Qwkc9XeGvg4eLUxVknva2Ll4fkZJxY4WveKx9OCd1lv4n7WoacYIwUGIDaQBZShW -s/eKnkmqGy+PvpC87gqL4sHvQpuqqJ1LYpxylLEFqduWOuGPUVC2Lc+QnWCycsCS -CgqZzsbMq0S+kkKRGSvw32JJneZCzqLgLNssQNVk+Gm6SI3s4jJsGPesjhnvoPaa -xZK14uFpltaA05GSTDaQeZJFEdnnb3f/eNPc2xMEfi0S2ZlJ6Q92WJEOepAetDlR -cRFi004bNyTb4Bphg8s4+9Cti5is199aFkGCRDWxeqEnc6aMY3Ezu9Qg3uttLVUd -uy830GUCgYEA7qS0X+9UH1R02L3aoANyADVbFt2ZpUwQGauw9WM92pH52xeHAw1S -ohus6FI3OC8xQq2CN525tGLUbFDZnNZ3YQHqFsfgevfnTs1//gbKXomitev0oFKh -VT+WYS4lkgYtPlXzhdGuk32q99T/wIocAguvCUY3PiA7yBz93ReyausCgYEA6+P8 -bugMqT8qjoiz1q/YCfxsw9bAGWjlVqme2xmp256AKtxvCf1BPsToAaJU3nFi3vkw -ICLxUWAYoMBODJ3YnbOsIZOavdXZwYHv54JqwqFealC3DG0Du6fZYZdiY8pK+E6m -3fiYzP1WoVK5tU4bH8ibuIQvpcI8j7Gy0cV6/AMCgYBHl7fZNAZro72uLD7DVGVF -9LvP/0kR0uDdoqli5JPw12w6szM40i1hHqZfyBJy042WsFDpeHL2z9Nkb1jpeVm1 -C4r7rJkGqwqElJf6UHUzqVzb8N6hnkhyN7JYkyyIQzwdgFGfaslRzBiXYxoa3BQM -9Q5c3OjDxY3JuhDa3DoVYwKBgDNqrWJLSD832oHZAEIicBe1IswJKjQfriWWsV6W -mHSbdtpg0/88aZVR/DQm+xLFakSp0jifBTS0momngRu06Dtvp2xmLQuF6oIIXY97 -2ON1owvPbibSOEcWDgb8pWCU/oRjOHIXts6vxctCKeKAFN93raGphm0+Ck9T72NU -BTubAoGBAMEhI/Wy9wAETuXwN84AhmPdQsyCyp37YKt2ZKaqu37x9v2iL8JTbPEz -pdBzkA2Gc0Wdb6ekIzRrTsJQl+c/0m9byFHsRsxXW2HnezfOFX1H4qAmF6KWP0ub -M8aIn6Rab4sNPSrvKGrU6rFpv/6M33eegzldVnV9ku6uPJI1fFTC ------END RSA PRIVATE KEY-----`) - -func setCA(caCert, caKey []byte) error { - goproxyCa, err := tls.X509KeyPair(caCert, caKey) - if err != nil { - return err - } - if goproxyCa.Leaf, err = x509.ParseCertificate(goproxyCa.Certificate[0]); err != nil { - return err - } - goproxy.GoproxyCa = goproxyCa - goproxy.OkConnect = &goproxy.ConnectAction{Action: goproxy.ConnectAccept, TLSConfig: goproxy.TLSConfigFromCA(&goproxyCa)} - goproxy.MitmConnect = &goproxy.ConnectAction{Action: goproxy.ConnectMitm, TLSConfig: goproxy.TLSConfigFromCA(&goproxyCa)} - goproxy.HTTPMitmConnect = &goproxy.ConnectAction{Action: goproxy.ConnectHTTPMitm, TLSConfig: goproxy.TLSConfigFromCA(&goproxyCa)} - goproxy.RejectConnect = &goproxy.ConnectAction{Action: goproxy.ConnectReject, TLSConfig: goproxy.TLSConfigFromCA(&goproxyCa)} - return nil -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/main.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/main.go deleted file mode 100644 index 11171ef..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-customca/main.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -import ( - "flag" - "log" - "net/http" - - "github.com/elazarl/goproxy" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - setCA(caCert, caKey) - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go deleted file mode 100644 index 9d80653..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-eavesdropper/main.go +++ /dev/null @@ -1,56 +0,0 @@ -package main - -import ( - "bufio" - "flag" - "log" - "net" - "net/http" - "regexp" - - "github.com/elazarl/goproxy" -) - -func orPanic(err error) { - if err != nil { - panic(err) - } -} - -func main() { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*baidu.com$"))). - HandleConnect(goproxy.AlwaysReject) - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*$"))). - HandleConnect(goproxy.AlwaysMitm) - // enable curl -p for all hosts on port 80 - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*:80$"))). - HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) { - defer func() { - if e := recover(); e != nil { - ctx.Logf("error connecting to remote: %v", e) - client.Write([]byte("HTTP/1.1 500 Cannot reach destination\r\n\r\n")) - } - client.Close() - }() - clientBuf := bufio.NewReadWriter(bufio.NewReader(client), bufio.NewWriter(client)) - remote, err := net.Dial("tcp", req.URL.Host) - orPanic(err) - remoteBuf := bufio.NewReadWriter(bufio.NewReader(remote), bufio.NewWriter(remote)) - for { - req, err := http.ReadRequest(clientBuf.Reader) - orPanic(err) - orPanic(req.Write(remoteBuf)) - orPanic(remoteBuf.Flush()) - resp, err := http.ReadResponse(remoteBuf.Reader, req) - orPanic(err) - orPanic(resp.Write(clientBuf.Writer)) - orPanic(clientBuf.Flush()) - } - }) - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md deleted file mode 100644 index 7240d8e..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Trace HTTP Requests and Responses - -`goproxy-httpdump` starts an HTTP proxy on :8080. It handles explicit CONNECT -requests and traces them in a "db" directory created in the proxy working -directory. Each request type and headers are logged in a "log" file, while -their bodies are dumped in files prefixed with the request session identifier. - -Additionally, the example demonstrates how to: -- Log information asynchronously (see HttpLogger) -- Allow the proxy to be stopped manually while ensuring all pending requests - have been processed (in this case, logged). - -Start it in one shell: - -```sh -goproxy-httpdump -``` - -Fetch goproxy homepage in another: - -```sh -http_proxy=http://127.0.0.1:8080 wget -O - \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -A "db" directory should have appeared where you started the proxy, containing -two files: -- log: the request/response traces -- 1\_resp: the first response body - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go deleted file mode 100644 index 62a9b88..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-httpdump/httpdump.go +++ /dev/null @@ -1,285 +0,0 @@ -package main - -import ( - "errors" - "flag" - "fmt" - "io" - "log" - "net" - "net/http" - "net/http/httputil" - "os" - "os/signal" - "path" - "sync" - "time" - - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/transport" -) - -type FileStream struct { - path string - f *os.File -} - -func NewFileStream(path string) *FileStream { - return &FileStream{path, nil} -} - -func (fs *FileStream) Write(b []byte) (nr int, err error) { - if fs.f == nil { - fs.f, err = os.Create(fs.path) - if err != nil { - return 0, err - } - } - return fs.f.Write(b) -} - -func (fs *FileStream) Close() error { - fmt.Println("Close", fs.path) - if fs.f == nil { - return errors.New("FileStream was never written into") - } - return fs.f.Close() -} - -type Meta struct { - req *http.Request - resp *http.Response - err error - t time.Time - sess int64 - bodyPath string - from string -} - -func fprintf(nr *int64, err *error, w io.Writer, pat string, a ...interface{}) { - if *err != nil { - return - } - var n int - n, *err = fmt.Fprintf(w, pat, a...) - *nr += int64(n) -} - -func write(nr *int64, err *error, w io.Writer, b []byte) { - if *err != nil { - return - } - var n int - n, *err = w.Write(b) - *nr += int64(n) -} - -func (m *Meta) WriteTo(w io.Writer) (nr int64, err error) { - if m.req != nil { - fprintf(&nr, &err, w, "Type: request\r\n") - } else if m.resp != nil { - fprintf(&nr, &err, w, "Type: response\r\n") - } - fprintf(&nr, &err, w, "ReceivedAt: %v\r\n", m.t) - fprintf(&nr, &err, w, "Session: %d\r\n", m.sess) - fprintf(&nr, &err, w, "From: %v\r\n", m.from) - if m.err != nil { - // note the empty response - fprintf(&nr, &err, w, "Error: %v\r\n\r\n\r\n\r\n", m.err) - } else if m.req != nil { - fprintf(&nr, &err, w, "\r\n") - buf, err2 := httputil.DumpRequest(m.req, false) - if err2 != nil { - return nr, err2 - } - write(&nr, &err, w, buf) - } else if m.resp != nil { - fprintf(&nr, &err, w, "\r\n") - buf, err2 := httputil.DumpResponse(m.resp, false) - if err2 != nil { - return nr, err2 - } - write(&nr, &err, w, buf) - } - return -} - -// HttpLogger is an asynchronous HTTP request/response logger. It traces -// requests and responses headers in a "log" file in logger directory and dumps -// their bodies in files prefixed with the session identifiers. -// Close it to ensure pending items are correctly logged. -type HttpLogger struct { - path string - c chan *Meta - errch chan error -} - -func NewLogger(basepath string) (*HttpLogger, error) { - f, err := os.Create(path.Join(basepath, "log")) - if err != nil { - return nil, err - } - logger := &HttpLogger{basepath, make(chan *Meta), make(chan error)} - go func() { - for m := range logger.c { - if _, err := m.WriteTo(f); err != nil { - log.Println("Can't write meta", err) - } - } - logger.errch <- f.Close() - }() - return logger, nil -} - -func (logger *HttpLogger) LogResp(resp *http.Response, ctx *goproxy.ProxyCtx) { - body := path.Join(logger.path, fmt.Sprintf("%d_resp", ctx.Session)) - from := "" - if ctx.UserData != nil { - from = ctx.UserData.(*transport.RoundTripDetails).TCPAddr.String() - } - if resp == nil { - resp = emptyResp - } else { - resp.Body = NewTeeReadCloser(resp.Body, NewFileStream(body)) - } - logger.LogMeta(&Meta{ - resp: resp, - err: ctx.Error, - t: time.Now(), - sess: ctx.Session, - from: from}) -} - -var emptyResp = &http.Response{} -var emptyReq = &http.Request{} - -func (logger *HttpLogger) LogReq(req *http.Request, ctx *goproxy.ProxyCtx) { - body := path.Join(logger.path, fmt.Sprintf("%d_req", ctx.Session)) - if req == nil { - req = emptyReq - } else { - req.Body = NewTeeReadCloser(req.Body, NewFileStream(body)) - } - logger.LogMeta(&Meta{ - req: req, - err: ctx.Error, - t: time.Now(), - sess: ctx.Session, - from: req.RemoteAddr}) -} - -func (logger *HttpLogger) LogMeta(m *Meta) { - logger.c <- m -} - -func (logger *HttpLogger) Close() error { - close(logger.c) - return <-logger.errch -} - -// TeeReadCloser extends io.TeeReader by allowing reader and writer to be -// closed. -type TeeReadCloser struct { - r io.Reader - w io.WriteCloser - c io.Closer -} - -func NewTeeReadCloser(r io.ReadCloser, w io.WriteCloser) io.ReadCloser { - return &TeeReadCloser{io.TeeReader(r, w), w, r} -} - -func (t *TeeReadCloser) Read(b []byte) (int, error) { - return t.r.Read(b) -} - -// Close attempts to close the reader and write. It returns an error if both -// failed to Close. -func (t *TeeReadCloser) Close() error { - err1 := t.c.Close() - err2 := t.w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -// stoppableListener serves stoppableConn and tracks their lifetime to notify -// when it is safe to terminate the application. -type stoppableListener struct { - net.Listener - sync.WaitGroup -} - -type stoppableConn struct { - net.Conn - wg *sync.WaitGroup -} - -func newStoppableListener(l net.Listener) *stoppableListener { - return &stoppableListener{l, sync.WaitGroup{}} -} - -func (sl *stoppableListener) Accept() (net.Conn, error) { - c, err := sl.Listener.Accept() - if err != nil { - return c, err - } - sl.Add(1) - return &stoppableConn{c, &sl.WaitGroup}, nil -} - -func (sc *stoppableConn) Close() error { - sc.wg.Done() - return sc.Conn.Close() -} - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("l", ":8080", "on which address should the proxy listen") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - if err := os.MkdirAll("db", 0755); err != nil { - log.Fatal("Can't create dir", err) - } - logger, err := NewLogger("db") - if err != nil { - log.Fatal("can't open log file", err) - } - tr := transport.Transport{Proxy: transport.ProxyFromEnvironment} - // For every incoming request, override the RoundTripper to extract - // connection information. Store it is session context log it after - // handling the response. - proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - ctx.RoundTripper = goproxy.RoundTripperFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (resp *http.Response, err error) { - ctx.UserData, resp, err = tr.DetailedRoundTrip(req) - return - }) - logger.LogReq(req, ctx) - return req, nil - }) - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - logger.LogResp(resp, ctx) - return resp - }) - l, err := net.Listen("tcp", *addr) - if err != nil { - log.Fatal("listen:", err) - } - sl := newStoppableListener(l) - ch := make(chan os.Signal) - signal.Notify(ch, os.Interrupt) - go func() { - <-ch - log.Println("Got SIGINT exiting") - sl.Add(1) - sl.Close() - logger.Close() - sl.Done() - }() - log.Println("Starting Proxy") - http.Serve(sl, proxy) - sl.Wait() - log.Println("All connections closed - exit") -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md deleted file mode 100644 index 6efba22..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Content Analysis - -`goproxy-jquery-version` starts an HTTP proxy on :8080. It checks HTML -responses, looks for scripts referencing jQuery library and emits warnings if -different versions of the library are being used for a given host. - -Start it in one shell: - -```sh -goproxy-jquery-version -``` - -Fetch goproxy homepage in another: - -```sh -http_proxy=http://127.0.0.1:8080 wget -O - \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -Goproxy homepage uses jQuery and a mix of plugins. First the proxy reports the -first use of jQuery it detects for the domain. Then, because the regular -expression matching the jQuery sources is imprecise, it reports a mismatch with -a plugin reference: - -```sh -2015/04/11 11:23:02 [001] WARN: ripper234.com uses //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js -2015/04/11 11:23:02 [001] WARN: In http://ripper234.com/p/introducing-goproxy-light-http-proxy/, \ - Contradicting jqueries //ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js \ - http://ripper234.wpengine.netdna-cdn.com/wp-content/plugins/wp-ajax-edit-comments/js/jquery.colorbox.min.js?ver=5.0.36 -``` - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html deleted file mode 100644 index 26771ce..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery1.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html deleted file mode 100644 index 7dce036..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery2.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html deleted file mode 100644 index 27dd0b3..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_homepage.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - jQuery: The Write Less, Do More, JavaScript Library - - - - - - - - - -
-
- - -
- -
- - - - - -
- -
- -
-

jQuery is a new kind of JavaScript Library.

-

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.

- -
- -
-

Grab the latest version!

-
-
- Choose your compression level: -
- - jquery-1.7.2.min.js - - - jquery-1.7.2.js - -
- -

Current Release: v1.7.2

-
-
- -
- - - - -
- -
-

Learn jQuery Now!

-

What does jQuery code look like? Here's the quick and dirty:

-
-
$("p.neat").addClass("ohmy").show("slow");
- Run Code - -

Congratulations! You just ran a snippet of jQuery code. Wasn't that easy? There's lots of example code throughout the documentation on this site. Be sure to give all the code a test run to see what happens.

-
-
- - - -
-

jQuery Resources

- - - -
- -
- -
-

Books About jQuery

- - - -
- - - -
- - - -
- - - - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_test.go deleted file mode 100644 index af300aa..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/jquery_test.go +++ /dev/null @@ -1,118 +0,0 @@ -package main - -import ( - "bytes" - "io/ioutil" - "log" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "testing" -) - -func equal(u, v []string) bool { - if len(u) != len(v) { - return false - } - for i, _ := range u { - if u[i] != v[i] { - return false - } - } - return true -} - -func readFile(fname string, t *testing.T) string { - b, err := ioutil.ReadFile(fname) - if err != nil { - t.Fatal("readFile", err) - } - return string(b) -} - -func TestDefectiveScriptParser(t *testing.T) { - if l := len(findScriptSrc(` - - - - - - - `)); l != 0 { - t.Fail() - } - urls := findScriptSrc(readFile("w3schools.html", t)) - if !equal(urls, []string{"http://partner.googleadservices.com/gampad/google_service.js", - "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"}) { - t.Error("w3schools.html", "src scripts are not recognized", urls) - } - urls = findScriptSrc(readFile("jquery_homepage.html", t)) - if !equal(urls, []string{"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", - "http://code.jquery.com/jquery-1.4.2.min.js", - "http://static.jquery.com/files/rocker/scripts/custom.js", - "http://static.jquery.com/donate/donate.js"}) { - t.Error("jquery_homepage.html", "src scripts are not recognized", urls) - } -} - -func proxyWithLog() (*http.Client, *bytes.Buffer) { - proxy := NewJqueryVersionProxy() - proxyServer := httptest.NewServer(proxy) - buf := new(bytes.Buffer) - proxy.Logger = log.New(buf, "", 0) - proxyUrl, _ := url.Parse(proxyServer.URL) - tr := &http.Transport{Proxy: http.ProxyURL(proxyUrl)} - client := &http.Client{Transport: tr} - return client, buf -} - -func get(t *testing.T, server *httptest.Server, client *http.Client, url string) { - resp, err := client.Get(server.URL + url) - if err != nil { - t.Fatal("cannot get proxy", err) - } - ioutil.ReadAll(resp.Body) - resp.Body.Close() -} - -func TestProxyServiceTwoVersions(t *testing.T) { - var fs = httptest.NewServer(http.FileServer(http.Dir("."))) - defer fs.Close() - - client, buf := proxyWithLog() - - get(t, fs, client, "/w3schools.html") - get(t, fs, client, "/php_man.html") - if buf.String() != "" && - !strings.Contains(buf.String(), " uses jquery ") { - t.Error("shouldn't warn on a single URL", buf.String()) - } - get(t, fs, client, "/jquery1.html") - warnings := buf.String() - if !strings.Contains(warnings, "http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js") || - !strings.Contains(warnings, "jquery.1.4.js") || - !strings.Contains(warnings, "Contradicting") { - t.Error("contradicting jquery versions (php_man.html, w3schools.html) does not issue warning", warnings) - } -} - -func TestProxyService(t *testing.T) { - var fs = httptest.NewServer(http.FileServer(http.Dir("."))) - defer fs.Close() - - client, buf := proxyWithLog() - - get(t, fs, client, "/jquery_homepage.html") - warnings := buf.String() - if !strings.Contains(warnings, "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js") || - !strings.Contains(warnings, "http://code.jquery.com/jquery-1.4.2.min.js") || - !strings.Contains(warnings, "Contradicting") { - t.Error("contradicting jquery versions does not issue warning") - } -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go deleted file mode 100644 index a92ddde..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/main.go +++ /dev/null @@ -1,64 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/html" - "log" - "net/http" - "regexp" -) - -var ( - // who said we can't parse HTML with regexp? - scriptMatcher = regexp.MustCompile(`(?i:]*\ssrc=["']([^"']*)["'])`) -) - -// findScripts returns all sources of HTML script tags found in input text. -func findScriptSrc(html string) []string { - srcs := make([]string, 0) - matches := scriptMatcher.FindAllStringIndex(html, -1) - for _, match := range matches { - // -1 to capture the whitespace at the end of the script tag - srcMatch := srcAttrMatcher.FindStringSubmatch(html[match[1]-1:]) - if srcMatch != nil { - srcs = append(srcs, srcMatch[1]) - } - } - return srcs -} - -// NewJQueryVersionProxy creates a proxy checking responses HTML content, looks -// for scripts referencing jQuery library and emits warnings if different -// versions of the library are being used for a given host. -func NewJqueryVersionProxy() *goproxy.ProxyHttpServer { - proxy := goproxy.NewProxyHttpServer() - m := make(map[string]string) - jqueryMatcher := regexp.MustCompile(`(?i:jquery\.)`) - proxy.OnResponse(goproxy_html.IsHtml).Do(goproxy_html.HandleString( - func(s string, ctx *goproxy.ProxyCtx) string { - for _, src := range findScriptSrc(s) { - if !jqueryMatcher.MatchString(src) { - continue - } - prev, ok := m[ctx.Req.Host] - if ok { - if prev != src { - ctx.Warnf("In %v, Contradicting jqueries %v %v", - ctx.Req.URL, prev, src) - break - } - } else { - ctx.Warnf("%s uses jquery %s", ctx.Req.Host, src) - m[ctx.Req.Host] = src - } - } - return s - })) - return proxy -} - -func main() { - proxy := NewJqueryVersionProxy() - log.Fatal(http.ListenAndServe(":8080", proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html deleted file mode 100644 index 1159d76..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/php_man.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - PHP: PHP Manual - Manual - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-

- - search for - - - in the - - - -

-
-
- -
-
- - - -
-
- -
- - - -   - -
- [edit] Last updated: Fri, 23 Mar 2012 -
-
-

view this page in

- -
-
-
- - -
-

PHP Manual

- - - -
-
- -
by:
- - Mehdi Achour - -
- - -
- - Friedhelm Betz - -
- - -
- - Antony Dovgal - -
- - -
- - Nuno Lopes - -
- - -
- - Hannes Magnusson - -
- - -
- - Georg Richter - -
- - -
- - Damien Seguy - -
- - -
- - Jakub Vrana - -
- - - -
- - - And several others - - -
- -
-
2012-03-23
- -
-
Edited By: - - Philip Olson - -
- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -


-
-
- add a note add a note - User Contributed Notes - PHP Manual -
-
There are no user contributed notes for this page.

-
-
 
-
- - - - - - - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html deleted file mode 100644 index ecf3a9d..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-jquery-version/w3schools.html +++ /dev/null @@ -1,1610 +0,0 @@ - - - - - - - - -HTML5 Tutorial - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -
- -
- - W3Schools.com - -
- - - -
- - - - - -
- - - - - -
- -
- -
- -
- -
- - HOME - - HTML - - CSS - - XML - - JAVASCRIPT - - ASP - - PHP - - SQL - - MORE... - -
- -
- - REFERENCES | - - EXAMPLES | - - FORUM | - - ABOUT - -
- -
- - - -
- - - - - - - - - - - - - -
- - - - - - - - - -
- -
- -

HTML5 Tutorial

- -HTML5 Home
- -HTML5 Introduction
- -HTML5 New Elements
- -HTML5 Video
- -HTML5 Video/DOM
- -HTML5 Audio
- -HTML5 Drag and Drop
- -HTML5 Canvas
- -HTML5 SVG
- -HTML5 Canvas vs. SVG
- -HTML5 Geolocation
- -HTML5 Web Storage
- -HTML5 App Cache
- -HTML5 Web Workers
- -HTML5 SSE
- -
- -

HTML5 Forms

- -HTML5 Input Types
- -HTML5 Form Elements
- -HTML5 Form Attributes
- -
- -

HTML5 Reference

- -HTML5 Tags
- -HTML5 Attributes
- -HTML5 Events
- -HTML5 Audio/Video
- -HTML5 Canvas 2d
- -HTML Valid DTDs
- -
- -

HTML5 Tags

- -<!-->
- -<!DOCTYPE>
- -<a>
- -<abbr>
- -<acronym>
- -<address>
- -<applet>
- -<area>
- -<article>
- -<aside>
- -<audio>
- -<b>
- -<base>
- -<basefont>
- -<bdi>
- -<bdo>
- -<big>
- -<blockquote>
- -<body>
- -<br>
- -<button>
- -<canvas>
- -<caption>
- -<center>
- -<cite>
- -<code>
- -<col>
- -<colgroup>
- -<command>
- -<datalist>
- -<dd>
- -<del>
- -<details>
- -<dfn>
- -<dir>
- -<div>
- -<dl>
- -<dt>
- -<em>
- -<embed>
- -<fieldset>
- -<figcaption>
- -<figure>
- -<font>
- -<footer>
- -<form>
- -<frame>
- -<frameset>
- -<h1> - <h6>
- -<head>
- -<header>
- -<hgroup>
- -<hr>
- -<html>
- -<i>
- -<iframe>
- -<img>
- -<input>
- -<ins>
- -<keygen>
- -<kbd>
- -<label>
- -<legend>
- -<li>
- -<link>
- -<map>
- -<mark>
- -<menu>
- -<meta>
- -<meter>
- -<nav>
- -<noframes>
- -<noscript>
- -<object>
- -<ol>
- -<optgroup>
- -<option>
- -<output>
- -<p>
- -<param>
- -<pre>
- -<progress>
- -<q>
- -<rp>
- -<rt>
- -<ruby>
- -<s>
- -<samp>
- -<script>
- -<section>
- -<select>
- -<small>
- -<source>
- -<span>
- -<strike>
- -<strong>
- -<style>
- -<sub>
- -<summary>
- -<sup>
- -<table>
- -<tbody>
- -<td>
- -<textarea>
- -<tfoot>
- -<th>
- -<thead>
- -<time>
- -<title>
- -<tr>
- -<track>
- -<tt>
- -<u>
- -<ul>
- -<var>
- -<video>
- -<wbr>
- -
- -
- - - -

HTML5 Tutorial

- - - -
- -
- -
HTML5 is The New HTML Standard
- -
- - - - - -
- - - - - - - - - - - -
- -
- -
- -

HTML5

- -
    - -
  • New Elements
  • - -
  • New Attributes
  • - -
  • Full CSS3 Support
  • - -
  • Video and Audio
  • - -
  • 2D/3D Graphics
  • - -
  • Local Storage
  • - -
  • Local SQL Database
  • - -
  • Web Applications
  • - -
- -
- - - - - - - - - - - - - - - - - - - -
- -
- -
    - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
- -
- -
- -
- -

Examples in Each Chapter

- -

With our HTML editor, you can edit the HTML, and click on a button to view the result.

- -
- -

Example

- -
- - <!DOCTYPE HTML>
- - <html>
- - <body>
- -
- - <video width="320" height="240" controls="controls">
- -  <source src="movie.mp4" type="video/mp4" />
- -  <source src="movie.ogg" type="video/ogg" />
- -  <source src="movie.webm" type="video/webm" />
- - Your browser does not support the video tag.
- - </video>
- -
- - </body>
- - </html> - -
- -
- - Try it yourself »
- -

Click on the "Try it yourself" button to see how it works

- -

Start learning HTML5 now!

- - - -

HTML5 References

- -

At W3Schools you will find complete references about tags, global attributes, - -standard events, and more.

- -

- -HTML5 Tag Reference - -

- - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - -
- - - -
- - - - - - - - - - - - - - - - - - - - - -
WEB HOSTING
- -Best Web Hosting - -
- -PHP MySQL Hosting - -
- -Best Hosting Coupons - -
- -UK Reseller Hosting - -
- -Cloud Hosting - -
- -Top Web Hosting - -
- -$3.98 Unlimited Hosting - -
- -Premium Website Design - -
- - - - - - - - - - - - - -
WEB BUILDING
- - - -Download XML Editor - - - -
- -FREE Website BUILDER - -
- -Free Website Templates - -Free CSS Templates - -
- -CREATE HTML Websites - -
- - - - - - - -
W3SCHOOLS EXAMS
- -Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
- -
- - - - - - - -
W3SCHOOLS BOOKS
- - - -New Books:
HTML, CSS
- -JavaScript, and Ajax
- -
- - - - - -
STATISTICS
- -Browser Statistics
- -Browser OS
- -Browser Display - -
- - - - - - - - - - - - - -
SHARE THIS PAGE
- - - -
- - - - - - - -

- -
- - - - - -
- -
- - - -
- -
- -
- -
- -
- - - -
- -
- - - - - - - - - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md deleted file mode 100644 index 23b5224..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Request Filtering - -`goproxy-no-reddit-at-work` starts an HTTP proxy on :8080. It denies requests -to "www.reddit.com" made between 8am to 5pm inclusive, local time. - -Start it in one shell: - -```sh -$ goproxy-no-reddit-at-work -``` - -Fetch reddit in another: - -```sh -$ http_proxy=http://127.0.0.1:8080 wget -O - http://www.reddit.com ---2015-04-11 16:59:01-- http://www.reddit.com/ -Connecting to 127.0.0.1:8080... connected. -Proxy request sent, awaiting response... 403 Forbidden -2015-04-11 16:59:01 ERROR 403: Forbidden. -``` - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go deleted file mode 100644 index b174845..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-no-reddit-at-worktime/noreddit.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "net/http" - "time" -) - -func main() { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.DstHostIs("www.reddit.com")).DoFunc( - func(r *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - h, _, _ := time.Now().Clock() - if h >= 8 && h <= 17 { - return r, goproxy.NewResponse(r, - goproxy.ContentTypeText, http.StatusForbidden, - "Don't waste your time!") - } else { - ctx.Warnf("clock: %d, you can waste your time...", h) - } - return r, nil - }) - log.Fatalln(http.ListenAndServe(":8080", proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go deleted file mode 100644 index 9135e57..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sokeepalive/sokeepalive.go +++ /dev/null @@ -1,25 +0,0 @@ -package main - -import ( - "flag" - "github.com/elazarl/goproxy" - "log" - "net" - "net/http" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.Tr.Dial = func(network, addr string) (c net.Conn, err error) { - c, err = net.Dial(network, addr) - if c, ok := c.(*net.TCPConn); err == nil && ok { - c.SetKeepAlive(true) - } - return - } - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go deleted file mode 100644 index b7e2dc9..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-sslstrip/sslstrip.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "log" - "flag" - "net/http" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - flag.Parse() - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - proxy.OnRequest().DoFunc(func (req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - if req.URL.Scheme == "https" { - req.URL.Scheme = "http" - } - return req, nil - }) - proxy.Verbose = *verbose - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md deleted file mode 100644 index a51d4c8..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Gather Browsing Statistics - -`goproxy-stats` starts an HTTP proxy on :8080, counts the bytes received for -web resources and prints the cumulative sum per URL every 20 seconds. - -Start it in one shell: - -```sh -goproxy-stats -``` - -Fetch goproxy homepage in another: - -```sh -mkdir tmp -cd tmp -http_proxy=http://127.0.0.1:8080 wget -r -l 1 -H \ - http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -``` - -Stop it after a moment. `goproxy-stats` should eventually print: -```sh -listening on :8080 -statistics -http://www.telerik.com/fiddler -> 84335 -http://msmvps.com/robots.txt -> 157 -http://eli.thegreenplace.net/robots.txt -> 294 -http://www.phdcomics.com/robots.txt -> 211 -http://resharper.blogspot.com/robots.txt -> 221 -http://idanz.blogli.co.il/robots.txt -> 271 -http://ripper234.com/p/introducing-goproxy-light-http-proxy/ -> 44407 -http://live.gnome.org/robots.txt -> 298 -http://ponetium.wordpress.com/robots.txt -> 178 -http://pilaheleg.blogli.co.il/robots.txt -> 321 -http://pilaheleg.wordpress.com/robots.txt -> 178 -http://blogli.co.il/ -> 9165 -http://nimrod-code.org/robots.txt -> 289 -http://www.joelonsoftware.com/robots.txt -> 1245 -http://top-performance.blogspot.com/robots.txt -> 227 -http://ooc-lang.org/robots.txt -> 345 -http://blogs.jetbrains.com/robots.txt -> 293 -``` - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go deleted file mode 100644 index e4cde8d..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-stats/main.go +++ /dev/null @@ -1,66 +0,0 @@ -package main - -import ( - "fmt" - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/html" - "io" - "log" - . "net/http" - "time" -) - -type Count struct { - Id string - Count int64 -} -type CountReadCloser struct { - Id string - R io.ReadCloser - ch chan<- Count - nr int64 -} - -func (c *CountReadCloser) Read(b []byte) (n int, err error) { - n, err = c.R.Read(b) - c.nr += int64(n) - return -} -func (c CountReadCloser) Close() error { - c.ch <- Count{c.Id, c.nr} - return c.R.Close() -} - -func main() { - proxy := goproxy.NewProxyHttpServer() - timer := make(chan bool) - ch := make(chan Count, 10) - go func() { - for { - time.Sleep(20 * time.Second) - timer <- true - } - }() - go func() { - m := make(map[string]int64) - for { - select { - case c := <-ch: - m[c.Id] = m[c.Id] + c.Count - case <-timer: - fmt.Printf("statistics\n") - for k, v := range m { - fmt.Printf("%s -> %d\n", k, v) - } - } - } - }() - - // IsWebRelatedText filters on html/javascript/css resources - proxy.OnResponse(goproxy_html.IsWebRelatedText).DoFunc(func(resp *Response, ctx *goproxy.ProxyCtx) *Response { - resp.Body = &CountReadCloser{ctx.Req.URL.String(), resp.Body, ch, 0} - return resp - }) - fmt.Printf("listening on :8080\n") - log.Fatal(ListenAndServe(":8080", proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md deleted file mode 100644 index 7edb098..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# Transparent Proxy - -This transparent example in goproxy is meant to show how to transparenty proxy and hijack all http and https connections while doing a man-in-the-middle to the TLS session. It requires that goproxy sees all the packets traversing out to the internet. Linux iptables rules deal with changing the source/destination IPs to act transparently, but you do need to setup your network configuration so that goproxy is a mandatory stop on the outgoing route. Primarily you can do this by placing the proxy inline. goproxy does not have any WCCP support itself; patches welcome. - -## Why not explicit? - -Transparent proxies are more difficult to maintain and setup from a server side, but they require no configuration on the client(s) which could be in unmanaged systems or systems that don't support a proxy configuration. See the [eavesdropper example](https://github.com/elazarl/goproxy/blob/master/examples/goproxy-eavesdropper/main.go) if you want to see an explicit proxy example. - -## Potential Issues - -Support for very old clients using HTTPS will fail. Clients need to send the SNI value in the TLS ClientHello which most modern clients do these days, but old clients will break. - -If you're routing table allows for it, an explicit http request to goproxy will cause it to fail in an endless loop since it will try to request resources from itself repeatedly. This could be solved in the goproxy code by looking up the hostnames, but it adds a delay that is much easier/faster to handle on the routing side. - -## Routing Rules - -Example routing rules are included in [proxy.sh](https://github.com/elazarl/goproxy/blob/master/examples/goproxy-transparent/proxy.sh) but are best when setup using your distribution's configuration. diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh deleted file mode 100644 index c631114..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/proxy.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# goproxy IP -GOPROXY_SERVER="10.10.10.1" -# goproxy port -GOPROXY_PORT="3129" -GOPROXY_PORT_TLS="3128" -# DO NOT MODIFY BELOW -# Load IPTABLES modules for NAT and IP conntrack support -modprobe ip_conntrack -modprobe ip_conntrack_ftp -echo 1 > /proc/sys/net/ipv4/ip_forward -echo 2 > /proc/sys/net/ipv4/conf/all/rp_filter - -# Clean old firewall -iptables -t nat -F -iptables -t nat -X -iptables -t mangle -F -iptables -t mangle -X - -# Write new rules -iptables -t nat -A PREROUTING -s $GOPROXY_SERVER -p tcp --dport $GOPROXY_PORT -j ACCEPT -iptables -t nat -A PREROUTING -s $GOPROXY_SERVER -p tcp --dport $GOPROXY_PORT_TLS -j ACCEPT -iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $GOPROXY_SERVER:$GOPROXY_PORT -iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination $GOPROXY_SERVER:$GOPROXY_PORT_TLS -# The following line supports using goproxy as an explicit proxy in addition -iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination $GOPROXY_SERVER:$GOPROXY_PORT -iptables -t nat -A POSTROUTING -j MASQUERADE -iptables -t mangle -A PREROUTING -p tcp --dport $GOPROXY_PORT -j DROP -iptables -t mangle -A PREROUTING -p tcp --dport $GOPROXY_PORT_TLS -j DROP diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go deleted file mode 100644 index b4134e2..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-transparent/transparent.go +++ /dev/null @@ -1,148 +0,0 @@ -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "log" - "net" - "net/http" - "net/url" - "regexp" - - "github.com/elazarl/goproxy" - "github.com/inconshreveable/go-vhost" -) - -func orPanic(err error) { - if err != nil { - panic(err) - } -} - -func main() { - verbose := flag.Bool("v", true, "should every proxy request be logged to stdout") - http_addr := flag.String("httpaddr", ":3129", "proxy http listen address") - https_addr := flag.String("httpsaddr", ":3128", "proxy https listen address") - flag.Parse() - - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - if proxy.Verbose { - log.Printf("Server starting up! - configured to listen on http interface %s and https interface %s", *http_addr, *https_addr) - } - - proxy.NonproxyHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - if req.Host == "" { - fmt.Fprintln(w, "Cannot handle requests without Host header, e.g., HTTP 1.0") - return - } - req.URL.Scheme = "http" - req.URL.Host = req.Host - proxy.ServeHTTP(w, req) - }) - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*$"))). - HandleConnect(goproxy.AlwaysMitm) - proxy.OnRequest(goproxy.ReqHostMatches(regexp.MustCompile("^.*:80$"))). - HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) { - defer func() { - if e := recover(); e != nil { - ctx.Logf("error connecting to remote: %v", e) - client.Write([]byte("HTTP/1.1 500 Cannot reach destination\r\n\r\n")) - } - client.Close() - }() - clientBuf := bufio.NewReadWriter(bufio.NewReader(client), bufio.NewWriter(client)) - remote, err := connectDial(proxy, "tcp", req.URL.Host) - orPanic(err) - remoteBuf := bufio.NewReadWriter(bufio.NewReader(remote), bufio.NewWriter(remote)) - for { - req, err := http.ReadRequest(clientBuf.Reader) - orPanic(err) - orPanic(req.Write(remoteBuf)) - orPanic(remoteBuf.Flush()) - resp, err := http.ReadResponse(remoteBuf.Reader, req) - orPanic(err) - orPanic(resp.Write(clientBuf.Writer)) - orPanic(clientBuf.Flush()) - } - }) - - go func() { - log.Fatalln(http.ListenAndServe(*http_addr, proxy)) - }() - - // listen to the TLS ClientHello but make it a CONNECT request instead - ln, err := net.Listen("tcp", *https_addr) - if err != nil { - log.Fatalf("Error listening for https connections - %v", err) - } - for { - c, err := ln.Accept() - if err != nil { - log.Printf("Error accepting new connection - %v", err) - continue - } - go func(c net.Conn) { - tlsConn, err := vhost.TLS(c) - if err != nil { - log.Printf("Error accepting new connection - %v", err) - } - if tlsConn.Host() == "" { - log.Printf("Cannot support non-SNI enabled clients") - return - } - connectReq := &http.Request{ - Method: "CONNECT", - URL: &url.URL{ - Opaque: tlsConn.Host(), - Host: net.JoinHostPort(tlsConn.Host(), "443"), - }, - Host: tlsConn.Host(), - Header: make(http.Header), - } - resp := dumbResponseWriter{tlsConn} - proxy.ServeHTTP(resp, connectReq) - }(c) - } -} - -// copied/converted from https.go -func dial(proxy *goproxy.ProxyHttpServer, network, addr string) (c net.Conn, err error) { - if proxy.Tr.Dial != nil { - return proxy.Tr.Dial(network, addr) - } - return net.Dial(network, addr) -} - -// copied/converted from https.go -func connectDial(proxy *goproxy.ProxyHttpServer, network, addr string) (c net.Conn, err error) { - if proxy.ConnectDial == nil { - return dial(proxy, network, addr) - } - return proxy.ConnectDial(network, addr) -} - -type dumbResponseWriter struct { - net.Conn -} - -func (dumb dumbResponseWriter) Header() http.Header { - panic("Header() should not be called on this ResponseWriter") -} - -func (dumb dumbResponseWriter) Write(buf []byte) (int, error) { - if bytes.Equal(buf, []byte("HTTP/1.0 200 OK\r\n\r\n")) { - return len(buf), nil // throw away the HTTP OK response from the faux CONNECT request - } - return dumb.Conn.Write(buf) -} - -func (dumb dumbResponseWriter) WriteHeader(code int) { - panic("WriteHeader() should not be called on this ResponseWriter") -} - -func (dumb dumbResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { - return dumb, bufio.NewReadWriter(bufio.NewReader(dumb), bufio.NewWriter(dumb)), nil -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go deleted file mode 100644 index 4b683fd..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-upside-down-ternet/main.go +++ /dev/null @@ -1,26 +0,0 @@ -package main - -import ( - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/image" - "image" - "log" - "net/http" -) - -func main() { - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse().Do(goproxy_image.HandleImage(func(img image.Image, ctx *goproxy.ProxyCtx) image.Image { - dx, dy := img.Bounds().Dx(), img.Bounds().Dy() - - nimg := image.NewRGBA(img.Bounds()) - for i := 0; i < dx; i++ { - for j := 0; j <= dy; j++ { - nimg.Set(i, j, img.At(i, dy-j-1)) - } - } - return nimg - })) - proxy.Verbose = true - log.Fatal(http.ListenAndServe(":8080", proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go deleted file mode 100644 index 0e7eadb..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/examples/goproxy-yui-minify/yui.go +++ /dev/null @@ -1,91 +0,0 @@ -// This example would minify standalone Javascript files (identified by their content type) -// using the command line utility YUI compressor http://yui.github.io/yuicompressor/ -// Example usage: -// -// ./yui -java /usr/local/bin/java -yuicompressor ~/Downloads/yuicompressor-2.4.8.jar -// $ curl -vx localhost:8080 http://golang.org/lib/godoc/godocs.js -// (function(){function g(){var u=$("#search");if(u.length===0){return}function t(){if(.... -// $ curl http://golang.org/lib/godoc/godocs.js | head -n 3 -// // Copyright 2012 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 main - -import ( - "flag" - "io" - "io/ioutil" - "log" - "net/http" - "os" - "os/exec" - "path" - "strings" - - "github.com/elazarl/goproxy" -) - -func main() { - verbose := flag.Bool("v", false, "should every proxy request be logged to stdout") - addr := flag.String("addr", ":8080", "proxy listen address") - java := flag.String("javapath", "java", "where the Java executable is located") - yuicompressor := flag.String("yuicompressor", "", "where the yuicompressor is located, assumed to be in CWD") - yuicompressordir := flag.String("yuicompressordir", ".", "a folder to search yuicompressor in, will be ignored if yuicompressor is set") - flag.Parse() - if *yuicompressor == "" { - files, err := ioutil.ReadDir(*yuicompressordir) - if err != nil { - log.Fatal("Cannot find yuicompressor jar") - } - for _, file := range files { - if strings.HasPrefix(file.Name(), "yuicompressor") && strings.HasSuffix(file.Name(), ".jar") { - c := path.Join(*yuicompressordir, file.Name()) - yuicompressor = &c - break - } - } - } - if *yuicompressor == "" { - log.Fatal("Can't find yuicompressor jar, searched yuicompressor*.jar in dir ", *yuicompressordir) - } - if _, err := os.Stat(*yuicompressor); os.IsNotExist(err) { - log.Fatal("Can't find yuicompressor jar specified ", *yuicompressor) - } - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = *verbose - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - contentType := resp.Header.Get("Content-Type") - if contentType == "application/javascript" || contentType == "application/x-javascript" { - // in real code, response should be streamed as well - var err error - cmd := exec.Command(*java, "-jar", *yuicompressor, "--type", "js") - cmd.Stdin = resp.Body - resp.Body, err = cmd.StdoutPipe() - if err != nil { - ctx.Warnf("Cannot minify content in %v: %v", ctx.Req.URL, err) - return goproxy.TextResponse(ctx.Req, "Error getting stdout pipe") - } - stderr, err := cmd.StderrPipe() - if err != nil { - ctx.Logf("Error obtaining stderr from yuicompress: %s", err) - return goproxy.TextResponse(ctx.Req, "Error getting stderr pipe") - } - if err := cmd.Start(); err != nil { - ctx.Warnf("Cannot minify content in %v: %v", ctx.Req.URL, err) - } - go func() { - defer stderr.Close() - const kb = 1024 - msg, err := ioutil.ReadAll(&io.LimitedReader{stderr, 50 * kb}) - if len(msg) != 0 { - ctx.Logf("Error executing yuicompress: %s", string(msg)) - } - if err != nil { - ctx.Logf("Error reading stderr from yuicompress: %s", string(msg)) - } - }() - } - return resp - }) - log.Fatal(http.ListenAndServe(*addr, proxy)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic.go deleted file mode 100644 index 2641423..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic.go +++ /dev/null @@ -1,76 +0,0 @@ -package auth - -import ( - "bytes" - "encoding/base64" - "io/ioutil" - "net/http" - "strings" - - "github.com/elazarl/goproxy" -) - -var unauthorizedMsg = []byte("407 Proxy Authentication Required") - -func BasicUnauthorized(req *http.Request, realm string) *http.Response { - // TODO(elazar): verify realm is well formed - return &http.Response{ - StatusCode: 407, - ProtoMajor: 1, - ProtoMinor: 1, - Request: req, - Header: http.Header{"Proxy-Authenticate": []string{"Basic realm=" + realm}}, - Body: ioutil.NopCloser(bytes.NewBuffer(unauthorizedMsg)), - ContentLength: int64(len(unauthorizedMsg)), - } -} - -var proxyAuthorizationHeader = "Proxy-Authorization" - -func auth(req *http.Request, f func(user, passwd string) bool) bool { - authheader := strings.SplitN(req.Header.Get(proxyAuthorizationHeader), " ", 2) - req.Header.Del(proxyAuthorizationHeader) - if len(authheader) != 2 || authheader[0] != "Basic" { - return false - } - userpassraw, err := base64.StdEncoding.DecodeString(authheader[1]) - if err != nil { - return false - } - userpass := strings.SplitN(string(userpassraw), ":", 2) - if len(userpass) != 2 { - return false - } - return f(userpass[0], userpass[1]) -} - -// Basic returns a basic HTTP authentication handler for requests -// -// You probably want to use auth.ProxyBasic(proxy) to enable authentication for all proxy activities -func Basic(realm string, f func(user, passwd string) bool) goproxy.ReqHandler { - return goproxy.FuncReqHandler(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - if !auth(req, f) { - return nil, BasicUnauthorized(req, realm) - } - return req, nil - }) -} - -// BasicConnect returns a basic HTTP authentication handler for CONNECT requests -// -// You probably want to use auth.ProxyBasic(proxy) to enable authentication for all proxy activities -func BasicConnect(realm string, f func(user, passwd string) bool) goproxy.HttpsHandler { - return goproxy.FuncHttpsHandler(func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) { - if !auth(ctx.Req, f) { - ctx.Resp = BasicUnauthorized(ctx.Req, realm) - return goproxy.RejectConnect, host - } - return goproxy.OkConnect, host - }) -} - -// ProxyBasic will force HTTP authentication before any request to the proxy is processed -func ProxyBasic(proxy *goproxy.ProxyHttpServer, realm string, f func(user, passwd string) bool) { - proxy.OnRequest().Do(Basic(realm, f)) - proxy.OnRequest().HandleConnect(BasicConnect(realm, f)) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic_test.go deleted file mode 100644 index 792d789..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/auth/basic_test.go +++ /dev/null @@ -1,175 +0,0 @@ -package auth_test - -import ( - "encoding/base64" - "io" - "io/ioutil" - "net" - "net/http" - "net/http/httptest" - "net/url" - "os" - "os/exec" - "os/signal" - "sync/atomic" - "testing" - - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/auth" -) - -type ConstantHanlder string - -func (h ConstantHanlder) ServeHTTP(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, string(h)) -} - -func oneShotProxy(proxy *goproxy.ProxyHttpServer) (client *http.Client, s *httptest.Server) { - s = httptest.NewServer(proxy) - - proxyUrl, _ := url.Parse(s.URL) - tr := &http.Transport{Proxy: http.ProxyURL(proxyUrl)} - client = &http.Client{Transport: tr} - return -} - -func times(n int, s string) string { - r := make([]byte, 0, n*len(s)) - for i := 0; i < n; i++ { - r = append(r, s...) - } - return string(r) -} - -func TestBasicConnectAuthWithCurl(t *testing.T) { - expected := ":c>" - background := httptest.NewTLSServer(ConstantHanlder(expected)) - defer background.Close() - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(auth.BasicConnect("my_realm", func(user, passwd string) bool { - return user == "user" && passwd == "open sesame" - })) - _, proxyserver := oneShotProxy(proxy) - defer proxyserver.Close() - - cmd := exec.Command("curl", - "--silent", "--show-error", "--insecure", - "-x", proxyserver.URL, - "-U", "user:open sesame", - "-p", - "--url", background.URL+"/[1-3]", - ) - out, err := cmd.CombinedOutput() // if curl got error, it'll show up in stderr - if err != nil { - t.Fatal(err, string(out)) - } - finalexpected := times(3, expected) - if string(out) != finalexpected { - t.Error("Expected", finalexpected, "got", string(out)) - } -} - -func TestBasicAuthWithCurl(t *testing.T) { - expected := ":c>" - background := httptest.NewServer(ConstantHanlder(expected)) - defer background.Close() - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().Do(auth.Basic("my_realm", func(user, passwd string) bool { - return user == "user" && passwd == "open sesame" - })) - _, proxyserver := oneShotProxy(proxy) - defer proxyserver.Close() - - cmd := exec.Command("curl", - "--silent", "--show-error", - "-x", proxyserver.URL, - "-U", "user:open sesame", - "--url", background.URL+"/[1-3]", - ) - out, err := cmd.CombinedOutput() // if curl got error, it'll show up in stderr - if err != nil { - t.Fatal(err, string(out)) - } - finalexpected := times(3, expected) - if string(out) != finalexpected { - t.Error("Expected", finalexpected, "got", string(out)) - } -} - -func TestBasicAuth(t *testing.T) { - expected := "hello" - background := httptest.NewServer(ConstantHanlder(expected)) - defer background.Close() - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().Do(auth.Basic("my_realm", func(user, passwd string) bool { - return user == "user" && passwd == "open sesame" - })) - client, proxyserver := oneShotProxy(proxy) - defer proxyserver.Close() - - // without auth - resp, err := client.Get(background.URL) - if err != nil { - t.Fatal(err) - } - if resp.Header.Get("Proxy-Authenticate") != "Basic realm=my_realm" { - t.Error("Expected Proxy-Authenticate header got", resp.Header.Get("Proxy-Authenticate")) - } - if resp.StatusCode != 407 { - t.Error("Expected status 407 Proxy Authentication Required, got", resp.Status) - } - - // with auth - req, err := http.NewRequest("GET", background.URL, nil) - if err != nil { - t.Fatal(err) - } - req.Header.Set("Proxy-Authorization", - "Basic "+base64.StdEncoding.EncodeToString([]byte("user:open sesame"))) - resp, err = client.Do(req) - if err != nil { - t.Fatal(err) - } - if resp.StatusCode != 200 { - t.Error("Expected status 200 OK, got", resp.Status) - } - msg, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal(err) - } - if string(msg) != "hello" { - t.Errorf("Expected '%s', actual '%s'", expected, string(msg)) - } -} - -func TestWithBrowser(t *testing.T) { - // an easy way to check if auth works with webserver - // to test, run with - // $ go test -run TestWithBrowser -- server - // configure a browser to use the printed proxy address, use the proxy - // and exit with Ctrl-C. It will throw error if your haven't acutally used the proxy - if os.Args[len(os.Args)-1] != "server" { - return - } - proxy := goproxy.NewProxyHttpServer() - println("proxy localhost port 8082") - access := int32(0) - proxy.OnRequest().Do(auth.Basic("my_realm", func(user, passwd string) bool { - atomic.AddInt32(&access, 1) - return user == "user" && passwd == "1234" - })) - l, err := net.Listen("tcp", "localhost:8082") - if err != nil { - t.Fatal(err) - } - ch := make(chan os.Signal) - signal.Notify(ch, os.Interrupt) - go func() { - <-ch - l.Close() - }() - http.Serve(l, proxy) - if access <= 0 { - t.Error("No one accessed the proxy") - } -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html deleted file mode 100644 index 6bf33e8..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - -ãó äáéú ùì ùä"í - - - - - - - - - - - - - - - - - -
- - -
- -
- - - -
-
- - -rss -
- -
- - - - -
-
-
-  àúøé 2012á ðôúçå ìñèåãðèéí. öååú ùä"í îàçì ìëí ñîñèø îåöìç. -(4.3.12) -
-
- - - - - - -
- - -
-
- -
- - -
- - -
- - - - - - - diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt deleted file mode 100644 index ef904ce..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/cp1255.txt +++ /dev/null @@ -1 +0,0 @@ -ãó \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html.go deleted file mode 100644 index e8397aa..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html.go +++ /dev/null @@ -1,104 +0,0 @@ -// extension to goproxy that will allow you to easily filter web browser related content. -package goproxy_html - -import ( - "bytes" - "errors" - "io" - "io/ioutil" - "net/http" - "strings" - - "github.com/rogpeppe/go-charset/charset" - _ "github.com/rogpeppe/go-charset/data" - "github.com/elazarl/goproxy" -) - -var IsHtml goproxy.RespCondition = goproxy.ContentTypeIs("text/html") - -var IsCss goproxy.RespCondition = goproxy.ContentTypeIs("text/css") - -var IsJavaScript goproxy.RespCondition = goproxy.ContentTypeIs("text/javascript", - "application/javascript") - -var IsJson goproxy.RespCondition = goproxy.ContentTypeIs("text/json") - -var IsXml goproxy.RespCondition = goproxy.ContentTypeIs("text/xml") - -var IsWebRelatedText goproxy.RespCondition = goproxy.ContentTypeIs("text/html", - "text/css", - "text/javascript", "application/javascript", - "text/xml", - "text/json") - -// HandleString will receive a function that filters a string, and will convert the -// request body to a utf8 string, according to the charset specified in the Content-Type -// header. -// guessing Html charset encoding from the tags is not yet implemented. -func HandleString(f func(s string, ctx *goproxy.ProxyCtx) string) goproxy.RespHandler { - return HandleStringReader(func(r io.Reader, ctx *goproxy.ProxyCtx) io.Reader { - b, err := ioutil.ReadAll(r) - if err != nil { - ctx.Warnf("Cannot read string from resp body: %v", err) - return r - } - return bytes.NewBufferString(f(string(b), ctx)) - }) -} - -// Will receive an input stream which would convert the response to utf-8 -// The given function must close the reader r, in order to close the response body. -func HandleStringReader(f func(r io.Reader, ctx *goproxy.ProxyCtx) io.Reader) goproxy.RespHandler { - return goproxy.FuncRespHandler(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - if ctx.Error != nil { - return nil - } - charsetName := ctx.Charset() - if charsetName == "" { - charsetName = "utf-8" - } - - if strings.ToLower(charsetName) != "utf-8" { - r, err := charset.NewReader(charsetName, resp.Body) - if err != nil { - ctx.Warnf("Cannot convert from %v to utf-8: %v", charsetName, err) - return resp - } - tr, err := charset.TranslatorTo(charsetName) - if err != nil { - ctx.Warnf("Can't translate to %v from utf-8: %v", charsetName, err) - return resp - } - if err != nil { - ctx.Warnf("Cannot translate to %v: %v", charsetName, err) - return resp - } - newr := charset.NewTranslatingReader(f(r, ctx), tr) - resp.Body = &readFirstCloseBoth{ioutil.NopCloser(newr), resp.Body} - } else { - //no translation is needed, already at utf-8 - resp.Body = &readFirstCloseBoth{ioutil.NopCloser(f(resp.Body, ctx)), resp.Body} - } - return resp - }) -} - -type readFirstCloseBoth struct { - r io.ReadCloser - c io.Closer -} - -func (rfcb *readFirstCloseBoth) Read(b []byte) (nr int, err error) { - return rfcb.r.Read(b) -} -func (rfcb *readFirstCloseBoth) Close() error { - err1 := rfcb.r.Close() - err2 := rfcb.c.Close() - if err1 != nil && err2 != nil { - return errors.New(err1.Error() + ", " + err2.Error()) - } - if err1 != nil { - return err1 - } - return err2 -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html_test.go deleted file mode 100644 index 9c876f7..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/html/html_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package goproxy_html_test - -import ( - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/html" - "io/ioutil" - "net/http" - "net/http/httptest" - "net/url" - "testing" -) - -type ConstantServer int - -func (s ConstantServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain; charset=iso-8859-8") - //w.Header().Set("Content-Type","text/plain; charset=cp-1255") - w.Write([]byte{0xe3, 0xf3}) -} - -func TestCharset(t *testing.T) { - s := httptest.NewServer(ConstantServer(1)) - defer s.Close() - - ch := make(chan string, 2) - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse().Do(goproxy_html.HandleString( - func(s string, ctx *goproxy.ProxyCtx) string { - ch <- s - return s - })) - proxyServer := httptest.NewServer(proxy) - defer proxyServer.Close() - - proxyUrl, _ := url.Parse(proxyServer.URL) - client := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyUrl)}} - - resp, err := client.Get(s.URL + "/cp1255.txt") - if err != nil { - t.Fatal("GET:", err) - } - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal("readAll:", err) - } - resp.Body.Close() - - inHandleString := "" - select { - case inHandleString = <-ch: - default: - } - - if len(b) != 2 || b[0] != 0xe3 || b[1] != 0xf3 { - t.Error("Did not translate back to 0xe3,0xf3, instead", b) - } - if inHandleString != "דף" { - t.Error("HandleString did not convert DALET & PEH SOFIT (דף) from ISO-8859-8 to utf-8, got", []byte(inHandleString)) - } -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/image/image.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/image/image.go deleted file mode 100644 index 3dc26ff..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/ext/image/image.go +++ /dev/null @@ -1,78 +0,0 @@ -package goproxy_image - -import ( - "bytes" - "image" - _ "image/gif" - "image/jpeg" - "image/png" - "io/ioutil" - "net/http" - . "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/regretable" -) - -var RespIsImage = ContentTypeIs("image/gif", - "image/jpeg", - "image/pjpeg", - "application/octet-stream", - "image/png") - -// "image/tiff" tiff support is in external package, and rarely used, so we omitted it - -func HandleImage(f func(img image.Image, ctx *ProxyCtx) image.Image) RespHandler { - return FuncRespHandler(func(resp *http.Response, ctx *ProxyCtx) *http.Response { - if !RespIsImage.HandleResp(resp, ctx) { - return resp - } - if resp.StatusCode != 200 { - // we might get 304 - not modified response without data - return resp - } - contentType := resp.Header.Get("Content-Type") - - const kb = 1024 - regret := regretable.NewRegretableReaderCloserSize(resp.Body, 16*kb) - resp.Body = regret - img, imgType, err := image.Decode(resp.Body) - if err != nil { - regret.Regret() - ctx.Warnf("%s: %s", ctx.Req.Method+" "+ctx.Req.URL.String()+" Image from "+ctx.Req.RequestURI+"content type"+ - contentType+"cannot be decoded returning original image", err) - return resp - } - result := f(img, ctx) - buf := bytes.NewBuffer([]byte{}) - switch contentType { - // No gif image encoder in go - convert to png - case "image/gif", "image/png": - if err := png.Encode(buf, result); err != nil { - ctx.Warnf("Cannot encode image, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - resp.Header.Set("Content-Type", "image/png") - case "image/jpeg", "image/pjpeg": - if err := jpeg.Encode(buf, result, nil); err != nil { - ctx.Warnf("Cannot encode image, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - case "application/octet-stream": - switch imgType { - case "jpeg": - if err := jpeg.Encode(buf, result, nil); err != nil { - ctx.Warnf("Cannot encode image as jpeg, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - case "png", "gif": - if err := png.Encode(buf, result); err != nil { - ctx.Warnf("Cannot encode image as png, returning orig %v %v", ctx.Req.URL.String(), err) - return resp - } - } - default: - panic("unhandlable type" + contentType) - } - resp.Body = ioutil.NopCloser(buf) - return resp - }) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/proxy_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/proxy_test.go deleted file mode 100644 index 45c5755..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/proxy_test.go +++ /dev/null @@ -1,836 +0,0 @@ -package goproxy_test - -import ( - "bufio" - "bytes" - "crypto/tls" - "crypto/x509" - "encoding/base64" - "image" - "io" - "io/ioutil" - "net" - "net/http" - "net/http/httptest" - "net/url" - "os" - "os/exec" - "strings" - "testing" - - "github.com/elazarl/goproxy" - "github.com/elazarl/goproxy/ext/image" -) - -var acceptAllCerts = &tls.Config{InsecureSkipVerify: true} - -var noProxyClient = &http.Client{Transport: &http.Transport{TLSClientConfig: acceptAllCerts}} - -var https = httptest.NewTLSServer(nil) -var srv = httptest.NewServer(nil) -var fs = httptest.NewServer(http.FileServer(http.Dir("."))) - -type QueryHandler struct{} - -func (QueryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - if err := req.ParseForm(); err != nil { - panic(err) - } - io.WriteString(w, req.Form.Get("result")) -} - -func init() { - http.DefaultServeMux.Handle("/bobo", ConstantHanlder("bobo")) - http.DefaultServeMux.Handle("/query", QueryHandler{}) -} - -type ConstantHanlder string - -func (h ConstantHanlder) ServeHTTP(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, string(h)) -} - -func get(url string, client *http.Client) ([]byte, error) { - resp, err := client.Get(url) - if err != nil { - return nil, err - } - txt, err := ioutil.ReadAll(resp.Body) - defer resp.Body.Close() - if err != nil { - return nil, err - } - return txt, nil -} - -func getOrFail(url string, client *http.Client, t *testing.T) []byte { - txt, err := get(url, client) - if err != nil { - t.Fatal("Can't fetch url", url, err) - } - return txt -} - -func localFile(url string) string { return fs.URL + "/" + url } -func localTls(url string) string { return https.URL + url } - -func TestSimpleHttpReqWithProxy(t *testing.T) { - client, s := oneShotProxy(goproxy.NewProxyHttpServer(), t) - defer s.Close() - - if r := string(getOrFail(srv.URL+"/bobo", client, t)); r != "bobo" { - t.Error("proxy server does not serve constant handlers", r) - } - if r := string(getOrFail(srv.URL+"/bobo", client, t)); r != "bobo" { - t.Error("proxy server does not serve constant handlers", r) - } - - if string(getOrFail(https.URL+"/bobo", client, t)) != "bobo" { - t.Error("TLS server does not serve constant handlers, when proxy is used") - } -} - -func oneShotProxy(proxy *goproxy.ProxyHttpServer, t *testing.T) (client *http.Client, s *httptest.Server) { - s = httptest.NewServer(proxy) - - proxyUrl, _ := url.Parse(s.URL) - tr := &http.Transport{TLSClientConfig: acceptAllCerts, Proxy: http.ProxyURL(proxyUrl)} - client = &http.Client{Transport: tr} - return -} - -func TestSimpleHook(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.SrcIpIs("127.0.0.1")).DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - req.URL.Path = "/bobo" - return req, nil - }) - client, l := oneShotProxy(proxy, t) - defer l.Close() - - if result := string(getOrFail(srv.URL+("/momo"), client, t)); result != "bobo" { - t.Error("Redirecting all requests from 127.0.0.1 to bobo, didn't work." + - " (Might break if Go's client sets RemoteAddr to IPv6 address). Got: " + - result) - } -} - -func TestAlwaysHook(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - req.URL.Path = "/bobo" - return req, nil - }) - client, l := oneShotProxy(proxy, t) - defer l.Close() - - if result := string(getOrFail(srv.URL+("/momo"), client, t)); result != "bobo" { - t.Error("Redirecting all requests from 127.0.0.1 to bobo, didn't work." + - " (Might break if Go's client sets RemoteAddr to IPv6 address). Got: " + - result) - } -} - -func TestReplaceResponse(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - resp.StatusCode = http.StatusOK - resp.Body = ioutil.NopCloser(bytes.NewBufferString("chico")) - return resp - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - if result := string(getOrFail(srv.URL+("/momo"), client, t)); result != "chico" { - t.Error("hooked response, should be chico, instead:", result) - } -} - -func TestReplaceReponseForUrl(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse(goproxy.UrlIs("/koko")).DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - resp.StatusCode = http.StatusOK - resp.Body = ioutil.NopCloser(bytes.NewBufferString("chico")) - return resp - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - if result := string(getOrFail(srv.URL+("/koko"), client, t)); result != "chico" { - t.Error("hooked 'koko', should be chico, instead:", result) - } - if result := string(getOrFail(srv.URL+("/bobo"), client, t)); result != "bobo" { - t.Error("still, bobo should stay as usual, instead:", result) - } -} - -func TestOneShotFileServer(t *testing.T) { - client, l := oneShotProxy(goproxy.NewProxyHttpServer(), t) - defer l.Close() - - file := "test_data/panda.png" - info, err := os.Stat(file) - if err != nil { - t.Fatal("Cannot find", file) - } - if resp, err := client.Get(fs.URL + "/" + file); err == nil { - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatal("got", string(b)) - } - if int64(len(b)) != info.Size() { - t.Error("Expected Length", file, info.Size(), "actually", len(b), "starts", string(b[:10])) - } - } else { - t.Fatal("Cannot read from fs server", err) - } -} - -func TestContentType(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse(goproxy.ContentTypeIs("image/png")).DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - resp.Header.Set("X-Shmoopi", "1") - return resp - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - for _, file := range []string{"test_data/panda.png", "test_data/football.png"} { - if resp, err := client.Get(localFile(file)); err != nil || resp.Header.Get("X-Shmoopi") != "1" { - if err == nil { - t.Error("pngs should have X-Shmoopi header = 1, actually", resp.Header.Get("X-Shmoopi")) - } else { - t.Error("error reading png", err) - } - } - } - - file := "baby.jpg" - if resp, err := client.Get(localFile(file)); err != nil || resp.Header.Get("X-Shmoopi") != "" { - if err == nil { - t.Error("Non png images should NOT have X-Shmoopi header at all", resp.Header.Get("X-Shmoopi")) - } else { - t.Error("error reading png", err) - } - } -} - -func getImage(file string, t *testing.T) image.Image { - newimage, err := ioutil.ReadFile(file) - if err != nil { - t.Fatal("Cannot read file", file, err) - } - img, _, err := image.Decode(bytes.NewReader(newimage)) - if err != nil { - t.Fatal("Cannot decode image", file, err) - } - return img -} - -func readAll(r io.Reader, t *testing.T) []byte { - b, err := ioutil.ReadAll(r) - if err != nil { - t.Fatal("Cannot read", err) - } - return b -} -func readFile(file string, t *testing.T) []byte { - b, err := ioutil.ReadFile(file) - if err != nil { - t.Fatal("Cannot read", err) - } - return b -} -func fatalOnErr(err error, msg string, t *testing.T) { - if err != nil { - t.Fatal(msg, err) - } -} -func panicOnErr(err error, msg string) { - if err != nil { - println(err.Error() + ":-" + msg) - os.Exit(-1) - } -} - -func compareImage(eImg, aImg image.Image, t *testing.T) { - if eImg.Bounds().Dx() != aImg.Bounds().Dx() || eImg.Bounds().Dy() != aImg.Bounds().Dy() { - t.Error("image sizes different") - return - } - for i := 0; i < eImg.Bounds().Dx(); i++ { - for j := 0; j < eImg.Bounds().Dy(); j++ { - er, eg, eb, ea := eImg.At(i, j).RGBA() - ar, ag, ab, aa := aImg.At(i, j).RGBA() - if er != ar || eg != ag || eb != ab || ea != aa { - t.Error("images different at", i, j, "vals\n", er, eg, eb, ea, "\n", ar, ag, ab, aa, aa) - return - } - } - } -} - -func TestConstantImageHandler(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - //panda := getImage("panda.png", t) - football := getImage("test_data/football.png", t) - proxy.OnResponse().Do(goproxy_image.HandleImage(func(img image.Image, ctx *goproxy.ProxyCtx) image.Image { - return football - })) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - resp, err := client.Get(localFile("test_data/panda.png")) - if err != nil { - t.Fatal("Cannot get panda.png", err) - } - - img, _, err := image.Decode(resp.Body) - if err != nil { - t.Error("decode", err) - } else { - compareImage(football, img, t) - } -} - -func TestImageHandler(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - football := getImage("test_data/football.png", t) - - proxy.OnResponse(goproxy.UrlIs("/test_data/panda.png")).Do(goproxy_image.HandleImage(func(img image.Image, ctx *goproxy.ProxyCtx) image.Image { - return football - })) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - resp, err := client.Get(localFile("test_data/panda.png")) - if err != nil { - t.Fatal("Cannot get panda.png", err) - } - - img, _, err := image.Decode(resp.Body) - if err != nil { - t.Error("decode", err) - } else { - compareImage(football, img, t) - } - - // and again - resp, err = client.Get(localFile("test_data/panda.png")) - if err != nil { - t.Fatal("Cannot get panda.png", err) - } - - img, _, err = image.Decode(resp.Body) - if err != nil { - t.Error("decode", err) - } else { - compareImage(football, img, t) - } -} - -func TestChangeResp(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - resp.Body.Read([]byte{0}) - resp.Body = ioutil.NopCloser(new(bytes.Buffer)) - return resp - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - resp, err := client.Get(localFile("test_data/panda.png")) - if err != nil { - t.Fatal(err) - } - ioutil.ReadAll(resp.Body) - _, err = client.Get(localFile("/bobo")) - if err != nil { - t.Fatal(err) - } -} -func TestReplaceImage(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - - panda := getImage("test_data/panda.png", t) - football := getImage("test_data/football.png", t) - - proxy.OnResponse(goproxy.UrlIs("/test_data/panda.png")).Do(goproxy_image.HandleImage(func(img image.Image, ctx *goproxy.ProxyCtx) image.Image { - return football - })) - proxy.OnResponse(goproxy.UrlIs("/test_data/football.png")).Do(goproxy_image.HandleImage(func(img image.Image, ctx *goproxy.ProxyCtx) image.Image { - return panda - })) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - imgByPandaReq, _, err := image.Decode(bytes.NewReader(getOrFail(localFile("test_data/panda.png"), client, t))) - fatalOnErr(err, "decode panda", t) - compareImage(football, imgByPandaReq, t) - - imgByFootballReq, _, err := image.Decode(bytes.NewReader(getOrFail(localFile("test_data/football.png"), client, t))) - fatalOnErr(err, "decode football", t) - compareImage(panda, imgByFootballReq, t) -} - -func getCert(c *tls.Conn, t *testing.T) []byte { - if err := c.Handshake(); err != nil { - t.Fatal("cannot handshake", err) - } - return c.ConnectionState().PeerCertificates[0].Raw -} - -func TestSimpleMitm(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.ReqHostIs(https.Listener.Addr().String())).HandleConnect(goproxy.AlwaysMitm) - proxy.OnRequest(goproxy.ReqHostIs("no such host exists")).HandleConnect(goproxy.AlwaysMitm) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - c, err := tls.Dial("tcp", https.Listener.Addr().String(), &tls.Config{InsecureSkipVerify: true}) - if err != nil { - t.Fatal("cannot dial to tcp server", err) - } - origCert := getCert(c, t) - c.Close() - - c2, err := net.Dial("tcp", l.Listener.Addr().String()) - if err != nil { - t.Fatal("dialing to proxy", err) - } - creq, err := http.NewRequest("CONNECT", https.URL, nil) - //creq,err := http.NewRequest("CONNECT","https://google.com:443",nil) - if err != nil { - t.Fatal("create new request", creq) - } - creq.Write(c2) - c2buf := bufio.NewReader(c2) - resp, err := http.ReadResponse(c2buf, creq) - if err != nil || resp.StatusCode != 200 { - t.Fatal("Cannot CONNECT through proxy", err) - } - c2tls := tls.Client(c2, &tls.Config{InsecureSkipVerify: true}) - proxyCert := getCert(c2tls, t) - - if bytes.Equal(proxyCert, origCert) { - t.Errorf("Certificate after mitm is not different\n%v\n%v", - base64.StdEncoding.EncodeToString(origCert), - base64.StdEncoding.EncodeToString(proxyCert)) - } - - if resp := string(getOrFail(https.URL+"/bobo", client, t)); resp != "bobo" { - t.Error("Wrong response when mitm", resp, "expected bobo") - } - if resp := string(getOrFail(https.URL+"/query?result=bar", client, t)); resp != "bar" { - t.Error("Wrong response when mitm", resp, "expected bar") - } -} - -func TestConnectHandler(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - althttps := httptest.NewTLSServer(ConstantHanlder("althttps")) - proxy.OnRequest().HandleConnectFunc(func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) { - u, _ := url.Parse(althttps.URL) - return goproxy.OkConnect, u.Host - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - if resp := string(getOrFail(https.URL+"/alturl", client, t)); resp != "althttps" { - t.Error("Proxy should redirect CONNECT requests to local althttps server, expected 'althttps' got ", resp) - } -} - -func TestMitmIsFiltered(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - //proxy.Verbose = true - proxy.OnRequest(goproxy.ReqHostIs(https.Listener.Addr().String())).HandleConnect(goproxy.AlwaysMitm) - proxy.OnRequest(goproxy.UrlIs("/momo")).DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - return nil, goproxy.TextResponse(req, "koko") - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - if resp := string(getOrFail(https.URL+"/momo", client, t)); resp != "koko" { - t.Error("Proxy should capture /momo to be koko and not", resp) - } - - if resp := string(getOrFail(https.URL+"/bobo", client, t)); resp != "bobo" { - t.Error("But still /bobo should be bobo and not", resp) - } -} - -func TestFirstHandlerMatches(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - return nil, goproxy.TextResponse(req, "koko") - }) - proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - panic("should never get here, previous response is no null") - }) - - client, l := oneShotProxy(proxy, t) - defer l.Close() - - if resp := string(getOrFail(srv.URL+"/", client, t)); resp != "koko" { - t.Error("should return always koko and not", resp) - } -} - -func constantHttpServer(content []byte) (addr string) { - l, err := net.Listen("tcp", "localhost:0") - panicOnErr(err, "listen") - go func() { - c, err := l.Accept() - panicOnErr(err, "accept") - buf := bufio.NewReader(c) - _, err = http.ReadRequest(buf) - panicOnErr(err, "readReq") - c.Write(content) - c.Close() - l.Close() - }() - return l.Addr().String() -} - -func TestIcyResponse(t *testing.T) { - // TODO: fix this test - return // skip for now - s := constantHttpServer([]byte("ICY 200 OK\r\n\r\nblablabla")) - proxy := goproxy.NewProxyHttpServer() - proxy.Verbose = true - _, l := oneShotProxy(proxy, t) - defer l.Close() - req, err := http.NewRequest("GET", "http://"+s, nil) - panicOnErr(err, "newReq") - proxyip := l.URL[len("http://"):] - println("got ip: " + proxyip) - c, err := net.Dial("tcp", proxyip) - panicOnErr(err, "dial") - defer c.Close() - req.WriteProxy(c) - raw, err := ioutil.ReadAll(c) - panicOnErr(err, "readAll") - if string(raw) != "ICY 200 OK\r\n\r\nblablabla" { - t.Error("Proxy did not send the malformed response received") - } -} - -type VerifyNoProxyHeaders struct { - *testing.T -} - -func (v VerifyNoProxyHeaders) ServeHTTP(w http.ResponseWriter, r *http.Request) { - if r.Header.Get("Connection") != "" || r.Header.Get("Proxy-Connection") != "" || - r.Header.Get("Proxy-Authenticate") != "" || r.Header.Get("Proxy-Authorization") != "" { - v.Error("Got Connection header from goproxy", r.Header) - } -} - -func TestNoProxyHeaders(t *testing.T) { - s := httptest.NewServer(VerifyNoProxyHeaders{t}) - client, l := oneShotProxy(goproxy.NewProxyHttpServer(), t) - defer l.Close() - req, err := http.NewRequest("GET", s.URL, nil) - panicOnErr(err, "bad request") - req.Header.Add("Connection", "close") - req.Header.Add("Proxy-Connection", "close") - req.Header.Add("Proxy-Authenticate", "auth") - req.Header.Add("Proxy-Authorization", "auth") - client.Do(req) -} - -func TestNoProxyHeadersHttps(t *testing.T) { - s := httptest.NewTLSServer(VerifyNoProxyHeaders{t}) - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - client, l := oneShotProxy(proxy, t) - defer l.Close() - req, err := http.NewRequest("GET", s.URL, nil) - panicOnErr(err, "bad request") - req.Header.Add("Connection", "close") - req.Header.Add("Proxy-Connection", "close") - client.Do(req) -} - -func TestHeadReqHasContentLength(t *testing.T) { - client, l := oneShotProxy(goproxy.NewProxyHttpServer(), t) - defer l.Close() - - resp, err := client.Head(localFile("test_data/panda.png")) - panicOnErr(err, "resp to HEAD") - if resp.Header.Get("Content-Length") == "" { - t.Error("Content-Length should exist on HEAD requests") - } -} - -func TestChunkedResponse(t *testing.T) { - l, err := net.Listen("tcp", ":10234") - panicOnErr(err, "listen") - defer l.Close() - go func() { - for i := 0; i < 2; i++ { - c, err := l.Accept() - panicOnErr(err, "accept") - _, err = http.ReadRequest(bufio.NewReader(c)) - panicOnErr(err, "readrequest") - io.WriteString(c, "HTTP/1.1 200 OK\r\n"+ - "Content-Type: text/plain\r\n"+ - "Transfer-Encoding: chunked\r\n\r\n"+ - "25\r\n"+ - "This is the data in the first chunk\r\n\r\n"+ - "1C\r\n"+ - "and this is the second one\r\n\r\n"+ - "3\r\n"+ - "con\r\n"+ - "8\r\n"+ - "sequence\r\n0\r\n\r\n") - c.Close() - } - }() - - c, err := net.Dial("tcp", "localhost:10234") - panicOnErr(err, "dial") - defer c.Close() - req, _ := http.NewRequest("GET", "/", nil) - req.Write(c) - resp, err := http.ReadResponse(bufio.NewReader(c), req) - panicOnErr(err, "readresp") - b, err := ioutil.ReadAll(resp.Body) - panicOnErr(err, "readall") - expected := "This is the data in the first chunk\r\nand this is the second one\r\nconsequence" - if string(b) != expected { - t.Errorf("Got `%v` expected `%v`", string(b), expected) - } - - proxy := goproxy.NewProxyHttpServer() - proxy.OnResponse().DoFunc(func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - panicOnErr(ctx.Error, "error reading output") - b, err := ioutil.ReadAll(resp.Body) - resp.Body.Close() - panicOnErr(err, "readall onresp") - if enc := resp.Header.Get("Transfer-Encoding"); enc != "" { - t.Fatal("Chunked response should be received as plaintext", enc) - } - resp.Body = ioutil.NopCloser(bytes.NewBufferString(strings.Replace(string(b), "e", "E", -1))) - return resp - }) - - client, s := oneShotProxy(proxy, t) - defer s.Close() - - resp, err = client.Get("http://localhost:10234/") - panicOnErr(err, "client.Get") - b, err = ioutil.ReadAll(resp.Body) - panicOnErr(err, "readall proxy") - if string(b) != strings.Replace(expected, "e", "E", -1) { - t.Error("expected", expected, "w/ e->E. Got", string(b)) - } -} - -func TestGoproxyThroughProxy(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy2 := goproxy.NewProxyHttpServer() - doubleString := func(resp *http.Response, ctx *goproxy.ProxyCtx) *http.Response { - b, err := ioutil.ReadAll(resp.Body) - panicOnErr(err, "readAll resp") - resp.Body = ioutil.NopCloser(bytes.NewBufferString(string(b) + " " + string(b))) - return resp - } - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - proxy.OnResponse().DoFunc(doubleString) - - _, l := oneShotProxy(proxy, t) - defer l.Close() - - proxy2.ConnectDial = proxy2.NewConnectDialToProxy(l.URL) - - client, l2 := oneShotProxy(proxy2, t) - defer l2.Close() - if r := string(getOrFail(https.URL+"/bobo", client, t)); r != "bobo bobo" { - t.Error("Expected bobo doubled twice, got", r) - } - -} - -func TestGoproxyHijackConnect(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest(goproxy.ReqHostIs(srv.Listener.Addr().String())). - HijackConnect(func(req *http.Request, client net.Conn, ctx *goproxy.ProxyCtx) { - t.Logf("URL %+#v\nSTR %s", req.URL, req.URL.String()) - resp, err := http.Get("http:" + req.URL.String() + "/bobo") - panicOnErr(err, "http.Get(CONNECT url)") - panicOnErr(resp.Write(client), "resp.Write(client)") - resp.Body.Close() - client.Close() - }) - client, l := oneShotProxy(proxy, t) - defer l.Close() - proxyAddr := l.Listener.Addr().String() - conn, err := net.Dial("tcp", proxyAddr) - panicOnErr(err, "conn "+proxyAddr) - buf := bufio.NewReader(conn) - writeConnect(conn) - readConnectResponse(buf) - if txt := readResponse(buf); txt != "bobo" { - t.Error("Expected bobo for CONNECT /foo, got", txt) - } - - if r := string(getOrFail(https.URL+"/bobo", client, t)); r != "bobo" { - t.Error("Expected bobo would keep working with CONNECT", r) - } -} - -func readResponse(buf *bufio.Reader) string { - req, err := http.NewRequest("GET", srv.URL, nil) - panicOnErr(err, "NewRequest") - resp, err := http.ReadResponse(buf, req) - panicOnErr(err, "resp.Read") - defer resp.Body.Close() - txt, err := ioutil.ReadAll(resp.Body) - panicOnErr(err, "resp.Read") - return string(txt) -} - -func writeConnect(w io.Writer) { - req, err := http.NewRequest("CONNECT", srv.URL[len("http://"):], nil) - panicOnErr(err, "NewRequest") - req.Write(w) - panicOnErr(err, "req(CONNECT).Write") -} - -func readConnectResponse(buf *bufio.Reader) { - _, err := buf.ReadString('\n') - panicOnErr(err, "resp.Read connect resp") - _, err = buf.ReadString('\n') - panicOnErr(err, "resp.Read connect resp") -} - -func TestCurlMinusP(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnectFunc(func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) { - return goproxy.HTTPMitmConnect, host - }) - called := false - proxy.OnRequest().DoFunc(func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - called = true - return req, nil - }) - _, l := oneShotProxy(proxy, t) - defer l.Close() - cmd := exec.Command("curl", "-p", "-sS", "--proxy", l.URL, srv.URL+"/bobo") - output, err := cmd.CombinedOutput() - if err != nil { - t.Fatal(err) - } - if string(output) != "bobo" { - t.Error("Expected bobo, got", string(output)) - } - if !called { - t.Error("handler not called") - } -} - -func TestSelfRequest(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - _, l := oneShotProxy(proxy, t) - defer l.Close() - if !strings.Contains(string(getOrFail(l.URL, http.DefaultClient, t)), "non-proxy") { - t.Fatal("non proxy requests should fail") - } -} - -func TestHasGoproxyCA(t *testing.T) { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - s := httptest.NewServer(proxy) - - proxyUrl, _ := url.Parse(s.URL) - goproxyCA := x509.NewCertPool() - goproxyCA.AddCert(goproxy.GoproxyCa.Leaf) - - tr := &http.Transport{TLSClientConfig: &tls.Config{RootCAs: goproxyCA}, Proxy: http.ProxyURL(proxyUrl)} - client := &http.Client{Transport: tr} - - if resp := string(getOrFail(https.URL+"/bobo", client, t)); resp != "bobo" { - t.Error("Wrong response when mitm", resp, "expected bobo") - } -} - -func TestHttpsMitmURLRewrite(t *testing.T) { - scheme := "https" - - testCases := []struct { - Host string - RawPath string - AddOpaque bool - }{ - { - Host: "example.com", - RawPath: "/blah/v1/data/realtime", - AddOpaque: true, - }, - { - Host: "example.com:443", - RawPath: "/blah/v1/data/realtime?encodedURL=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile", - }, - { - Host: "example.com:443", - RawPath: "/blah/v1/data/realtime?unencodedURL=https://www.googleapis.com/auth/userinfo.profile", - }, - } - - for _, tc := range testCases { - proxy := goproxy.NewProxyHttpServer() - proxy.OnRequest().HandleConnect(goproxy.AlwaysMitm) - - proxy.OnRequest(goproxy.DstHostIs(tc.Host)).DoFunc( - func(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Request, *http.Response) { - return nil, goproxy.TextResponse(req, "Dummy response") - }) - - client, s := oneShotProxy(proxy, t) - defer s.Close() - - fullURL := scheme + "://" + tc.Host + tc.RawPath - req, err := http.NewRequest("GET", fullURL, nil) - if err != nil { - t.Fatal(err) - } - - if tc.AddOpaque { - req.URL.Scheme = scheme - req.URL.Opaque = "//" + tc.Host + tc.RawPath - } - - resp, err := client.Do(req) - - if err != nil { - t.Fatal(err) - } - - b, err := ioutil.ReadAll(resp.Body) - defer resp.Body.Close() - if err != nil { - t.Fatal(err) - } - - body := string(b) - if body != "Dummy response" { - t.Errorf("Expected proxy to return dummy body content but got %s", body) - } - - if resp.StatusCode != http.StatusAccepted { - t.Errorf("Expected status: %d, got: %d", http.StatusAccepted, resp.StatusCode) - } - } -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader.go deleted file mode 100644 index 1458af5..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader.go +++ /dev/null @@ -1,97 +0,0 @@ -package regretable - -import ( - "io" -) - -// A RegretableReader will allow you to read from a reader, and then -// to "regret" reading it, and push back everything you've read. -// For example, -// rb := NewRegretableReader(bytes.NewBuffer([]byte{1,2,3})) -// var b = make([]byte,1) -// rb.Read(b) // b[0] = 1 -// rb.Regret() -// ioutil.ReadAll(rb.Read) // returns []byte{1,2,3},nil -type RegretableReader struct { - reader io.Reader - overflow bool - r, w int - buf []byte -} - -var defaultBufferSize = 500 - -// Same as RegretableReader, but allows closing the underlying reader -type RegretableReaderCloser struct { - RegretableReader - c io.Closer -} - -// Closes the underlying readCloser, you cannot regret after closing the stream -func (rbc *RegretableReaderCloser) Close() error { - return rbc.c.Close() -} - -// initialize a RegretableReaderCloser with underlying readCloser rc -func NewRegretableReaderCloser(rc io.ReadCloser) *RegretableReaderCloser { - return &RegretableReaderCloser{*NewRegretableReader(rc), rc} -} - -// initialize a RegretableReaderCloser with underlying readCloser rc -func NewRegretableReaderCloserSize(rc io.ReadCloser, size int) *RegretableReaderCloser { - return &RegretableReaderCloser{*NewRegretableReaderSize(rc, size), rc} -} - -// The next read from the RegretableReader will be as if the underlying reader -// was never read (or from the last point forget is called). -func (rb *RegretableReader) Regret() { - if rb.overflow { - panic("regretting after overflow makes no sense") - } - rb.r = 0 -} - -// Will "forget" everything read so far. -// rb := NewRegretableReader(bytes.NewBuffer([]byte{1,2,3})) -// var b = make([]byte,1) -// rb.Read(b) // b[0] = 1 -// rb.Forget() -// rb.Read(b) // b[0] = 2 -// rb.Regret() -// ioutil.ReadAll(rb.Read) // returns []byte{2,3},nil -func (rb *RegretableReader) Forget() { - if rb.overflow { - panic("forgetting after overflow makes no sense") - } - rb.r = 0 - rb.w = 0 -} - -// initialize a RegretableReader with underlying reader r, whose buffer is size bytes long -func NewRegretableReaderSize(r io.Reader, size int) *RegretableReader { - return &RegretableReader{reader: r, buf: make([]byte, size) } -} - -// initialize a RegretableReader with underlying reader r -func NewRegretableReader(r io.Reader) *RegretableReader { - return NewRegretableReaderSize(r, defaultBufferSize) -} - -// reads from the underlying reader. Will buffer all input until Regret is called. -func (rb *RegretableReader) Read(p []byte) (n int, err error) { - if rb.overflow { - return rb.reader.Read(p) - } - if rb.r < rb.w { - n = copy(p, rb.buf[rb.r:rb.w]) - rb.r += n - return - } - n, err = rb.reader.Read(p) - bn := copy(rb.buf[rb.w:], p[:n]) - rb.w, rb.r = rb.w + bn, rb.w + n - if bn < n { - rb.overflow = true - } - return -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader_test.go deleted file mode 100644 index 55fa752..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/regretable/regretreader_test.go +++ /dev/null @@ -1,174 +0,0 @@ -package regretable_test - -import ( - . "github.com/elazarl/goproxy/regretable" - "bytes" - "io" - "io/ioutil" - "strings" - "testing" -) - -func TestRegretableReader(t *testing.T) { - buf := new(bytes.Buffer) - mb := NewRegretableReader(buf) - word := "12345678" - buf.WriteString(word) - - fivebytes := make([]byte, 5) - mb.Read(fivebytes) - mb.Regret() - - s, _ := ioutil.ReadAll(mb) - if string(s) != word { - t.Errorf("Uncommited read is gone, [%d,%d] actual '%v' expected '%v'\n", len(s), len(word), string(s), word) - } -} - -func TestRegretableEmptyRead(t *testing.T) { - buf := new(bytes.Buffer) - mb := NewRegretableReader(buf) - word := "12345678" - buf.WriteString(word) - - zero := make([]byte, 0) - mb.Read(zero) - mb.Regret() - - s, err := ioutil.ReadAll(mb) - if string(s) != word { - t.Error("Uncommited read is gone, actual:", string(s), "expected:", word, "err:", err) - } -} - -func TestRegretableAlsoEmptyRead(t *testing.T) { - buf := new(bytes.Buffer) - mb := NewRegretableReader(buf) - word := "12345678" - buf.WriteString(word) - - one := make([]byte, 1) - zero := make([]byte, 0) - five := make([]byte, 5) - mb.Read(one) - mb.Read(zero) - mb.Read(five) - mb.Regret() - - s, _ := ioutil.ReadAll(mb) - if string(s) != word { - t.Error("Uncommited read is gone", string(s), "expected", word) - } -} - -func TestRegretableRegretBeforeRead(t *testing.T) { - buf := new(bytes.Buffer) - mb := NewRegretableReader(buf) - word := "12345678" - buf.WriteString(word) - - five := make([]byte, 5) - mb.Regret() - mb.Read(five) - - s, err := ioutil.ReadAll(mb) - if string(s) != "678" { - t.Error("Uncommited read is gone", string(s), len(string(s)), "expected", "678", len("678"), "err:", err) - } -} - -func TestRegretableFullRead(t *testing.T) { - buf := new(bytes.Buffer) - mb := NewRegretableReader(buf) - word := "12345678" - buf.WriteString(word) - - twenty := make([]byte, 20) - mb.Read(twenty) - mb.Regret() - - s, _ := ioutil.ReadAll(mb) - if string(s) != word { - t.Error("Uncommited read is gone", string(s), len(string(s)), "expected", word, len(word)) - } -} - -func assertEqual(t *testing.T, expected, actual string) { - if expected!=actual { - t.Fatal("Expected", expected, "actual", actual) - } -} - -func assertReadAll(t *testing.T, r io.Reader) string { - s, err := ioutil.ReadAll(r) - if err!=nil { - t.Fatal("error when reading", err) - } - return string(s) -} - -func TestRegretableRegretTwice(t *testing.T) { - buf := new(bytes.Buffer) - mb := NewRegretableReader(buf) - word := "12345678" - buf.WriteString(word) - - assertEqual(t, word, assertReadAll(t, mb)) - mb.Regret() - assertEqual(t, word, assertReadAll(t, mb)) - mb.Regret() - assertEqual(t, word, assertReadAll(t, mb)) -} - -type CloseCounter struct { - r io.Reader - closed int -} - -func (cc *CloseCounter) Read(b []byte) (int, error) { - return cc.r.Read(b) -} - -func (cc *CloseCounter) Close() error { - cc.closed++ - return nil -} - -func assert(t *testing.T, b bool, msg string) { - if !b { - t.Errorf("Assertion Error: %s", msg) - } -} - -func TestRegretableCloserSizeRegrets(t *testing.T) { - defer func() { - if r := recover(); r == nil || !strings.Contains(r.(string), "regret") { - t.Error("Did not panic when regretting overread buffer:", r) - } - }() - buf := new(bytes.Buffer) - buf.WriteString("123456") - mb := NewRegretableReaderCloserSize(ioutil.NopCloser(buf), 3) - mb.Read(make([]byte, 4)) - mb.Regret() -} - -func TestRegretableCloserRegretsClose(t *testing.T) { - buf := new(bytes.Buffer) - cc := &CloseCounter{buf, 0} - mb := NewRegretableReaderCloser(cc) - word := "12345678" - buf.WriteString(word) - - mb.Read([]byte{0}) - mb.Close() - if cc.closed != 1 { - t.Error("RegretableReaderCloser ignores Close") - } - mb.Regret() - mb.Close() - if cc.closed != 2 { - t.Error("RegretableReaderCloser does ignore Close after regret") - } - // TODO(elazar): return an error if client issues Close more than once after regret -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/signer_test.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/signer_test.go deleted file mode 100644 index d0e24d2..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/signer_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package goproxy - -import ( - "crypto/tls" - "crypto/x509" - "io/ioutil" - "net/http" - "net/http/httptest" - "os" - "os/exec" - "strings" - "testing" - "time" -) - -func orFatal(msg string, err error, t *testing.T) { - if err != nil { - t.Fatal(msg, err) - } -} - -type ConstantHanlder string - -func (h ConstantHanlder) ServeHTTP(w http.ResponseWriter, r *http.Request) { - w.Write([]byte(h)) -} - -func getBrowser(args []string) string { - for i, arg := range args { - if arg == "-browser" && i+1 < len(arg) { - return args[i+1] - } - if strings.HasPrefix(arg, "-browser=") { - return arg[len("-browser="):] - } - } - return "" -} - -func TestSingerTls(t *testing.T) { - cert, err := signHost(GoproxyCa, []string{"example.com", "1.1.1.1", "localhost"}) - orFatal("singHost", err, t) - cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0]) - orFatal("ParseCertificate", err, t) - expected := "key verifies with Go" - server := httptest.NewUnstartedServer(ConstantHanlder(expected)) - defer server.Close() - server.TLS = &tls.Config{Certificates: []tls.Certificate{cert, GoproxyCa}} - server.TLS.BuildNameToCertificate() - server.StartTLS() - certpool := x509.NewCertPool() - certpool.AddCert(GoproxyCa.Leaf) - tr := &http.Transport{ - TLSClientConfig: &tls.Config{RootCAs: certpool}, - } - asLocalhost := strings.Replace(server.URL, "127.0.0.1", "localhost", -1) - req, err := http.NewRequest("GET", asLocalhost, nil) - orFatal("NewRequest", err, t) - resp, err := tr.RoundTrip(req) - orFatal("RoundTrip", err, t) - txt, err := ioutil.ReadAll(resp.Body) - orFatal("ioutil.ReadAll", err, t) - if string(txt) != expected { - t.Errorf("Expected '%s' got '%s'", expected, string(txt)) - } - browser := getBrowser(os.Args) - if browser != "" { - exec.Command(browser, asLocalhost).Run() - time.Sleep(10 * time.Second) - } -} - -func TestSingerX509(t *testing.T) { - cert, err := signHost(GoproxyCa, []string{"example.com", "1.1.1.1", "localhost"}) - orFatal("singHost", err, t) - cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0]) - orFatal("ParseCertificate", err, t) - certpool := x509.NewCertPool() - certpool.AddCert(GoproxyCa.Leaf) - orFatal("VerifyHostname", cert.Leaf.VerifyHostname("example.com"), t) - orFatal("CheckSignatureFrom", cert.Leaf.CheckSignatureFrom(GoproxyCa.Leaf), t) - _, err = cert.Leaf.Verify(x509.VerifyOptions{ - DNSName: "example.com", - Roots: certpool, - }) - orFatal("Verify", err, t) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/test_data/baby.jpg b/src/imagemagick/vendor/github.com/elazarl/goproxy/test_data/baby.jpg deleted file mode 100644 index c377bb8e3246026430751ffc9ae76de178435a09..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2571 zcmbV}c{J4PAIHCAn6Yb=H5ploD2zQz;WFg547rvmldMC?F2={eJJ~Jn!>)&hvSm^M0KVXNofm95`ofYYl)v z0081HfU^e}TiRQhU%qI6TEWNjq~A?1AB70*Q(6kD;i1?-9|hZUNQHBktdI&3hFWSG z3c=y-H?U#16igM2^aME+z!KmA?Q7q8_Qea{cRpTTFfW7;0{O9_0{jrD02Bh@7vdKX z+!wbJ77`TRKkR?<&r=>gFqlse3W5G;`Jar_4Z!#T1b_g86agL>2n+*p`T;l>lJ7@6 zF6lo4@ql^xAW&`$A#Ov<0d9OSm>Zgpo0!`j%e@D9VSM68wap<1QSMO1;6sSS+z0$h z7EL`8_M;4Co$Db<0)moK(lW9t$BwJ2ozT_OH!w6hZTXXxHPXiRoWo_uU!0s>Ts=I! zynTGJexYIE5s^{1qLXi@+)4d4Ej=&4ps=X;-ftz9_^RrMgqqsAC(Tb=o{?IgxApe* z4-5{y9R6c${O!cM$*E~Fl{PoOu(I3xp?+x z0Nv*T@kDYr7{<$YR2w30j)J-eA5=sn@*lFuebCe+prm8ZkhmT)Dk!O}OI2a+qx~TJ z@4%A&FS37u{hNyn2!lb~;elbm8DQJu%@8)=MXR7_$Z4nUuBXt+<4x7lT257rsq zP49az`5Nc2qw9BCv;j}wHjz5|rSe(EYxmKr6GA+(A^uBRQPJ6mdXdcwlO*)^O71sl zFNm#Qyr5ao9pyF4+ndjoN* zk94zm(d+$RG0Hmo%?0GycdOQwp+F2S(J?Z9Ob+;Cc4ku5UMjq^D ztKa4TNk!~vM(O}2rSnkJv+?6kI!JAi?T_0W3Jou5O##Wnb7L)ie;QTiq?(k`+X*od z(fG+B>blXwSXku)dwsvjoeFE*0wa}nmW5;NehqSJ@?ZE+f4VmxT;C&(vJ&|U|T=1nB1O2ub*gb=vz;IM+WAJzq(zq@v z87erXhh9al$CN|FtDcvgBrL}jJW5cN39Oi@tW%l4kx0r$hFamA9v83UW145X$UePx zOr_a7U9-~|-;O8b*OSuMrrFvRy`Ac;!?PdL+a?DpL~(kfI0JuwnRe$djY@70fIo%9 zhoMCCZ^RD0A-e`Mn`75J@(_*uvq?s~>Puo`tYSx2?A(3LON>lE@^2Lop9007s^(PE zKyh7jnBPYoZhJ{n9IJN#NC=M&z$TcH|6FhjKJn=n$>CdOq`^J zhWIA#M44I}tytkwchGEI)^AjmF%2_Cf5wNID{hbToZVrAsfpc3o)h1gBKzU64tM!f zCVZgWcr0kmJ>%tbNnU7AgqMqc*{y^Fgvr3r5jn!D%Z>>ae#A`1O%JbpI;B#m)Gj$W ziLeNz@K*G;bUP7co$8fWW2SF?{~VP2#arg8U>&Nmq}Y2qh-4jwSuNe+#mdVvrIJ@W zrLXh|BYev*JP21mkU6UQ>UM&)jRtb8dG9E)KEB7e^Ay{dxt2J0=R==UlTa<0PR`6n zFRR|sM-+wJ9C}3#UQbE|z$2qY7}-u~wh0SGZC?DTO?IQc zZ~}8hIlJ`bU;guF$Q%7qT~9v_qdZT{6+I%Q^8@AUrFpj>Dh;&O7X&DIga*zyMZClKBS6sK?@#j2!f1mg3TF$lZ!E)>m zgm$(OOXuNh0`b0wZl3j7osN;f}3NXxjH9SmEY znYyY?yQ+yAw{_MvHGOrrxbH@uBSpSyi3G4qN3R+L(ec=M655nSTgrs zqD{v;@0ldST$|4ov?Ci8SXK&S@-hRHrrQwH*Cnhcq<;B{UF^AlNSkBtXx@f5iCL{f zmiH&7afey9JJKx6L4$2_6x@aJp{dcL(`)m7y2{pyDx@)&6(#r_3p_=;*)zTbyB!6# za$8|zgP9hEzv?;@Oqe-#Xx;2;s$9hIfCQDIvF7lF10+ZhIDpxiulW9W-vxBk{CL1y zmF8s_p7MJy;(J9{&1{a}0vl9K&tt`7p66dktg>shuz6GKCC3motW4iMeqaXA0Rs0@ zmsmm63VW7jZ=58Fk&~>4ju*kw!*3>Bxl&yspduru11e(suUv#VPrI;;ZOX^~QmxWH zA(gE~@EwF8gZxy9h})$DFXG0HgW)|GCCeWDU!qHfu{C6?;Dg1e~;JW^?v^Se!U;B$K#!BW}-_=b&CoB09t)LEsKBD_|Ft%|7N9Ez~Vnp`s>*~ z1psQM|4anr6|e&Um8lmPY-Z*O3xYlMg!%L6gTXxhfiMrRC++|cGLNu?T3PO}suC7Y zK!!4yWQkn08z*kH3iUZoZl_Um3U3R3(9pMii#uZ4$6FB zND;*hXoRJMN&yWWq9{a;fF)2w0yq!5xvl|bVt}*Y%greu3UQVjP6XJ$|r z+>^8bPi3Hb>|u&F0FeZkJq&vlfmty?Qs2fy52$Mfy0Hw@^#BD8AZeZye;*(T2b>4^ z_(FiVT!2~U$VTOt2$Eq-_+L`F^(w9WirUfk6k-A7Ha6n7g|PZ;BFyqGH(c^G#L=O- z9MaLU^vlO108o_4@^9PY%MdIb5{s2jZ=!P&+x<#*eb?1>?P_DJ%KzWtR)QiYu0$mo zZbd1RMfqM8-#Z}jd_-OJjF9S4Pp{Dk6z$C09Q*&5jrNDvt#fl5>+7=yy&!v+A)AOR zDB7vp=JLs(NR2lX9f3&n?v@XfnGJ531sDx|m4P~4weltV&qM7>of_v(2ufA(5 zM3{NaoG~C>D=+O>y5w#$=*|7Udz06XSC>T3iPe_mfI4qAqVPYGUmiVT@E!%DGnULjACyusm zp;Psz|La0gh!X0ErXm!%IQg2 zq*(D->v12c2HsFibkJ$bR2~4NV=fXpbfw-#*PE+;qiF=UmMh$f((hpq7{Px|=`HE_RV_clAZOz#s(aZC^B^8-=JEVtp$cdKctFt_R+Rui`; zpSq2G4klrY*6ya1CkY1exZKv%gBU?fX7$Q>xcFsn&QmH-633aN1@C5+8-5XJyZNV= z-BnsD5uzu`H^Z30B*74#1nyPfXG{i53%0(#q5t`l)gXs*)C&8?-R@gxQ`YrzNyP zxjeBFS`M>P{}gF^nM`KeW7J~`{$yVC*=elqA?W@GM%cSK#yL+>7VJ z?Kzj+?WwAj6(1DAG6pg>4Hn05J=Dq9asti@f=np4gv#K@ktvJJhxb?SbC${)wMw}= z_*7=YvmsS_RpwQ?d!6#g{W3&pr*^yTc{H77zk#5Gpe{56ON!XCoU>dgqbg%HR#iGh zidXuSaDHgl3jXR>c92up^(d;)2v)Wj+PU?YD?;MZ>eBab*{LoKgsg#vpA1KXWmoBw z3xKI`OZ4M@nS&jBG{7Y;?_A(3aha_XDj%nHUg^-Md0`yZ_}6?fzL<{!WCFYbhQ_afzDsZAZ{>f_Uut%?3$YVzDsO6W*RNlhO!VQ?xCCSlc-^=+q!;?#;Ba)=BV44CBq?`e48R% zpssAt=00T4K~`s0L|eqGOI32(#5uYuZaePCr(Xh@l^!ZB=3xsC)Fb*%vUen)kTHg_ zS(&vars4a&UI@$lDP1TVwDoE1aZ+lsVa%{NTunTm6SFYTxo!}28sNARHhGH3Z^%dQ zm*Z*=~r+)uV(r2kU(iChO4Q<@wlW>#Bw5j=C z*IW`@NpLx2Q~RwJ_dGfwWZ>5|$LNh27a7;lrHp6;InxiujLmkXZ2gP$&G{ng6WTFi$^nJU(b8ORB% zRf>D7%qz6Xwy9&pJ#0s&Aqa^66GJXVabcvq-;=JTi~ZxoRm3XwS~y#d#DJrJ=m#wN zB)*KbLYz@lDOhP?pPCH9<*aGKU$c6Iv$&`q0w8jZmyzVffHCo75DrC)j&f_bss?;eJ`zG^s0H~7JII9V|3*Gd1 zK3we{Uw_r-m)b0G`yKh9Ps8hKQd=>qCQ#|Nm7UOcVe)#YyN$=!(c~e;?5aYM(fyHz zA>3<)g2VUM`;2JDl{ZZ#35GUe+>p)AYH!7Qm4Hwj)fx+_NWw$1YL%9hCSl)c)2e+N zI5M(RAk5e&`Vnd<2GvO9vqx=BwGkh&hyT9sXbO?AU21gsn}Fa{V@XayGUM3bEH7t; z@F5$ViLjxsx%jtVDyn*0ACGxVdhBd2iWS<^Wmm#C;dFkqbMs$lmmYrEKmDzZlYoy3 z;o4)Hz^xy@stmknY^mDR02S)Ew@wUR%WTxfLpe&#oEz!~20TlU8^&c1_isW#Y! zvnH}Op7xk_Ki5BRAgCjgD|gPa&wU+hOnd|O`-vxsFUk4nn!dMwo93QWwX(>V5!utF z>%Y@=g*Xfrqm`$%epP^3<@47HUEd*4E)j0iD$PGn3$I=wpSts$8_F%=4az&p)5*8Y zJGXbWZ!;ZHo0!>M47BP2pQ^ z*d=dz*kKz((8{Ftb?TOKhcedTs3qvA9=E|{(_)iXtK{Un8?>u(l{IDB-(Jw3hirB5 zX*~$*Yz+4x>~Iz;U>8n0Lw~Ve&rBC8sxEXMhrtMagwrL~g~&j`OYCs_T(IClO^0cR z(}~8u<{Wq-aa!H}3O{>@f9c&FTy#8v*Cmj}$BtcPo@UU4Ni%XYh7)KL_6i@UDJrh2 z2VU-6l!3<{j|mjAT@_yqBiUFbBG0DxzGEkHCO*KA;8|aNUzA+#cJFc2;xK5;?XJNP z8L3An56|~e!T4bA!;ee!rt2?wUJ6}%{`q`rIbL?2#gUbDO+uV=eBmY|hWqz#^0?_) z7z04qJphP`1%N--|F{DH&m;k0*BJnmasYr0_Qt7C2LOnx^tCjtLgs(qY?HXGnaP%6 z9`i=*P)0cUO*tegAgR2Cl#N*%MJ`t^)aCVBNVxoUS&?%ug_{0dZ!J89I74%y3Pnsg ziTRzh7LwxRJR=9Q%pwz`(k!n#o6HXRgF&2?RqgwKS0<;_<(l^{tO@w*0^~u}w09WC zWf)fp@c&Xx>55Tkh}ngj8zX(WE$nR0H`8gmIE+@w zpI~&)fcFVz+^L!l(Pcm7ycIJJe{vx)9}vuElp#FGhc!i?Su&QtJSU4JD?}l05ZB&m z{}m|OfUe{5>r?fm>4-FPQPoLhSjN&(bwpN+qRD^kEo(W9+DB=Q?6|(SM2(}U{ORPE z>%>`|P1X}cuB!mUpW>`;FgEHsHn#v?xV%XBeh4k!S%XG9Ubsv-8vIlAp)BJvU3H%Z zsu5%kVJY?1Awu?KshR<5%xr(1Zloo&?o4q)UQx>skrhYfzMoomT0Rx>l6gYu=Yx*8 zgWrt9ao|hi&Pid*Sp~s~jqJPqjV-eMgYPl4A%ZJ2mPwJ?yasoE0cvT z7~1}GRWXL;K7%JxcQ$9OTUoYNi`(W`9~8j-;cI`kMcpA>_zFse1U7$HEDEMCakaB@ zeykU>&owH5@@_gM2yVLPE}{ZEY@Db&V#33D&Jug5#vrsvjOyU|HBKf-1X@KVQ=RO) zeK^p)APN#Qnr1%0#Ew3Xd-O_v5-L_-r0pU}Rd+AMwUk)6;o?}wp`@X``<2KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z001EcNkl4UG(%o-gX2m))0EmSPKmsJeMIyz`q!x>oC|TtsmgOIc z?NmiBDRLaAY*#9FoJxK;sfsIJ%96EMCCRj8izO|1o_o%B&i6GjGyZ>mks$dq`9qE^)~sF&-}ezlJq!n9b^t5y7K#0KT~glz|3&Y0RY|@T^G(-YhkQImSxKh zu+}0;5+q3iV+<;l%EmRT*L-Sfa`G=FVsgIut1(@i(e zRLT`3nYn%2)~&x{t()kDA$s$37#())KD;CRYer^tpW(!KGNBw;8EvfWvqvI>?%K5p;T(Ka6Ab?g1 zju}cRWLbvmuD!0axVV^{I(4e{(n~MN6DN-2nO(c=xpU_TMAT}vbJy><;Zys*weO!j z*ZW2V9vt}pZ3HlwMn*?}d-LXvzrB6?HowtmU~#dDiHSA5X6+h!{`oy0P*S~b<;s=b z`1lHy&*veP0$qq*1{^yO3CMs-K`vJ!A+UC00?nl*w`KEYdi;k!qn>TF^)@|6}%H;}cPm@v#Qp*0?u>&(eL}15=lNh68V@Q)2LEzKThJp@5OaU5gYwym<=X`|U} z;>gis>D>9**Ibyw;mXT^l3HB$-Y3B*77G;t4%(eAWyYcxhUkSM?z!t8eCk&}g)LWK zP3$Z@Kj^PA00_RgGz>~e-xw(+q?CMNk4Py&0CsHOfu*GezWFzQ^NNt-iE6b9khpRO z?7Z=o%PVX`5Q5JJEj11Tj&jY)6axznv&G435bdbDun^y#H5PT&C4{r5g_Sr-Z+5XBK5 z`QG0@-R*YwwL0zF)~%bOyY9Xl4}SPTjE}DXh@qrfcGx=x)gT&Z@MWbmgzP(^SS+cr z@iF7rZJwW-yJM-4|C(0%${jFs?&M{n9s)ay+itwUn^?bIcf$~C)=uEY9XFv+D8M?4 zAPC-Q*t^|l?3`nvl#oh^O0DK~dp!(~jNI;N^)(@W23z3#`Lmao0-S@Cl0N<~{^h@& zT0eEO$ui`NB^2^SF!#gug28WLID^>%xR4D&M10XXOGHwTFhry>V}u|=K3_n!R(+2k z3~Ns>T(JXmu6S7&nk>WQx^){@uU+#?+SBlSjY1(0-}3+hlzPV=!-0sI8LuM(ur-D< zV}$2^w9ilPuEGkE-;9>>Ff`?ttUhQI&LBl_2W{nzx49oy0C z^`MmIYOO|{PG`$2FTV&SCEf}R5djxK*IPOu>~=0E|G_y|wOO_~O=7583H=Ih;ROK* zVi3?+j_)&PPUG9({(HRm;){sF5Y=iGpZLTluyf~55HY&F9;8$_eE0~y|Bv6t=;#Q- zFhUrH_~tjhfnu?M$;nAbB_X9ksZ=TlegGlpCmcZ3uTsu2PM$i2*}1v5bdowhGjn+; z2pB4ss&!_-S_3~Q^fA44@VtIB0HC8sj^G<#|0-VFcNj;H9)s2jNfM)0AHtvi#b2OO zt)f~kqZ{_1mB!rcd1$Ti)YDI4YTY_?J6)8^WqkcBe~wT8o6n+Jt&=qdX_AuG`X^SG zsNa$sYw_eWKf<9yN8Wx5T(xoIWo-d#ZEva3%B*t$2vT}*&cd2L*b!0!1U&hJ@8U;K z{xgJM!}<;DvADPZV+}g3Hs1fh`w;{lM#e_5CJ4aHn3|l#`t=)d`}4QsyWjgRW_vw2 zb~u0LFdB2`P^%3ii4%lTXcm_iATEHRLCTR*V9)a}qSftSeqsKiJASJ&I5T}&0l-8y z7v!0pgE0(~S(ZvbDnaZ3b_|k)HEY)*?^#$SP%f3Qckc^WF}?zy`*)wk-S^&$N~!z? z2nbwr&DEHkn85ZMuE&?Y{8gMd@-o&>PGIV)Yp}GqfNr-7cHDN%fbDk#3_vS|*|`Or zn>mkSsnBn;)9md5U6Q7F*GHBjO%jo2u@OXw;s{|B!Wh?wx`KcKM!E5pJF$85)!<|S z=V#}!ZfYGq{pn9*=PkEhvM%i0B^%5!V{B|3AN=44FjOnyLm&AiRI7Egnk|G;h<2-W z1QrmEARwWI#&BsR($K+J`%{B1wKzY2xs!lwXm}*{eIG(e6!Imq*1?(>LP&@~qf)C6 z@7D>KXn=0f8gL{*vNXz&l&9HaxZdhw^&2`rT06aej zV@yBHwT~$5O?yfnS-o;4qBy~UBYROR4Gk*7yTk$i>wo|0W!TSf&bjNiZCm*FpZ_d^ zTprBCN-Gj1L4sh+>u}gP$5JZ3>Gq!!NgN@~QYftv#}Pc=!@k#E!(aW?mtc%R6vx>6 z!X89Xg0Ft{%P1BLNYnnX)ESF*s|6v%frUnEI*MbgU9)C6`Mo}4co$8bQVQ?(@H`Dc zw0ie*&)xX&x4vy!%?4Vn2D+UdOqRiB2G$sGAL}y_IcrVQ?Y5z{g6Dbt3GyI6|K%6H zfQKJ`82b<|P9^xU2!VlJf3Sx%8X!^Yd>RY`Axkst-n|=#4j;m))2GmGcko-k^?BTK>n%8Q_6(vhLb+VQ;=&@H zeCi4J2JLt5m8=2)I(IOvO@(P#|dS2_j;xJx3%uQV17C;Yh#FmvGLa zvDCnQ_uYq0n>XU=r=G?azVJnS<~Kishd%ld96NR#OG`@_9v;E@nHiisc>+&7`J|hk zo?g-Ic2=D}ed@MKwf?V1N5^(;*}Nr5({!!&^j0Bd0EQ|S3QwOnapKd~@yWMxf%JUu za)u#wDb;@zgf&7+Ge19XXXj?k#M-qk?+2pS>j@epMFz+@C!94BB(kN2g&>y;gdYT8 z2QWKiS&CIFS7FQ5SL4MOU&8Rv5ZdiFjvqe(&+|~P)^O&`DLnpz$FY0&^Tt|ZiO5># zqGq#I7^>H{+jjSq5hvqNwM`QIwCu80}7*@`b_x z*Gu+14@*l8dgPHuaP^kW7#$wQ@#Du41UZZjkKpX|Sv>jF)A-Ske#D(_+d2jrYn@iw zd0KO+RFVwXD2fb`a4T1>qOI3$1O;=V>mLOQ_dt6vr{o&o7jhmKGkj)}Fj#2S_P5)oazS_`WA=wTjc)Q=ZnMR4nRT zE|3gRv(>`B{RhxkYNA*w4Zux?FbttRA8DE)47+Hx8tCQLhi9G*rbVyZLoy=tBK`yYf*km;aUT`E~8?Oks@C@PS&rj+3WO!}mPrd496E zu;`ktmSE?kvkoRR+S9L3-~oU&|GK5hClV&IuO0X8lGK;zSdCZ=l#Vaqrf(;usU}$Ivp7u~5s$pbw7`~^Wm4|k_ zgGRFfAth$#=5YAXVPt8NnJh~yrIJmJ5hR4lNDJ4u|VXPGg4(!K+4?ZYn zXJ&b3c2+xUrIb=cQOJ&&8jZ#IbLY-nvY4yaOkildela&lU^p-n#DI`cN`VHLo(Sut z5bHoll$0u8$RQU5C>Ba!cJO^4*7k`J&(ml&+lZ4Cj6U7<>Z`B9^F4T;h7__tR2lRG zwQ3E$u*1$+5=t?F!l8O4D;Ip*iBcEESzc?U**T|#v~%-w5Q3amS{P%65Yj&S=%a!i z7e+@%z04R`>!gxG8e<}@^s$SL-!M9YpS$x8$RpmHk)sS_ER3_*SV1!mu57i4nwOS)TmqQpC5ydgmG?VpuRVGPdk~9U3Q2>eg zg#`y@_@1X6JE5eqN-6R@Pt|I*e_B{vI9RP#;VFS@3mUg?+>XM^GLi%4?bu<4bA4yz z0}sX-q*=xV9GS77B1|p|wJ<&_$9O)M`T*8g9e)JxBovK~PE~@O(sZ zjB0HdxgfxSgNM)ydss7GLou)2wi|Ac*KOVImC9ADShEh5av8>0oIQIQomLwM_Prt` zk$(P#kgaj8FpBa*$edOR);Tm58#0&A$sh>e9M63I^S|{wAN$3RC7$+h_Sk-W=X0ON zLI@<8L5Y6~dOXciWF|wUQc1HcON})JV+@lJh~gMwuZMg-4`PNj4uyOHo_5IRix?Rm z=?^BQKrWXXpbvpKju6EWmX?;VY10M(giJTOymoT!^r_<~+F`F(Q%WJ9&kq_SA0!A; z2zZ`CzF2}*9(uhVtTia)3J^*`YlU*T0%J|T#Ldh=DT!{khtsD|<0Bvacz)&TwLxDj zkwR+^&Ph0Cm^AH2kdy#BTyxzG_`rugY+ic#l{2Fw!#^A!U-83do_U5^aZC5}btNg} z3w-yzcVl{H2EX$keg}t-p2P=NXSi(}een>JCcUWb%wSx+PfGe2fVW(<_lVCOJBJ>7fqsi#C3hT-k+xpQg#)MU38hPK&i z8s{t~rY5Vt=ReTtbU(Z}zpw#d732#`o(gP|SsGP7Rr2X25kTChq%QS|C32S7m@ZpM z&-Nlb$Y3W0K`JSXbrdHtq*N#r@~Bi&_}YhY27)AF8N<0jhj^Z0t%ETs+T9MaG{O9A z4?!W1dcB5XseDOKZ>@ze22u(bV<3b;7>0Suz zQc75BFgrVoZ+`P{)ZFa(!1pzETb&gPOA9}*l$u#wTujHt#=bZbvH zhP8Gelu!U+0MHzaF-VdWXV0GH1N-+2Nkmde=)7`^3-iMZ^9%p2P%Iy>R?3q~DO1el zy}R$Y6I-v}hWFil7Z&E{@x?Fv)ryk`5C3ANHu2w8qXY#9LJWfM6WEYf@nA|8TsH&< zI&(4;NiU*+ZKVqDDxn0FlrqTY0Cs7b8Vj%=M+tR1Ag>iSiXZ9xtT;g%q{Cu9<49&AD~^TvfQhNTdFgb1+mJkp-WIp1dpK{hk!g+27Q zM~W;n=$H&rNR)~tTz$qlX_`Xo zzKD{+{aztSaq!>)a?UBK1f-AzJkS~A; zXg2g_m4X!>tn|PpfU^ZS@~w5NowGg>K@gEp zf&>ZjJdZukMFH^F^r43!rNXn%K8rv4qd&qQ z{NW$s_kaKQuzmaXL1wpLc92ppccv!GptQ!o;c(<&jm428M-askND%t8oS`I1APWkT z2txGrhWUIRndwill+*}<914X3&P|^~H|}+6Vaijy8bSbq93)amnULU!1Z9w5>w`D| zTpo_A1ga>d91plFYb+aM!OVi4qfWPrPOpQjHeH2J{_-#5#v5TU%j$1-&N;?FO~%Y{+!thoy&jGpIf5vPAV?0X zg+iZ^vT*E>Bq>M`(kx>DuqFct%c6}_XHG-K>cHe^8RgZ21P^#s0tB;>WStU39zY(z zJ^`K}@<@P8nzfT8L7Ju@5@fBVEX%mt>tShW5x4BziTm!mcfb}4kRVJ>Od<*+2qD4N zVSH=^zx>HhA`BxmmKqR3Ku8JgdFXF<6Ac^-=6+&~q7dC~7l#fX!jJdvh1MEM_jSg` zWH82{(QKmK>A)C+IEu4ww-+xiEuq`#LMjOwl-JW|&Y?8S2cqx*%IS+xjDd(j07Oo( z6v9CWI0#~rfRhXs#9+s~kY$DeNlHm#hDefxI~_9lLSEl`+fID==Rb^-r_LZV2E}3- zrE(dqW)nmN&-0MP8EVxE#>dC8xVVTFD^?&)(>_l~B+}FrvNT1KB*+&Fu*M>cB1F9& zc0Icbr%s(3Xb<|Ko~9`n1lQjVs8(WQjP4SkJDo1lEFDy2!kN>jar*S}Q)|NNGv9yW zC6uq4gc|5L7>?LU#V}wf0tgOl4cHj~2?J55+c_2l!SzIc>cxVJO)910_sv>f^epXK67>*gWTCLwd2mxk?IF8Zlh44L%G|NZ`fp)8fPN#!> zuYfQL(P}ht@W4U$=%bHP81*O@1c;LuT4_irU~L~K#7Tn1r3O{2)xfdS{hnb4lao{M zJP${Y9z(R$_=iXKADDaM#A#Z;E`Z8;J_wn$&=$&Bw(JaB$Br#IwhSa7>Jg*O&dsK2 zI<1u|XV#F^9!a6VY$=Ijw{PD;+3R&tAFAX0%rw$CMX^}K==c~&2xz4+K0Xd1h=m{$ zBnNz8gvG_hK3l|$>FIL-_gA;sYGd!7J=nc#mpFCi6r_|e)qFpb%{P0UZ-b;RU%nuLl%@kV;L2L~t89N9#2xdqy zv;$HiqyWbZbOAJ5t>#Mr#`5`G%^E`_gmBhT7=~{5?&rk5ef!UmuMyu6!Gc)ItLx&FK(=5f}!XlcjCc51Y+N};wojL)}^WEI+Z2RQt)AI)p z9-MBqnz?)~x5ij5Tk8VP^Q0UIq@C)t=4l&srL#& z1+5kLA9qQ4es0b_|NQgVxN(!s<@3a3oOM=e-x~-k6#`#jeqm1j_{Tp!^4MdK?OL^J z)oKC)=a?GJhK-{rjN|xxtKFUp!>|j$f*^$uUaQ;93l?R7OH#>E&-02>Nnc4-CL&J? z6_6)%yWR4#AXk=B(krjLietzAAUl2L^#5tKTHh8>1to%Jo(idy&MGPr(7jNI1}%|; zz@QE3llX+bq7#w@v~$jHEG-r5LqoSZ>m>GX`N8i8M0=TXxJ~$F`sFtkFrD zN~MHmP~e>N*|8E3c_BnqX*uNiUfmhj?S;KF%zS`I9ChGE#wP3_G8C~>Fas6CG9f?) zP!Zsagfk$d3{HrVGLR4`W`WpPn|3-KDijJkl@iJrlLkSK4jnv{J@@<`{lO2sAAZoE z6chTAnL(TDI^C{_qiBD*RzAy&JaLXQKeK6)+B8g@OPsS=U+Th+(VtVmUBv437lc_l zX8|S<^%v2xWoIoJn<0*4Ggwpuf?;+U2##T4IR+R|95XJa33Q5g4j^?s7o37R>_YkNa#}U{$JoeZ>+1qZr6(hsLQg{L+1WcA)7St+Fj!2&Q~ z7yu4D_#JSU{H(#kXoE}{96EJIML4leU%3c z0T~DxfMoF15I|di&t=vec9tV0)v7p73a`HUvH%ec4~oi#K8jx@h5-sC;0yN zzyDOD(fAI;Kwj#W!_*27EFm2UIARdEbMN#+JD!}q66%>4Mqe|1m+BY5gII@;H+EL7Y))AU39kt-fl3# zT2Fw>11G{ueDy|Y>l|VWqiPtsqM+*rffZOZgp)ssZQ*K!5bc zZz62vw^O~o~cUVIcs)f=&OaKLSe- zi9ry6m-Th8TmG&eHF-C(-^)3-e4YRneIrRhP)UHSbKD_<&ulXRSnjV20|Z}!NHZG) z7_(f_1`6aiGvJM3OYdMfz2W`aI^#+nx>>HDs_z80U@kE1upp<1oB|;GY3jmVuw1*E zDW3xdPkQt@0EfPtmP^;0CagF9?>Bi*Z}KMgRZ+07*qoM6N<$ Ef{+FK(*OVf diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/roundtripper.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/roundtripper.go deleted file mode 100644 index 3651ad8..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/roundtripper.go +++ /dev/null @@ -1,19 +0,0 @@ -package transport -import "net/http" -type RoundTripper interface { - // RoundTrip executes a single HTTP transaction, returning - // the Response for the request req. RoundTrip should not - // attempt to interpret the response. In particular, - // RoundTrip must return err == nil if it obtained a response, - // regardless of the response's HTTP status code. A non-nil - // err should be reserved for failure to obtain a response. - // Similarly, RoundTrip should not attempt to handle - // higher-level protocol details such as redirects, - // authentication, or cookies. - // - // RoundTrip should not modify the request, except for - // consuming the Body. The request's URL and Header fields - // are guaranteed to be initialized. - RoundTrip(*http.Request) (*http.Response, error) - DetailedRoundTrip(*http.Request) (*RoundTripDetails, *http.Response, error) -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/transport.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/transport.go deleted file mode 100644 index fc1c82b..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/transport.go +++ /dev/null @@ -1,789 +0,0 @@ -// Copyright 2011 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. - -// HTTP client implementation. See RFC 2616. -// -// This is the low-level Transport implementation of RoundTripper. -// The high-level interface is in client.go. - -// This file is DEPRECATED and keep solely for backward compatibility. - -package transport - -import ( - "net/http" - "bufio" - "compress/gzip" - "crypto/tls" - "encoding/base64" - "errors" - "fmt" - "io" - "io/ioutil" - "log" - "net" - "net/url" - "os" - "strings" - "sync" -) - -// DefaultTransport is the default implementation of Transport and is -// used by DefaultClient. It establishes a new network connection for -// each call to Do and uses HTTP proxies as directed by the -// $HTTP_PROXY and $NO_PROXY (or $http_proxy and $no_proxy) -// environment variables. -var DefaultTransport RoundTripper = &Transport{Proxy: ProxyFromEnvironment} - -// DefaultMaxIdleConnsPerHost is the default value of Transport's -// MaxIdleConnsPerHost. -const DefaultMaxIdleConnsPerHost = 2 - -// Transport is an implementation of RoundTripper that supports http, -// https, and http proxies (for either http or https with CONNECT). -// Transport can also cache connections for future re-use. -type Transport struct { - lk sync.Mutex - idleConn map[string][]*persistConn - altProto map[string]RoundTripper // nil or map of URI scheme => RoundTripper - - // TODO: tunable on global max cached connections - // TODO: tunable on timeout on cached connections - // TODO: optional pipelining - - // Proxy specifies a function to return a proxy for a given - // Request. If the function returns a non-nil error, the - // request is aborted with the provided error. - // If Proxy is nil or returns a nil *URL, no proxy is used. - Proxy func(*http.Request) (*url.URL, error) - - // Dial specifies the dial function for creating TCP - // connections. - // If Dial is nil, net.Dial is used. - Dial func(net, addr string) (c net.Conn, err error) - - // TLSClientConfig specifies the TLS configuration to use with - // tls.Client. If nil, the default configuration is used. - TLSClientConfig *tls.Config - - DisableKeepAlives bool - DisableCompression bool - - // MaxIdleConnsPerHost, if non-zero, controls the maximum idle - // (keep-alive) to keep to keep per-host. If zero, - // DefaultMaxIdleConnsPerHost is used. - MaxIdleConnsPerHost int -} - -// ProxyFromEnvironment returns the URL of the proxy to use for a -// given request, as indicated by the environment variables -// $HTTP_PROXY and $NO_PROXY (or $http_proxy and $no_proxy). -// An error is returned if the proxy environment is invalid. -// A nil URL and nil error are returned if no proxy is defined in the -// environment, or a proxy should not be used for the given request. -func ProxyFromEnvironment(req *http.Request) (*url.URL, error) { - proxy := getenvEitherCase("HTTP_PROXY") - if proxy == "" { - return nil, nil - } - if !useProxy(canonicalAddr(req.URL)) { - return nil, nil - } - proxyURL, err := url.Parse(proxy) - if err != nil || proxyURL.Scheme == "" { - if u, err := url.Parse("http://" + proxy); err == nil { - proxyURL = u - err = nil - } - } - if err != nil { - return nil, fmt.Errorf("invalid proxy address %q: %v", proxy, err) - } - return proxyURL, nil -} - -// ProxyURL returns a proxy function (for use in a Transport) -// that always returns the same URL. -func ProxyURL(fixedURL *url.URL) func(*http.Request) (*url.URL, error) { - return func(*http.Request) (*url.URL, error) { - return fixedURL, nil - } -} - -// transportRequest is a wrapper around a *Request that adds -// optional extra headers to write. -type transportRequest struct { - *http.Request // original request, not to be mutated - extra http.Header // extra headers to write, or nil -} - -func (tr *transportRequest) extraHeaders() http.Header { - if tr.extra == nil { - tr.extra = make(http.Header) - } - return tr.extra -} - -type RoundTripDetails struct { - Host string - TCPAddr *net.TCPAddr - IsProxy bool - Error error -} - -func (t *Transport) DetailedRoundTrip(req *http.Request) (details *RoundTripDetails, resp *http.Response, err error) { - if req.URL == nil { - return nil, nil, errors.New("http: nil Request.URL") - } - if req.Header == nil { - return nil, nil, errors.New("http: nil Request.Header") - } - if req.URL.Scheme != "http" && req.URL.Scheme != "https" { - t.lk.Lock() - var rt RoundTripper - if t.altProto != nil { - rt = t.altProto[req.URL.Scheme] - } - t.lk.Unlock() - if rt == nil { - return nil, nil, &badStringError{"unsupported protocol scheme", req.URL.Scheme} - } - return rt.DetailedRoundTrip(req) - } - treq := &transportRequest{Request: req} - cm, err := t.connectMethodForRequest(treq) - if err != nil { - return nil, nil, err - } - - // Get the cached or newly-created connection to either the - // host (for http or https), the http proxy, or the http proxy - // pre-CONNECTed to https server. In any case, we'll be ready - // to send it requests. - pconn, err := t.getConn(cm) - if err != nil { - return nil, nil, err - } - - resp, err = pconn.roundTrip(treq) - return &RoundTripDetails{pconn.host, pconn.ip, pconn.isProxy, err}, resp, err -} - -// RoundTrip implements the RoundTripper interface. -func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) { - _, resp, err = t.DetailedRoundTrip(req) - return -} - -// RegisterProtocol registers a new protocol with scheme. -// The Transport will pass requests using the given scheme to rt. -// It is rt's responsibility to simulate HTTP request semantics. -// -// RegisterProtocol can be used by other packages to provide -// implementations of protocol schemes like "ftp" or "file". -func (t *Transport) RegisterProtocol(scheme string, rt RoundTripper) { - if scheme == "http" || scheme == "https" { - panic("protocol " + scheme + " already registered") - } - t.lk.Lock() - defer t.lk.Unlock() - if t.altProto == nil { - t.altProto = make(map[string]RoundTripper) - } - if _, exists := t.altProto[scheme]; exists { - panic("protocol " + scheme + " already registered") - } - t.altProto[scheme] = rt -} - -// CloseIdleConnections closes any connections which were previously -// connected from previous requests but are now sitting idle in -// a "keep-alive" state. It does not interrupt any connections currently -// in use. -func (t *Transport) CloseIdleConnections() { - t.lk.Lock() - defer t.lk.Unlock() - if t.idleConn == nil { - return - } - for _, conns := range t.idleConn { - for _, pconn := range conns { - pconn.close() - } - } - t.idleConn = make(map[string][]*persistConn) -} - -// -// Private implementation past this point. -// - -func getenvEitherCase(k string) string { - if v := os.Getenv(strings.ToUpper(k)); v != "" { - return v - } - return os.Getenv(strings.ToLower(k)) -} - -func (t *Transport) connectMethodForRequest(treq *transportRequest) (*connectMethod, error) { - cm := &connectMethod{ - targetScheme: treq.URL.Scheme, - targetAddr: canonicalAddr(treq.URL), - } - if t.Proxy != nil { - var err error - cm.proxyURL, err = t.Proxy(treq.Request) - if err != nil { - return nil, err - } - } - return cm, nil -} - -// proxyAuth returns the Proxy-Authorization header to set -// on requests, if applicable. -func (cm *connectMethod) proxyAuth() string { - if cm.proxyURL == nil { - return "" - } - if u := cm.proxyURL.User; u != nil { - return "Basic " + base64.URLEncoding.EncodeToString([]byte(u.String())) - } - return "" -} - -// putIdleConn adds pconn to the list of idle persistent connections awaiting -// a new request. -// If pconn is no longer needed or not in a good state, putIdleConn -// returns false. -func (t *Transport) putIdleConn(pconn *persistConn) bool { - t.lk.Lock() - defer t.lk.Unlock() - if t.DisableKeepAlives || t.MaxIdleConnsPerHost < 0 { - pconn.close() - return false - } - if pconn.isBroken() { - return false - } - key := pconn.cacheKey - max := t.MaxIdleConnsPerHost - if max == 0 { - max = DefaultMaxIdleConnsPerHost - } - if len(t.idleConn[key]) >= max { - pconn.close() - return false - } - t.idleConn[key] = append(t.idleConn[key], pconn) - return true -} - -func (t *Transport) getIdleConn(cm *connectMethod) (pconn *persistConn) { - t.lk.Lock() - defer t.lk.Unlock() - if t.idleConn == nil { - t.idleConn = make(map[string][]*persistConn) - } - key := cm.String() - for { - pconns, ok := t.idleConn[key] - if !ok { - return nil - } - if len(pconns) == 1 { - pconn = pconns[0] - delete(t.idleConn, key) - } else { - // 2 or more cached connections; pop last - // TODO: queue? - pconn = pconns[len(pconns)-1] - t.idleConn[key] = pconns[0 : len(pconns)-1] - } - if !pconn.isBroken() { - return - } - } - return -} - -func (t *Transport) dial(network, addr string) (c net.Conn, raddr string, ip *net.TCPAddr, err error) { - if t.Dial != nil { - ip, err = net.ResolveTCPAddr("tcp", addr) - if err!=nil { - return - } - c, err = t.Dial(network, addr) - raddr = addr - return - } - addri, err := net.ResolveTCPAddr("tcp", addr) - if err!=nil { - return - } - c, err = net.DialTCP("tcp", nil, addri) - raddr = addr - ip = addri - return -} - -// getConn dials and creates a new persistConn to the target as -// specified in the connectMethod. This includes doing a proxy CONNECT -// and/or setting up TLS. If this doesn't return an error, the persistConn -// is ready to write requests to. -func (t *Transport) getConn(cm *connectMethod) (*persistConn, error) { - if pc := t.getIdleConn(cm); pc != nil { - return pc, nil - } - - conn, raddr, ip, err := t.dial("tcp", cm.addr()) - if err != nil { - if cm.proxyURL != nil { - err = fmt.Errorf("http: error connecting to proxy %s: %v", cm.proxyURL, err) - } - return nil, err - } - - pa := cm.proxyAuth() - - pconn := &persistConn{ - t: t, - cacheKey: cm.String(), - conn: conn, - reqch: make(chan requestAndChan, 50), - host: raddr, - ip: ip, - } - - switch { - case cm.proxyURL == nil: - // Do nothing. - case cm.targetScheme == "http": - pconn.isProxy = true - if pa != "" { - pconn.mutateHeaderFunc = func(h http.Header) { - h.Set("Proxy-Authorization", pa) - } - } - case cm.targetScheme == "https": - connectReq := &http.Request{ - Method: "CONNECT", - URL: &url.URL{Opaque: cm.targetAddr}, - Host: cm.targetAddr, - Header: make(http.Header), - } - if pa != "" { - connectReq.Header.Set("Proxy-Authorization", pa) - } - connectReq.Write(conn) - - // Read response. - // Okay to use and discard buffered reader here, because - // TLS server will not speak until spoken to. - br := bufio.NewReader(conn) - resp, err := http.ReadResponse(br, connectReq) - if err != nil { - conn.Close() - return nil, err - } - if resp.StatusCode != 200 { - f := strings.SplitN(resp.Status, " ", 2) - conn.Close() - return nil, errors.New(f[1]) - } - } - - if cm.targetScheme == "https" { - // Initiate TLS and check remote host name against certificate. - conn = tls.Client(conn, t.TLSClientConfig) - if err = conn.(*tls.Conn).Handshake(); err != nil { - return nil, err - } - if t.TLSClientConfig == nil || !t.TLSClientConfig.InsecureSkipVerify { - if err = conn.(*tls.Conn).VerifyHostname(cm.tlsHost()); err != nil { - return nil, err - } - } - pconn.conn = conn - } - - pconn.br = bufio.NewReader(pconn.conn) - pconn.bw = bufio.NewWriter(pconn.conn) - go pconn.readLoop() - return pconn, nil -} - -// useProxy returns true if requests to addr should use a proxy, -// according to the NO_PROXY or no_proxy environment variable. -// addr is always a canonicalAddr with a host and port. -func useProxy(addr string) bool { - if len(addr) == 0 { - return true - } - host, _, err := net.SplitHostPort(addr) - if err != nil { - return false - } - if host == "localhost" { - return false - } - if ip := net.ParseIP(host); ip != nil { - if ip.IsLoopback() { - return false - } - } - - no_proxy := getenvEitherCase("NO_PROXY") - if no_proxy == "*" { - return false - } - - addr = strings.ToLower(strings.TrimSpace(addr)) - if hasPort(addr) { - addr = addr[:strings.LastIndex(addr, ":")] - } - - for _, p := range strings.Split(no_proxy, ",") { - p = strings.ToLower(strings.TrimSpace(p)) - if len(p) == 0 { - continue - } - if hasPort(p) { - p = p[:strings.LastIndex(p, ":")] - } - if addr == p || (p[0] == '.' && (strings.HasSuffix(addr, p) || addr == p[1:])) { - return false - } - } - return true -} - -// connectMethod is the map key (in its String form) for keeping persistent -// TCP connections alive for subsequent HTTP requests. -// -// A connect method may be of the following types: -// -// Cache key form Description -// ----------------- ------------------------- -// ||http|foo.com http directly to server, no proxy -// ||https|foo.com https directly to server, no proxy -// http://proxy.com|https|foo.com http to proxy, then CONNECT to foo.com -// http://proxy.com|http http to proxy, http to anywhere after that -// -// Note: no support to https to the proxy yet. -// -type connectMethod struct { - proxyURL *url.URL // nil for no proxy, else full proxy URL - targetScheme string // "http" or "https" - targetAddr string // Not used if proxy + http targetScheme (4th example in table) -} - -func (ck *connectMethod) String() string { - proxyStr := "" - if ck.proxyURL != nil { - proxyStr = ck.proxyURL.String() - } - return strings.Join([]string{proxyStr, ck.targetScheme, ck.targetAddr}, "|") -} - -// addr returns the first hop "host:port" to which we need to TCP connect. -func (cm *connectMethod) addr() string { - if cm.proxyURL != nil { - return canonicalAddr(cm.proxyURL) - } - return cm.targetAddr -} - -// tlsHost returns the host name to match against the peer's -// TLS certificate. -func (cm *connectMethod) tlsHost() string { - h := cm.targetAddr - if hasPort(h) { - h = h[:strings.LastIndex(h, ":")] - } - return h -} - -// persistConn wraps a connection, usually a persistent one -// (but may be used for non-keep-alive requests as well) -type persistConn struct { - t *Transport - cacheKey string // its connectMethod.String() - conn net.Conn - br *bufio.Reader // from conn - bw *bufio.Writer // to conn - reqch chan requestAndChan // written by roundTrip(); read by readLoop() - isProxy bool - - // mutateHeaderFunc is an optional func to modify extra - // headers on each outbound request before it's written. (the - // original Request given to RoundTrip is not modified) - mutateHeaderFunc func(http.Header) - - lk sync.Mutex // guards numExpectedResponses and broken - numExpectedResponses int - broken bool // an error has happened on this connection; marked broken so it's not reused. - - host string - ip *net.TCPAddr -} - -func (pc *persistConn) isBroken() bool { - pc.lk.Lock() - defer pc.lk.Unlock() - return pc.broken -} - -var remoteSideClosedFunc func(error) bool // or nil to use default - -func remoteSideClosed(err error) bool { - if err == io.EOF { - return true - } - if remoteSideClosedFunc != nil { - return remoteSideClosedFunc(err) - } - return false -} - -func (pc *persistConn) readLoop() { - alive := true - var lastbody io.ReadCloser // last response body, if any, read on this connection - - for alive { - pb, err := pc.br.Peek(1) - - pc.lk.Lock() - if pc.numExpectedResponses == 0 { - pc.closeLocked() - pc.lk.Unlock() - if len(pb) > 0 { - log.Printf("Unsolicited response received on idle HTTP channel starting with %q; err=%v", - string(pb), err) - } - return - } - pc.lk.Unlock() - - rc := <-pc.reqch - - // Advance past the previous response's body, if the - // caller hasn't done so. - if lastbody != nil { - lastbody.Close() // assumed idempotent - lastbody = nil - } - resp, err := http.ReadResponse(pc.br, rc.req) - - if err != nil { - pc.close() - } else { - hasBody := rc.req.Method != "HEAD" && resp.ContentLength != 0 - if rc.addedGzip && hasBody && resp.Header.Get("Content-Encoding") == "gzip" { - resp.Header.Del("Content-Encoding") - resp.Header.Del("Content-Length") - resp.ContentLength = -1 - gzReader, zerr := gzip.NewReader(resp.Body) - if zerr != nil { - pc.close() - err = zerr - } else { - resp.Body = &readFirstCloseBoth{&discardOnCloseReadCloser{gzReader}, resp.Body} - } - } - resp.Body = &bodyEOFSignal{body: resp.Body} - } - - if err != nil || resp.Close || rc.req.Close { - alive = false - } - - hasBody := resp != nil && resp.ContentLength != 0 - var waitForBodyRead chan bool - if alive { - if hasBody { - lastbody = resp.Body - waitForBodyRead = make(chan bool) - resp.Body.(*bodyEOFSignal).fn = func() { - if !pc.t.putIdleConn(pc) { - alive = false - } - waitForBodyRead <- true - } - } else { - // When there's no response body, we immediately - // reuse the TCP connection (putIdleConn), but - // we need to prevent ClientConn.Read from - // closing the Response.Body on the next - // loop, otherwise it might close the body - // before the client code has had a chance to - // read it (even though it'll just be 0, EOF). - lastbody = nil - - if !pc.t.putIdleConn(pc) { - alive = false - } - } - } - - rc.ch <- responseAndError{resp, err} - - // Wait for the just-returned response body to be fully consumed - // before we race and peek on the underlying bufio reader. - if waitForBodyRead != nil { - <-waitForBodyRead - } - } -} - -type responseAndError struct { - res *http.Response - err error -} - -type requestAndChan struct { - req *http.Request - ch chan responseAndError - - // did the Transport (as opposed to the client code) add an - // Accept-Encoding gzip header? only if it we set it do - // we transparently decode the gzip. - addedGzip bool -} - -func (pc *persistConn) roundTrip(req *transportRequest) (resp *http.Response, err error) { - if pc.mutateHeaderFunc != nil { - panic("mutateHeaderFunc not supported in modified Transport") - pc.mutateHeaderFunc(req.extraHeaders()) - } - - // Ask for a compressed version if the caller didn't set their - // own value for Accept-Encoding. We only attempted to - // uncompress the gzip stream if we were the layer that - // requested it. - requestedGzip := false - if !pc.t.DisableCompression && req.Header.Get("Accept-Encoding") == "" { - // Request gzip only, not deflate. Deflate is ambiguous and - // not as universally supported anyway. - // See: http://www.gzip.org/zlib/zlib_faq.html#faq38 - requestedGzip = true - req.extraHeaders().Set("Accept-Encoding", "gzip") - } - - pc.lk.Lock() - pc.numExpectedResponses++ - pc.lk.Unlock() - - // orig: err = req.Request.write(pc.bw, pc.isProxy, req.extra) - if pc.isProxy { - err = req.Request.WriteProxy(pc.bw) - } else { - err = req.Request.Write(pc.bw) - } - if err != nil { - pc.close() - return - } - pc.bw.Flush() - - ch := make(chan responseAndError, 1) - pc.reqch <- requestAndChan{req.Request, ch, requestedGzip} - re := <-ch - pc.lk.Lock() - pc.numExpectedResponses-- - pc.lk.Unlock() - - return re.res, re.err -} - -func (pc *persistConn) close() { - pc.lk.Lock() - defer pc.lk.Unlock() - pc.closeLocked() -} - -func (pc *persistConn) closeLocked() { - pc.broken = true - pc.conn.Close() - pc.mutateHeaderFunc = nil -} - -var portMap = map[string]string{ - "http": "80", - "https": "443", -} - -// canonicalAddr returns url.Host but always with a ":port" suffix -func canonicalAddr(url *url.URL) string { - addr := url.Host - if !hasPort(addr) { - return addr + ":" + portMap[url.Scheme] - } - return addr -} - -func responseIsKeepAlive(res *http.Response) bool { - // TODO: implement. for now just always shutting down the connection. - return false -} - -// bodyEOFSignal wraps a ReadCloser but runs fn (if non-nil) at most -// once, right before the final Read() or Close() call returns, but after -// EOF has been seen. -type bodyEOFSignal struct { - body io.ReadCloser - fn func() - isClosed bool -} - -func (es *bodyEOFSignal) Read(p []byte) (n int, err error) { - n, err = es.body.Read(p) - if es.isClosed && n > 0 { - panic("http: unexpected bodyEOFSignal Read after Close; see issue 1725") - } - if err == io.EOF && es.fn != nil { - es.fn() - es.fn = nil - } - return -} - -func (es *bodyEOFSignal) Close() (err error) { - if es.isClosed { - return nil - } - es.isClosed = true - err = es.body.Close() - if err == nil && es.fn != nil { - es.fn() - es.fn = nil - } - return -} - -type readFirstCloseBoth struct { - io.ReadCloser - io.Closer -} - -func (r *readFirstCloseBoth) Close() error { - if err := r.ReadCloser.Close(); err != nil { - r.Closer.Close() - return err - } - if err := r.Closer.Close(); err != nil { - return err - } - return nil -} - -// discardOnCloseReadCloser consumes all its input on Close. -type discardOnCloseReadCloser struct { - io.ReadCloser -} - -func (d *discardOnCloseReadCloser) Close() error { - io.Copy(ioutil.Discard, d.ReadCloser) // ignore errors; likely invalid or already closed - return d.ReadCloser.Close() -} diff --git a/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/util.go b/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/util.go deleted file mode 100644 index af0eda1..0000000 --- a/src/imagemagick/vendor/github.com/elazarl/goproxy/transport/util.go +++ /dev/null @@ -1,15 +0,0 @@ -package transport - -import ( - "fmt" - "strings" -) - -type badStringError struct { - what string - str string -} - -func (e *badStringError) Error() string { return fmt.Sprintf("%s %q", e.what, e.str) } - -func hasPort(s string) bool { return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") } diff --git a/src/imagemagick/vendor/github.com/google/subcommands/CONTRIBUTING b/src/imagemagick/vendor/github.com/google/subcommands/CONTRIBUTING deleted file mode 100644 index 2827b7d..0000000 --- a/src/imagemagick/vendor/github.com/google/subcommands/CONTRIBUTING +++ /dev/null @@ -1,27 +0,0 @@ -Want to contribute? Great! First, read this page (including the small print at the end). - -### Before you contribute -Before we can use your code, you must sign the -[Google Individual Contributor License Agreement] -(https://cla.developers.google.com/about/google-individual) -(CLA), which you can do online. The CLA is necessary mainly because you own the -copyright to your changes, even after your contribution becomes part of our -codebase, so we need your permission to use and distribute your code. We also -need to be sure of various other things—for instance that you'll tell us if you -know that your code infringes on other people's patents. You don't have to sign -the CLA until after you've submitted your code for review and a member has -approved it, but you must do it before we can put your code into our codebase. -Before you start working on a larger contribution, you should get in touch with -us first through the issue tracker with your idea so that we can help out and -possibly guide you. Coordinating up front makes it much easier to avoid -frustration later on. - -### Code reviews -All submissions, including submissions by project members, require review. We -use Github pull requests for this purpose. - -### The small print -Contributions made by corporations are covered by a different agreement than -the one above, the -[Software Grant and Corporate Contributor License Agreement] -(https://cla.developers.google.com/about/google-corporate). diff --git a/src/imagemagick/vendor/github.com/google/subcommands/LICENSE b/src/imagemagick/vendor/github.com/google/subcommands/LICENSE deleted file mode 100644 index d645695..0000000 --- a/src/imagemagick/vendor/github.com/google/subcommands/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/imagemagick/vendor/github.com/google/subcommands/README.md b/src/imagemagick/vendor/github.com/google/subcommands/README.md deleted file mode 100644 index c769745..0000000 --- a/src/imagemagick/vendor/github.com/google/subcommands/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# subcommands # - -[![GoDoc](https://godoc.org/github.com/google/subcommands?status.svg)](https://godoc.org/github.com/google/subcommands) -Subcommands is a Go package that implements a simple way for a single command to -have many subcommands, each of which takes arguments and so forth. - -This is not an official Google product. - -## Usage ## - -Set up a 'print' subcommand: - -```go -import ( - "context" - "flag" - "fmt" - "os" - "strings" - - "github.com/google/subcommands" -) - -type printCmd struct { - capitalize bool -} - -func (*printCmd) Name() string { return "print" } -func (*printCmd) Synopsis() string { return "Print args to stdout." } -func (*printCmd) Usage() string { - return `print [-capitalize] : - Print args to stdout. -` -} - -func (p *printCmd) SetFlags(f *flag.FlagSet) { - f.BoolVar(&p.capitalize, "capitalize", false, "capitalize output") -} - -func (p *printCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { - for _, arg := range f.Args() { - if p.capitalize { - arg = strings.ToUpper(arg) - } - fmt.Printf("%s ", arg) - } - fmt.Println() - return subcommands.ExitSuccess -} -``` - -Register using the default Commander, also use some built in subcommands, -finally run Execute using ExitStatus as the exit code: - -```go -func main() { - subcommands.Register(subcommands.HelpCommand(), "") - subcommands.Register(subcommands.FlagsCommand(), "") - subcommands.Register(subcommands.CommandsCommand(), "") - subcommands.Register(&printCmd{}, "") - - flag.Parse() - ctx := context.Background() - os.Exit(int(subcommands.Execute(ctx))) -} -``` - diff --git a/src/imagemagick/vendor/github.com/google/subcommands/go.mod b/src/imagemagick/vendor/github.com/google/subcommands/go.mod deleted file mode 100644 index f502431..0000000 --- a/src/imagemagick/vendor/github.com/google/subcommands/go.mod +++ /dev/null @@ -1 +0,0 @@ -module github.com/google/subcommands diff --git a/src/imagemagick/vendor/github.com/google/subcommands/subcommands.go b/src/imagemagick/vendor/github.com/google/subcommands/subcommands.go deleted file mode 100644 index 9cb98e5..0000000 --- a/src/imagemagick/vendor/github.com/google/subcommands/subcommands.go +++ /dev/null @@ -1,440 +0,0 @@ -/* -Copyright 2016 Google Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package subcommands implements a simple way for a single command to have many -// subcommands, each of which takes arguments and so forth. -package subcommands - -import ( - "context" - "flag" - "fmt" - "io" - "os" - "path" - "sort" - "strings" -) - -// A Command represents a single command. -type Command interface { - // Name returns the name of the command. - Name() string - - // Synopsis returns a short string (less than one line) describing the command. - Synopsis() string - - // Usage returns a long string explaining the command and giving usage - // information. - Usage() string - - // SetFlags adds the flags for this command to the specified set. - SetFlags(*flag.FlagSet) - - // Execute executes the command and returns an ExitStatus. - Execute(ctx context.Context, f *flag.FlagSet, args ...interface{}) ExitStatus -} - -// A Commander represents a set of commands. -type Commander struct { - commands []*commandGroup - topFlags *flag.FlagSet // top-level flags - important []string // important top-level flags - name string // normally path.Base(os.Args[0]) - - Output io.Writer // Output specifies where the commander should write its output (default: os.Stdout). - Error io.Writer // Error specifies where the commander should write its error (default: os.Stderr). -} - -// A commandGroup represents a set of commands about a common topic. -type commandGroup struct { - name string - commands []Command -} - -// An ExitStatus represents a Posix exit status that a subcommand -// expects to be returned to the shell. -type ExitStatus int - -const ( - ExitSuccess ExitStatus = iota - ExitFailure - ExitUsageError -) - -// NewCommander returns a new commander with the specified top-level -// flags and command name. The Usage function for the topLevelFlags -// will be set as well. -func NewCommander(topLevelFlags *flag.FlagSet, name string) *Commander { - cdr := &Commander{ - topFlags: topLevelFlags, - name: name, - Output: os.Stdout, - Error: os.Stderr, - } - topLevelFlags.Usage = func() { cdr.explain(cdr.Error) } - return cdr -} - -// Register adds a subcommand to the supported subcommands in the -// specified group. (Help output is sorted and arranged by group name.) -// The empty string is an acceptable group name; such subcommands are -// explained first before named groups. -func (cdr *Commander) Register(cmd Command, group string) { - for _, g := range cdr.commands { - if g.name == group { - g.commands = append(g.commands, cmd) - return - } - } - cdr.commands = append(cdr.commands, &commandGroup{ - name: group, - commands: []Command{cmd}, - }) -} - -// ImportantFlag marks a top-level flag as important, which means it -// will be printed out as part of the output of an ordinary "help" -// subcommand. (All flags, important or not, are printed by the -// "flags" subcommand.) -func (cdr *Commander) ImportantFlag(name string) { - cdr.important = append(cdr.important, name) -} - -// Execute should be called once the top-level-flags on a Commander -// have been initialized. It finds the correct subcommand and executes -// it, and returns an ExitStatus with the result. On a usage error, an -// appropriate message is printed to os.Stderr, and ExitUsageError is -// returned. The additional args are provided as-is to the Execute method -// of the selected Command. -func (cdr *Commander) Execute(ctx context.Context, args ...interface{}) ExitStatus { - if cdr.topFlags.NArg() < 1 { - cdr.topFlags.Usage() - return ExitUsageError - } - - name := cdr.topFlags.Arg(0) - - for _, group := range cdr.commands { - for _, cmd := range group.commands { - if name != cmd.Name() { - continue - } - f := flag.NewFlagSet(name, flag.ContinueOnError) - f.Usage = func() { explain(cdr.Error, cmd) } - cmd.SetFlags(f) - if f.Parse(cdr.topFlags.Args()[1:]) != nil { - return ExitUsageError - } - return cmd.Execute(ctx, f, args...) - } - } - - // Cannot find this command. - cdr.topFlags.Usage() - return ExitUsageError -} - -// Sorting of a slice of command groups. -type byGroupName []*commandGroup - -func (p byGroupName) Len() int { return len(p) } -func (p byGroupName) Less(i, j int) bool { return p[i].name < p[j].name } -func (p byGroupName) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// explain prints a brief description of all the subcommands and the -// important top-level flags. -func (cdr *Commander) explain(w io.Writer) { - fmt.Fprintf(w, "Usage: %s \n\n", cdr.name) - sort.Sort(byGroupName(cdr.commands)) - for _, group := range cdr.commands { - explainGroup(w, group) - } - if cdr.topFlags == nil { - fmt.Fprintln(w, "\nNo top level flags.") - return - } - if len(cdr.important) == 0 { - fmt.Fprintf(w, "\nUse \"%s flags\" for a list of top-level flags\n", cdr.name) - return - } - - fmt.Fprintf(w, "\nTop-level flags (use \"%s flags\" for a full list):\n", cdr.name) - for _, name := range cdr.important { - f := cdr.topFlags.Lookup(name) - if f == nil { - panic(fmt.Sprintf("Important flag (%s) is not defined", name)) - } - fmt.Fprintf(w, " -%s=%s: %s\n", f.Name, f.DefValue, f.Usage) - } -} - -// Sorting of the commands within a group. -func (g commandGroup) Len() int { return len(g.commands) } -func (g commandGroup) Less(i, j int) bool { return g.commands[i].Name() < g.commands[j].Name() } -func (g commandGroup) Swap(i, j int) { g.commands[i], g.commands[j] = g.commands[j], g.commands[i] } - -// explainGroup explains all the subcommands for a particular group. -func explainGroup(w io.Writer, group *commandGroup) { - if len(group.commands) == 0 { - return - } - if group.name == "" { - fmt.Fprintf(w, "Subcommands:\n") - } else { - fmt.Fprintf(w, "Subcommands for %s:\n", group.name) - } - sort.Sort(group) - - aliases := make(map[string][]string) - for _, cmd := range group.commands { - if alias, ok := cmd.(*aliaser); ok { - root := dealias(alias).Name() - - if _, ok := aliases[root]; !ok { - aliases[root] = []string{} - } - aliases[root] = append(aliases[root], alias.Name()) - } - } - - for _, cmd := range group.commands { - if _, ok := cmd.(*aliaser); ok { - continue - } - - name := cmd.Name() - names := []string{name} - - if a, ok := aliases[name]; ok { - names = append(names, a...) - } - - fmt.Fprintf(w, "\t%-15s %s\n", strings.Join(names, ", "), cmd.Synopsis()) - } - fmt.Fprintln(w) -} - -// explainCmd prints a brief description of a single command. -func explain(w io.Writer, cmd Command) { - fmt.Fprintf(w, "%s", cmd.Usage()) - subflags := flag.NewFlagSet(cmd.Name(), flag.PanicOnError) - subflags.SetOutput(w) - cmd.SetFlags(subflags) - subflags.PrintDefaults() -} - -// A helper is a Command implementing a "help" command for -// a given Commander. -type helper Commander - -func (h *helper) Name() string { return "help" } -func (h *helper) Synopsis() string { return "describe subcommands and their syntax" } -func (h *helper) SetFlags(*flag.FlagSet) {} -func (h *helper) Usage() string { - return `help []: - With an argument, prints detailed information on the use of - the specified subcommand. With no argument, print a list of - all commands and a brief description of each. -` -} -func (h *helper) Execute(_ context.Context, f *flag.FlagSet, args ...interface{}) ExitStatus { - switch f.NArg() { - case 0: - (*Commander)(h).explain(h.Output) - return ExitSuccess - - case 1: - for _, group := range h.commands { - for _, cmd := range group.commands { - if f.Arg(0) != cmd.Name() { - continue - } - explain(h.Output, cmd) - return ExitSuccess - } - } - fmt.Fprintf(h.Error, "Subcommand %s not understood\n", f.Arg(0)) - } - - f.Usage() - return ExitUsageError -} - -// HelpCommand returns a Command which implements a "help" subcommand. -func (cdr *Commander) HelpCommand() Command { - return (*helper)(cdr) -} - -// A flagger is a Command implementing a "flags" command for a given Commander. -type flagger Commander - -func (flg *flagger) Name() string { return "flags" } -func (flg *flagger) Synopsis() string { return "describe all known top-level flags" } -func (flg *flagger) SetFlags(*flag.FlagSet) {} -func (flg *flagger) Usage() string { - return `flags []: - With an argument, print all flags of . Else, - print a description of all known top-level flags. (The basic - help information only discusses the most generally important - top-level flags.) -` -} -func (flg *flagger) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) ExitStatus { - if f.NArg() > 1 { - f.Usage() - return ExitUsageError - } - - if f.NArg() == 0 { - if flg.topFlags == nil { - fmt.Fprintln(flg.Output, "No top-level flags are defined.") - } else { - flg.topFlags.PrintDefaults() - } - return ExitSuccess - } - - for _, group := range flg.commands { - for _, cmd := range group.commands { - if f.Arg(0) != cmd.Name() { - continue - } - subflags := flag.NewFlagSet(cmd.Name(), flag.PanicOnError) - subflags.SetOutput(flg.Output) - cmd.SetFlags(subflags) - subflags.PrintDefaults() - return ExitSuccess - } - } - fmt.Fprintf(flg.Error, "Subcommand %s not understood\n", f.Arg(0)) - return ExitFailure -} - -// FlagsCommand returns a Command which implements a "flags" subcommand. -func (cdr *Commander) FlagsCommand() Command { - return (*flagger)(cdr) -} - -// A lister is a Command implementing a "commands" command for a given Commander. -type lister Commander - -func (l *lister) Name() string { return "commands" } -func (l *lister) Synopsis() string { return "list all command names" } -func (l *lister) SetFlags(*flag.FlagSet) {} -func (l *lister) Usage() string { - return `commands: - Print a list of all commands. -` -} -func (l *lister) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) ExitStatus { - if f.NArg() != 0 { - f.Usage() - return ExitUsageError - } - - for _, group := range l.commands { - for _, cmd := range group.commands { - fmt.Fprintf(l.Output, "%s\n", cmd.Name()) - } - } - return ExitSuccess -} - -// CommandsCommand returns Command which implements a "commands" subcommand. -func (cdr *Commander) CommandsCommand() Command { - return (*lister)(cdr) -} - -// An aliaser is a Command wrapping another Command but returning a -// different name as its alias. -type aliaser struct { - alias string - Command -} - -func (a *aliaser) Name() string { return a.alias } - -// Alias returns a Command alias which implements a "commands" subcommand. -func Alias(alias string, cmd Command) Command { - return &aliaser{alias, cmd} -} - -// dealias recursivly dealiases a command until a non-aliased command -// is reached. -func dealias(cmd Command) Command { - if alias, ok := cmd.(*aliaser); ok { - return dealias(alias.Command) - } - - return cmd -} - -// DefaultCommander is the default commander using flag.CommandLine for flags -// and os.Args[0] for the command name. -var DefaultCommander *Commander - -func init() { - DefaultCommander = NewCommander(flag.CommandLine, path.Base(os.Args[0])) -} - -// Register adds a subcommand to the supported subcommands in the -// specified group. (Help output is sorted and arranged by group -// name.) The empty string is an acceptable group name; such -// subcommands are explained first before named groups. It is a -// wrapper around DefaultCommander.Register. -func Register(cmd Command, group string) { - DefaultCommander.Register(cmd, group) -} - -// ImportantFlag marks a top-level flag as important, which means it -// will be printed out as part of the output of an ordinary "help" -// subcommand. (All flags, important or not, are printed by the -// "flags" subcommand.) It is a wrapper around -// DefaultCommander.ImportantFlag. -func ImportantFlag(name string) { - DefaultCommander.ImportantFlag(name) -} - -// Execute should be called once the default flags have been -// initialized by flag.Parse. It finds the correct subcommand and -// executes it, and returns an ExitStatus with the result. On a usage -// error, an appropriate message is printed to os.Stderr, and -// ExitUsageError is returned. The additional args are provided as-is -// to the Execute method of the selected Command. It is a wrapper -// around DefaultCommander.Execute. -func Execute(ctx context.Context, args ...interface{}) ExitStatus { - return DefaultCommander.Execute(ctx, args...) -} - -// HelpCommand returns a Command which implements "help" for the -// DefaultCommander. Use Register(HelpCommand(), ) for it to be -// recognized. -func HelpCommand() Command { - return DefaultCommander.HelpCommand() -} - -// FlagsCommand returns a Command which implements "flags" for the -// DefaultCommander. Use Register(FlagsCommand(), ) for it to be -// recognized. -func FlagsCommand() Command { - return DefaultCommander.FlagsCommand() -} - -// CommandsCommand returns Command which implements a "commands" subcommand. -func CommandsCommand() Command { - return DefaultCommander.CommandsCommand() -} diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Godeps.json b/src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Godeps.json deleted file mode 100644 index 904ea80..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Godeps.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "ImportPath": "github.com/hpcloud/tail", - "GoVersion": "go1.5.1", - "Deps": [ - { - "ImportPath": "gopkg.in/fsnotify.v1", - "Comment": "v1.2.1", - "Rev": "7be54206639f256967dd82fa767397ba5f8f48f5" - }, - { - "ImportPath": "gopkg.in/tomb.v1", - "Rev": "c131134a1947e9afd9cecfe11f4c6dff0732ae58" - } - ] -} diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Readme b/src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Readme deleted file mode 100644 index 4cdaa53..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/Godeps/Readme +++ /dev/null @@ -1,5 +0,0 @@ -This directory tree is generated automatically by godep. - -Please do not edit. - -See https://github.com/tools/godep for more information. diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/.gitignore b/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/.gitignore deleted file mode 100644 index 6249af5..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/.gitignore +++ /dev/null @@ -1 +0,0 @@ -gotail diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/Makefile b/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/Makefile deleted file mode 100644 index 6b5a2d9..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -default: gotail - -gotail: *.go ../../*.go - go build diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/gotail.go b/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/gotail.go deleted file mode 100644 index 3da55f2..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/cmd/gotail/gotail.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2015 HPE Software Inc. All rights reserved. -// Copyright (c) 2013 ActiveState Software Inc. All rights reserved. - -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/hpcloud/tail" -) - -func args2config() (tail.Config, int64) { - config := tail.Config{Follow: true} - n := int64(0) - maxlinesize := int(0) - flag.Int64Var(&n, "n", 0, "tail from the last Nth location") - flag.IntVar(&maxlinesize, "max", 0, "max line size") - flag.BoolVar(&config.Follow, "f", false, "wait for additional data to be appended to the file") - flag.BoolVar(&config.ReOpen, "F", false, "follow, and track file rename/rotation") - flag.BoolVar(&config.Poll, "p", false, "use polling, instead of inotify") - flag.Parse() - if config.ReOpen { - config.Follow = true - } - config.MaxLineSize = maxlinesize - return config, n -} - -func main() { - config, n := args2config() - if flag.NFlag() < 1 { - fmt.Println("need one or more files as arguments") - os.Exit(1) - } - - if n != 0 { - config.Location = &tail.SeekInfo{-n, os.SEEK_END} - } - - done := make(chan bool) - for _, filename := range flag.Args() { - go tailFile(filename, config, done) - } - - for _, _ = range flag.Args() { - <-done - } -} - -func tailFile(filename string, config tail.Config, done chan bool) { - defer func() { done <- true }() - t, err := tail.TailFile(filename, config) - if err != nil { - fmt.Println(err) - return - } - for line := range t.Lines { - fmt.Println(line.Text) - } - err = t.Wait() - if err != nil { - fmt.Println(err) - } -} diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket_test.go b/src/imagemagick/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket_test.go deleted file mode 100644 index b43dddb..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/ratelimiter/leakybucket_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package ratelimiter - -import ( - "testing" - "time" -) - -func TestPour(t *testing.T) { - bucket := NewLeakyBucket(60, time.Second) - bucket.Lastupdate = time.Unix(0, 0) - - bucket.Now = func() time.Time { return time.Unix(1, 0) } - - if bucket.Pour(61) { - t.Error("Expected false") - } - - if !bucket.Pour(10) { - t.Error("Expected true") - } - - if !bucket.Pour(49) { - t.Error("Expected true") - } - - if bucket.Pour(2) { - t.Error("Expected false") - } - - bucket.Now = func() time.Time { return time.Unix(61, 0) } - if !bucket.Pour(60) { - t.Error("Expected true") - } - - if bucket.Pour(1) { - t.Error("Expected false") - } - - bucket.Now = func() time.Time { return time.Unix(70, 0) } - - if !bucket.Pour(1) { - t.Error("Expected true") - } - -} - -func TestTimeSinceLastUpdate(t *testing.T) { - bucket := NewLeakyBucket(60, time.Second) - bucket.Now = func() time.Time { return time.Unix(1, 0) } - bucket.Pour(1) - bucket.Now = func() time.Time { return time.Unix(2, 0) } - - sinceLast := bucket.TimeSinceLastUpdate() - if sinceLast != time.Second*1 { - t.Errorf("Expected time since last update to be less than 1 second, got %d", sinceLast) - } -} - -func TestTimeToDrain(t *testing.T) { - bucket := NewLeakyBucket(60, time.Second) - bucket.Now = func() time.Time { return time.Unix(1, 0) } - bucket.Pour(10) - - if bucket.TimeToDrain() != time.Second*10 { - t.Error("Time to drain should be 10 seconds") - } - - bucket.Now = func() time.Time { return time.Unix(2, 0) } - - if bucket.TimeToDrain() != time.Second*9 { - t.Error("Time to drain should be 9 seconds") - } -} diff --git a/src/imagemagick/vendor/github.com/hpcloud/tail/tail_test.go b/src/imagemagick/vendor/github.com/hpcloud/tail/tail_test.go deleted file mode 100644 index 8dcc02c..0000000 --- a/src/imagemagick/vendor/github.com/hpcloud/tail/tail_test.go +++ /dev/null @@ -1,521 +0,0 @@ -// Copyright (c) 2015 HPE Software Inc. All rights reserved. -// Copyright (c) 2013 ActiveState Software Inc. All rights reserved. - -// TODO: -// * repeat all the tests with Poll:true - -package tail - -import ( - _ "fmt" - "io/ioutil" - "os" - "strings" - "testing" - "time" - - "github.com/hpcloud/tail/ratelimiter" - "github.com/hpcloud/tail/watch" -) - -func init() { - // Clear the temporary test directory - err := os.RemoveAll(".test") - if err != nil { - panic(err) - } -} - -func TestMain(m *testing.M) { - // Use a smaller poll duration for faster test runs. Keep it below - // 100ms (which value is used as common delays for tests) - watch.POLL_DURATION = 5 * time.Millisecond - os.Exit(m.Run()) -} - -func TestMustExist(t *testing.T) { - tail, err := TailFile("/no/such/file", Config{Follow: true, MustExist: true}) - if err == nil { - t.Error("MustExist:true is violated") - tail.Stop() - } - tail, err = TailFile("/no/such/file", Config{Follow: true, MustExist: false}) - if err != nil { - t.Error("MustExist:false is violated") - } - tail.Stop() - _, err = TailFile("README.md", Config{Follow: true, MustExist: true}) - if err != nil { - t.Error("MustExist:true on an existing file is violated") - } - tail.Cleanup() -} - -func TestWaitsForFileToExist(t *testing.T) { - tailTest := NewTailTest("waits-for-file-to-exist", t) - tail := tailTest.StartTail("test.txt", Config{}) - go tailTest.VerifyTailOutput(tail, []string{"hello", "world"}, false) - - <-time.After(100 * time.Millisecond) - tailTest.CreateFile("test.txt", "hello\nworld\n") - tailTest.Cleanup(tail, true) -} - -func TestWaitsForFileToExistRelativePath(t *testing.T) { - tailTest := NewTailTest("waits-for-file-to-exist-relative", t) - - oldWD, err := os.Getwd() - if err != nil { - tailTest.Fatal(err) - } - os.Chdir(tailTest.path) - defer os.Chdir(oldWD) - - tail, err := TailFile("test.txt", Config{}) - if err != nil { - tailTest.Fatal(err) - } - - go tailTest.VerifyTailOutput(tail, []string{"hello", "world"}, false) - - <-time.After(100 * time.Millisecond) - if err := ioutil.WriteFile("test.txt", []byte("hello\nworld\n"), 0600); err != nil { - tailTest.Fatal(err) - } - tailTest.Cleanup(tail, true) -} - -func TestStop(t *testing.T) { - tail, err := TailFile("_no_such_file", Config{Follow: true, MustExist: false}) - if err != nil { - t.Error("MustExist:false is violated") - } - if tail.Stop() != nil { - t.Error("Should be stoped successfully") - } - tail.Cleanup() -} - -func TestStopAtEOF(t *testing.T) { - tailTest := NewTailTest("maxlinesize", t) - tailTest.CreateFile("test.txt", "hello\nthere\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: true, Location: nil}) - - // read "hello" - line := <-tail.Lines - if line.Text != "hello" { - t.Errorf("Expected to get 'hello', got '%s' instead", line.Text) - } - - tailTest.VerifyTailOutput(tail, []string{"there", "world"}, false) - tail.StopAtEOF() - tailTest.Cleanup(tail, true) -} - -func TestMaxLineSizeFollow(t *testing.T) { - // As last file line does not end with newline, it will not be present in tail's output - maxLineSize(t, true, "hello\nworld\nfin\nhe", []string{"hel", "lo", "wor", "ld", "fin"}) -} - -func TestMaxLineSizeNoFollow(t *testing.T) { - maxLineSize(t, false, "hello\nworld\nfin\nhe", []string{"hel", "lo", "wor", "ld", "fin", "he"}) -} - -func TestOver4096ByteLine(t *testing.T) { - tailTest := NewTailTest("Over4096ByteLine", t) - testString := strings.Repeat("a", 4097) - tailTest.CreateFile("test.txt", "test\n"+testString+"\nhello\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: true, Location: nil}) - go tailTest.VerifyTailOutput(tail, []string{"test", testString, "hello", "world"}, false) - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - tailTest.Cleanup(tail, true) -} -func TestOver4096ByteLineWithSetMaxLineSize(t *testing.T) { - tailTest := NewTailTest("Over4096ByteLineMaxLineSize", t) - testString := strings.Repeat("a", 4097) - tailTest.CreateFile("test.txt", "test\n"+testString+"\nhello\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: true, Location: nil, MaxLineSize: 4097}) - go tailTest.VerifyTailOutput(tail, []string{"test", testString, "hello", "world"}, false) - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - tailTest.Cleanup(tail, true) -} - -func TestLocationFull(t *testing.T) { - tailTest := NewTailTest("location-full", t) - tailTest.CreateFile("test.txt", "hello\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: true, Location: nil}) - go tailTest.VerifyTailOutput(tail, []string{"hello", "world"}, false) - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - tailTest.Cleanup(tail, true) -} - -func TestLocationFullDontFollow(t *testing.T) { - tailTest := NewTailTest("location-full-dontfollow", t) - tailTest.CreateFile("test.txt", "hello\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: false, Location: nil}) - go tailTest.VerifyTailOutput(tail, []string{"hello", "world"}, false) - - // Add more data only after reasonable delay. - <-time.After(100 * time.Millisecond) - tailTest.AppendFile("test.txt", "more\ndata\n") - <-time.After(100 * time.Millisecond) - - tailTest.Cleanup(tail, true) -} - -func TestLocationEnd(t *testing.T) { - tailTest := NewTailTest("location-end", t) - tailTest.CreateFile("test.txt", "hello\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: true, Location: &SeekInfo{0, os.SEEK_END}}) - go tailTest.VerifyTailOutput(tail, []string{"more", "data"}, false) - - <-time.After(100 * time.Millisecond) - tailTest.AppendFile("test.txt", "more\ndata\n") - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - tailTest.Cleanup(tail, true) -} - -func TestLocationMiddle(t *testing.T) { - // Test reading from middle. - tailTest := NewTailTest("location-middle", t) - tailTest.CreateFile("test.txt", "hello\nworld\n") - tail := tailTest.StartTail("test.txt", Config{Follow: true, Location: &SeekInfo{-6, os.SEEK_END}}) - go tailTest.VerifyTailOutput(tail, []string{"world", "more", "data"}, false) - - <-time.After(100 * time.Millisecond) - tailTest.AppendFile("test.txt", "more\ndata\n") - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - tailTest.Cleanup(tail, true) -} - -// The use of polling file watcher could affect file rotation -// (detected via renames), so test these explicitly. - -func TestReOpenInotify(t *testing.T) { - reOpen(t, false) -} - -func TestReOpenPolling(t *testing.T) { - reOpen(t, true) -} - -// The use of polling file watcher could affect file rotation -// (detected via renames), so test these explicitly. - -func TestReSeekInotify(t *testing.T) { - reSeek(t, false) -} - -func TestReSeekPolling(t *testing.T) { - reSeek(t, true) -} - -func TestRateLimiting(t *testing.T) { - tailTest := NewTailTest("rate-limiting", t) - tailTest.CreateFile("test.txt", "hello\nworld\nagain\nextra\n") - config := Config{ - Follow: true, - RateLimiter: ratelimiter.NewLeakyBucket(2, time.Second)} - leakybucketFull := "Too much log activity; waiting a second before resuming tailing" - tail := tailTest.StartTail("test.txt", config) - - // TODO: also verify that tail resumes after the cooloff period. - go tailTest.VerifyTailOutput(tail, []string{ - "hello", "world", "again", - leakybucketFull, - "more", "data", - leakybucketFull}, false) - - // Add more data only after reasonable delay. - <-time.After(1200 * time.Millisecond) - tailTest.AppendFile("test.txt", "more\ndata\n") - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - - tailTest.Cleanup(tail, true) -} - -func TestTell(t *testing.T) { - tailTest := NewTailTest("tell-position", t) - tailTest.CreateFile("test.txt", "hello\nworld\nagain\nmore\n") - config := Config{ - Follow: false, - Location: &SeekInfo{0, os.SEEK_SET}} - tail := tailTest.StartTail("test.txt", config) - // read noe line - <-tail.Lines - offset, err := tail.Tell() - if err != nil { - tailTest.Errorf("Tell return error: %s", err.Error()) - } - tail.Done() - // tail.close() - - config = Config{ - Follow: false, - Location: &SeekInfo{offset, os.SEEK_SET}} - tail = tailTest.StartTail("test.txt", config) - for l := range tail.Lines { - // it may readed one line in the chan(tail.Lines), - // so it may lost one line. - if l.Text != "world" && l.Text != "again" { - tailTest.Fatalf("mismatch; expected world or again, but got %s", - l.Text) - } - break - } - tailTest.RemoveFile("test.txt") - tail.Done() - tail.Cleanup() -} - -func TestBlockUntilExists(t *testing.T) { - tailTest := NewTailTest("block-until-file-exists", t) - config := Config{ - Follow: true, - } - tail := tailTest.StartTail("test.txt", config) - go func() { - time.Sleep(100 * time.Millisecond) - tailTest.CreateFile("test.txt", "hello world\n") - }() - for l := range tail.Lines { - if l.Text != "hello world" { - tailTest.Fatalf("mismatch; expected hello world, but got %s", - l.Text) - } - break - } - tailTest.RemoveFile("test.txt") - tail.Stop() - tail.Cleanup() -} - -func maxLineSize(t *testing.T, follow bool, fileContent string, expected []string) { - tailTest := NewTailTest("maxlinesize", t) - tailTest.CreateFile("test.txt", fileContent) - tail := tailTest.StartTail("test.txt", Config{Follow: follow, Location: nil, MaxLineSize: 3}) - go tailTest.VerifyTailOutput(tail, expected, false) - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - tailTest.Cleanup(tail, true) -} - -func reOpen(t *testing.T, poll bool) { - var name string - var delay time.Duration - if poll { - name = "reopen-polling" - delay = 300 * time.Millisecond // account for POLL_DURATION - } else { - name = "reopen-inotify" - delay = 100 * time.Millisecond - } - tailTest := NewTailTest(name, t) - tailTest.CreateFile("test.txt", "hello\nworld\n") - tail := tailTest.StartTail( - "test.txt", - Config{Follow: true, ReOpen: true, Poll: poll}) - content := []string{"hello", "world", "more", "data", "endofworld"} - go tailTest.ReadLines(tail, content) - - // deletion must trigger reopen - <-time.After(delay) - tailTest.RemoveFile("test.txt") - <-time.After(delay) - tailTest.CreateFile("test.txt", "more\ndata\n") - - // rename must trigger reopen - <-time.After(delay) - tailTest.RenameFile("test.txt", "test.txt.rotated") - <-time.After(delay) - tailTest.CreateFile("test.txt", "endofworld\n") - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(delay) - tailTest.RemoveFile("test.txt") - <-time.After(delay) - - // Do not bother with stopping as it could kill the tomb during - // the reading of data written above. Timings can vary based on - // test environment. - tail.Cleanup() -} - -func reSeek(t *testing.T, poll bool) { - var name string - if poll { - name = "reseek-polling" - } else { - name = "reseek-inotify" - } - tailTest := NewTailTest(name, t) - tailTest.CreateFile("test.txt", "a really long string goes here\nhello\nworld\n") - tail := tailTest.StartTail( - "test.txt", - Config{Follow: true, ReOpen: false, Poll: poll}) - - go tailTest.VerifyTailOutput(tail, []string{ - "a really long string goes here", "hello", "world", "h311o", "w0r1d", "endofworld"}, false) - - // truncate now - <-time.After(100 * time.Millisecond) - tailTest.TruncateFile("test.txt", "h311o\nw0r1d\nendofworld\n") - - // Delete after a reasonable delay, to give tail sufficient time - // to read all lines. - <-time.After(100 * time.Millisecond) - tailTest.RemoveFile("test.txt") - - // Do not bother with stopping as it could kill the tomb during - // the reading of data written above. Timings can vary based on - // test environment. - tailTest.Cleanup(tail, false) -} - -// Test library - -type TailTest struct { - Name string - path string - done chan struct{} - *testing.T -} - -func NewTailTest(name string, t *testing.T) TailTest { - tt := TailTest{name, ".test/" + name, make(chan struct{}), t} - err := os.MkdirAll(tt.path, os.ModeTemporary|0700) - if err != nil { - tt.Fatal(err) - } - - return tt -} - -func (t TailTest) CreateFile(name string, contents string) { - err := ioutil.WriteFile(t.path+"/"+name, []byte(contents), 0600) - if err != nil { - t.Fatal(err) - } -} - -func (t TailTest) RemoveFile(name string) { - err := os.Remove(t.path + "/" + name) - if err != nil { - t.Fatal(err) - } -} - -func (t TailTest) RenameFile(oldname string, newname string) { - oldname = t.path + "/" + oldname - newname = t.path + "/" + newname - err := os.Rename(oldname, newname) - if err != nil { - t.Fatal(err) - } -} - -func (t TailTest) AppendFile(name string, contents string) { - f, err := os.OpenFile(t.path+"/"+name, os.O_APPEND|os.O_WRONLY, 0600) - if err != nil { - t.Fatal(err) - } - defer f.Close() - _, err = f.WriteString(contents) - if err != nil { - t.Fatal(err) - } -} - -func (t TailTest) TruncateFile(name string, contents string) { - f, err := os.OpenFile(t.path+"/"+name, os.O_TRUNC|os.O_WRONLY, 0600) - if err != nil { - t.Fatal(err) - } - defer f.Close() - _, err = f.WriteString(contents) - if err != nil { - t.Fatal(err) - } -} - -func (t TailTest) StartTail(name string, config Config) *Tail { - tail, err := TailFile(t.path+"/"+name, config) - if err != nil { - t.Fatal(err) - } - return tail -} - -func (t TailTest) VerifyTailOutput(tail *Tail, lines []string, expectEOF bool) { - defer close(t.done) - t.ReadLines(tail, lines) - // It is important to do this if only EOF is expected - // otherwise we could block on <-tail.Lines - if expectEOF { - line, ok := <-tail.Lines - if ok { - t.Fatalf("more content from tail: %+v", line) - } - } -} - -func (t TailTest) ReadLines(tail *Tail, lines []string) { - for idx, line := range lines { - tailedLine, ok := <-tail.Lines - if !ok { - // tail.Lines is closed and empty. - err := tail.Err() - if err != nil { - t.Fatalf("tail ended with error: %v", err) - } - t.Fatalf("tail ended early; expecting more: %v", lines[idx:]) - } - if tailedLine == nil { - t.Fatalf("tail.Lines returned nil; not possible") - } - // Note: not checking .Err as the `lines` argument is designed - // to match error strings as well. - if tailedLine.Text != line { - t.Fatalf( - "unexpected line/err from tail: "+ - "expecting <<%s>>>, but got <<<%s>>>", - line, tailedLine.Text) - } - } -} - -func (t TailTest) Cleanup(tail *Tail, stop bool) { - <-t.done - if stop { - tail.Stop() - } - tail.Cleanup() -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table.go deleted file mode 100644 index ae8ab7d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table.go +++ /dev/null @@ -1,98 +0,0 @@ -/* - -Table provides a simple DSL for Ginkgo-native Table-Driven Tests - -The godoc documentation describes Table's API. More comprehensive documentation (with examples!) is available at http://onsi.github.io/ginkgo#table-driven-tests - -*/ - -package table - -import ( - "fmt" - "reflect" - - "github.com/onsi/ginkgo" -) - -/* -DescribeTable describes a table-driven test. - -For example: - - DescribeTable("a simple table", - func(x int, y int, expected bool) { - Ω(x > y).Should(Equal(expected)) - }, - Entry("x > y", 1, 0, true), - Entry("x == y", 0, 0, false), - Entry("x < y", 0, 1, false), - ) - -The first argument to `DescribeTable` is a string description. -The second argument is a function that will be run for each table entry. Your assertions go here - the function is equivalent to a Ginkgo It. -The subsequent arguments must be of type `TableEntry`. We recommend using the `Entry` convenience constructors. - -The `Entry` constructor takes a string description followed by an arbitrary set of parameters. These parameters are passed into your function. - -Under the hood, `DescribeTable` simply generates a new Ginkgo `Describe`. Each `Entry` is turned into an `It` within the `Describe`. - -It's important to understand that the `Describe`s and `It`s are generated at evaluation time (i.e. when Ginkgo constructs the tree of tests and before the tests run). - -Individual Entries can be focused (with FEntry) or marked pending (with PEntry or XEntry). In addition, the entire table can be focused or marked pending with FDescribeTable and PDescribeTable/XDescribeTable. -*/ -func DescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, false, false) - return true -} - -/* -You can focus a table with `FDescribeTable`. This is equivalent to `FDescribe`. -*/ -func FDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, false, true) - return true -} - -/* -You can mark a table as pending with `PDescribeTable`. This is equivalent to `PDescribe`. -*/ -func PDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, true, false) - return true -} - -/* -You can mark a table as pending with `XDescribeTable`. This is equivalent to `XDescribe`. -*/ -func XDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { - describeTable(description, itBody, entries, true, false) - return true -} - -func describeTable(description string, itBody interface{}, entries []TableEntry, pending bool, focused bool) { - itBodyValue := reflect.ValueOf(itBody) - if itBodyValue.Kind() != reflect.Func { - panic(fmt.Sprintf("DescribeTable expects a function, got %#v", itBody)) - } - - if pending { - ginkgo.PDescribe(description, func() { - for _, entry := range entries { - entry.generateIt(itBodyValue) - } - }) - } else if focused { - ginkgo.FDescribe(description, func() { - for _, entry := range entries { - entry.generateIt(itBodyValue) - } - }) - } else { - ginkgo.Describe(description, func() { - for _, entry := range entries { - entry.generateIt(itBodyValue) - } - }) - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go deleted file mode 100644 index 5fa645b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go +++ /dev/null @@ -1,81 +0,0 @@ -package table - -import ( - "reflect" - - "github.com/onsi/ginkgo" -) - -/* -TableEntry represents an entry in a table test. You generally use the `Entry` constructor. -*/ -type TableEntry struct { - Description string - Parameters []interface{} - Pending bool - Focused bool -} - -func (t TableEntry) generateIt(itBody reflect.Value) { - if t.Pending { - ginkgo.PIt(t.Description) - return - } - - values := []reflect.Value{} - for i, param := range t.Parameters { - var value reflect.Value - - if param == nil { - inType := itBody.Type().In(i) - value = reflect.Zero(inType) - } else { - value = reflect.ValueOf(param) - } - - values = append(values, value) - } - - body := func() { - itBody.Call(values) - } - - if t.Focused { - ginkgo.FIt(t.Description, body) - } else { - ginkgo.It(t.Description, body) - } -} - -/* -Entry constructs a TableEntry. - -The first argument is a required description (this becomes the content of the generated Ginkgo `It`). -Subsequent parameters are saved off and sent to the callback passed in to `DescribeTable`. - -Each Entry ends up generating an individual Ginkgo It. -*/ -func Entry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, false, false} -} - -/* -You can focus a particular entry with FEntry. This is equivalent to FIt. -*/ -func FEntry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, false, true} -} - -/* -You can mark a particular entry as pending with PEntry. This is equivalent to PIt. -*/ -func PEntry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, true, false} -} - -/* -You can mark a particular entry as pending with XEntry. This is equivalent to XIt. -*/ -func XEntry(description string, parameters ...interface{}) TableEntry { - return TableEntry{description, parameters, true, false} -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go deleted file mode 100644 index f482ec3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package table_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestTable(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Table Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go deleted file mode 100644 index b008e43..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package table_test - -import ( - "strings" - - . "github.com/onsi/ginkgo/extensions/table" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Table", func() { - DescribeTable("a simple table", - func(x int, y int, expected bool) { - Ω(x > y).Should(Equal(expected)) - }, - Entry("x > y", 1, 0, true), - Entry("x == y", 0, 0, false), - Entry("x < y", 0, 1, false), - ) - - type ComplicatedThings struct { - Superstructure string - Substructure string - Count int - } - - DescribeTable("a more complicated table", - func(c ComplicatedThings) { - Ω(strings.Count(c.Superstructure, c.Substructure)).Should(BeNumerically("==", c.Count)) - }, - Entry("with no matching substructures", ComplicatedThings{ - Superstructure: "the sixth sheikh's sixth sheep's sick", - Substructure: "emir", - Count: 0, - }), - Entry("with one matching substructure", ComplicatedThings{ - Superstructure: "the sixth sheikh's sixth sheep's sick", - Substructure: "sheep", - Count: 1, - }), - Entry("with many matching substructures", ComplicatedThings{ - Superstructure: "the sixth sheikh's sixth sheep's sick", - Substructure: "si", - Count: 3, - }), - ) - - PDescribeTable("a failure", - func(value bool) { - Ω(value).Should(BeFalse()) - }, - Entry("when true", true), - Entry("when false", false), - Entry("when malformed", 2), - ) - - DescribeTable("an untyped nil as an entry", - func(x interface{}) { - Expect(x).To(BeNil()) - }, - Entry("nil", nil), - ) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go deleted file mode 100644 index fea4d4d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/bootstrap_command.go +++ /dev/null @@ -1,202 +0,0 @@ -package main - -import ( - "bytes" - "flag" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "strings" - "text/template" - - "go/build" - - "github.com/onsi/ginkgo/ginkgo/nodot" -) - -func BuildBootstrapCommand() *Command { - var ( - agouti, noDot, internal bool - customBootstrapFile string - ) - flagSet := flag.NewFlagSet("bootstrap", flag.ExitOnError) - flagSet.BoolVar(&agouti, "agouti", false, "If set, bootstrap will generate a bootstrap file for writing Agouti tests") - flagSet.BoolVar(&noDot, "nodot", false, "If set, bootstrap will generate a bootstrap file that does not . import ginkgo and gomega") - flagSet.BoolVar(&internal, "internal", false, "If set, generate will generate a test file that uses the regular package name") - flagSet.StringVar(&customBootstrapFile, "template", "", "If specified, generate will use the contents of the file passed as the bootstrap template") - - return &Command{ - Name: "bootstrap", - FlagSet: flagSet, - UsageCommand: "ginkgo bootstrap ", - Usage: []string{ - "Bootstrap a test suite for the current package", - "Accepts the following flags:", - }, - Command: func(args []string, additionalArgs []string) { - generateBootstrap(agouti, noDot, internal, customBootstrapFile) - }, - } -} - -var bootstrapText = `package {{.Package}} - -import ( - "testing" - - {{.GinkgoImport}} - {{.GomegaImport}} -) - -func Test{{.FormattedName}}(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "{{.FormattedName}} Suite") -} -` - -var agoutiBootstrapText = `package {{.Package}} - -import ( - "testing" - - {{.GinkgoImport}} - {{.GomegaImport}} - "github.com/sclevine/agouti" -) - -func Test{{.FormattedName}}(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "{{.FormattedName}} Suite") -} - -var agoutiDriver *agouti.WebDriver - -var _ = BeforeSuite(func() { - // Choose a WebDriver: - - agoutiDriver = agouti.PhantomJS() - // agoutiDriver = agouti.Selenium() - // agoutiDriver = agouti.ChromeDriver() - - Expect(agoutiDriver.Start()).To(Succeed()) -}) - -var _ = AfterSuite(func() { - Expect(agoutiDriver.Stop()).To(Succeed()) -}) -` - -type bootstrapData struct { - Package string - FormattedName string - GinkgoImport string - GomegaImport string -} - -func getPackageAndFormattedName() (string, string, string) { - path, err := os.Getwd() - if err != nil { - complainAndQuit("Could not get current working directory: \n" + err.Error()) - } - - dirName := strings.Replace(filepath.Base(path), "-", "_", -1) - dirName = strings.Replace(dirName, " ", "_", -1) - - pkg, err := build.ImportDir(path, 0) - packageName := pkg.Name - if err != nil { - packageName = dirName - } - - formattedName := prettifyPackageName(filepath.Base(path)) - return packageName, dirName, formattedName -} - -func prettifyPackageName(name string) string { - name = strings.Replace(name, "-", " ", -1) - name = strings.Replace(name, "_", " ", -1) - name = strings.Title(name) - name = strings.Replace(name, " ", "", -1) - return name -} - -func determinePackageName(name string, internal bool) string { - if internal { - return name - } - - return name + "_test" -} - -func fileExists(path string) bool { - _, err := os.Stat(path) - if err == nil { - return true - } - return false -} - -func generateBootstrap(agouti, noDot, internal bool, customBootstrapFile string) { - packageName, bootstrapFilePrefix, formattedName := getPackageAndFormattedName() - data := bootstrapData{ - Package: determinePackageName(packageName, internal), - FormattedName: formattedName, - GinkgoImport: `. "github.com/onsi/ginkgo"`, - GomegaImport: `. "github.com/onsi/gomega"`, - } - - if noDot { - data.GinkgoImport = `"github.com/onsi/ginkgo"` - data.GomegaImport = `"github.com/onsi/gomega"` - } - - targetFile := fmt.Sprintf("%s_suite_test.go", bootstrapFilePrefix) - if fileExists(targetFile) { - fmt.Printf("%s already exists.\n\n", targetFile) - os.Exit(1) - } else { - fmt.Printf("Generating ginkgo test suite bootstrap for %s in:\n\t%s\n", packageName, targetFile) - } - - f, err := os.Create(targetFile) - if err != nil { - complainAndQuit("Could not create file: " + err.Error()) - panic(err.Error()) - } - defer f.Close() - - var templateText string - if customBootstrapFile != "" { - tpl, err := ioutil.ReadFile(customBootstrapFile) - if err != nil { - panic(err.Error()) - } - templateText = string(tpl) - } else if agouti { - templateText = agoutiBootstrapText - } else { - templateText = bootstrapText - } - - bootstrapTemplate, err := template.New("bootstrap").Parse(templateText) - if err != nil { - panic(err.Error()) - } - - buf := &bytes.Buffer{} - bootstrapTemplate.Execute(buf, data) - - if noDot { - contents, err := nodot.ApplyNoDot(buf.Bytes()) - if err != nil { - complainAndQuit("Failed to import nodot declarations: " + err.Error()) - } - fmt.Println("To update the nodot declarations in the future, switch to this directory and run:\n\tginkgo nodot") - buf = bytes.NewBuffer(contents) - } - - buf.WriteTo(f) - - goFmt(targetFile) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/build_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/build_command.go deleted file mode 100644 index f0eb375..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/build_command.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - "path/filepath" - - "github.com/onsi/ginkgo/ginkgo/interrupthandler" - "github.com/onsi/ginkgo/ginkgo/testrunner" -) - -func BuildBuildCommand() *Command { - commandFlags := NewBuildCommandFlags(flag.NewFlagSet("build", flag.ExitOnError)) - interruptHandler := interrupthandler.NewInterruptHandler() - builder := &SpecBuilder{ - commandFlags: commandFlags, - interruptHandler: interruptHandler, - } - - return &Command{ - Name: "build", - FlagSet: commandFlags.FlagSet, - UsageCommand: "ginkgo build ", - Usage: []string{ - "Build the passed in (or the package in the current directory if left blank).", - "Accepts the following flags:", - }, - Command: builder.BuildSpecs, - } -} - -type SpecBuilder struct { - commandFlags *RunWatchAndBuildCommandFlags - interruptHandler *interrupthandler.InterruptHandler -} - -func (r *SpecBuilder) BuildSpecs(args []string, additionalArgs []string) { - r.commandFlags.computeNodes() - - suites, _ := findSuites(args, r.commandFlags.Recurse, r.commandFlags.SkipPackage, false) - - if len(suites) == 0 { - complainAndQuit("Found no test suites") - } - - passed := true - for _, suite := range suites { - runner := testrunner.New(suite, 1, false, 0, r.commandFlags.GoOpts, nil) - fmt.Printf("Compiling %s...\n", suite.PackageName) - - path, _ := filepath.Abs(filepath.Join(suite.Path, fmt.Sprintf("%s.test", suite.PackageName))) - err := runner.CompileTo(path) - if err != nil { - fmt.Println(err.Error()) - passed = false - } else { - fmt.Printf(" compiled %s.test\n", suite.PackageName) - } - - runner.CleanUp() - } - - if passed { - os.Exit(0) - } - os.Exit(1) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/ginkgo_ast_nodes.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/ginkgo_ast_nodes.go deleted file mode 100644 index 02e2b3b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/ginkgo_ast_nodes.go +++ /dev/null @@ -1,123 +0,0 @@ -package convert - -import ( - "fmt" - "go/ast" - "strings" - "unicode" -) - -/* - * Creates a func init() node - */ -func createVarUnderscoreBlock() *ast.ValueSpec { - valueSpec := &ast.ValueSpec{} - object := &ast.Object{Kind: 4, Name: "_", Decl: valueSpec, Data: 0} - ident := &ast.Ident{Name: "_", Obj: object} - valueSpec.Names = append(valueSpec.Names, ident) - return valueSpec -} - -/* - * Creates a Describe("Testing with ginkgo", func() { }) node - */ -func createDescribeBlock() *ast.CallExpr { - blockStatement := &ast.BlockStmt{List: []ast.Stmt{}} - - fieldList := &ast.FieldList{} - funcType := &ast.FuncType{Params: fieldList} - funcLit := &ast.FuncLit{Type: funcType, Body: blockStatement} - basicLit := &ast.BasicLit{Kind: 9, Value: "\"Testing with Ginkgo\""} - describeIdent := &ast.Ident{Name: "Describe"} - return &ast.CallExpr{Fun: describeIdent, Args: []ast.Expr{basicLit, funcLit}} -} - -/* - * Convenience function to return the name of the *testing.T param - * for a Test function that will be rewritten. This is useful because - * we will want to replace the usage of this named *testing.T inside the - * body of the function with a GinktoT. - */ -func namedTestingTArg(node *ast.FuncDecl) string { - return node.Type.Params.List[0].Names[0].Name // *exhale* -} - -/* - * Convenience function to return the block statement node for a Describe statement - */ -func blockStatementFromDescribe(desc *ast.CallExpr) *ast.BlockStmt { - var funcLit *ast.FuncLit - var found = false - - for _, node := range desc.Args { - switch node := node.(type) { - case *ast.FuncLit: - found = true - funcLit = node - break - } - } - - if !found { - panic("Error finding ast.FuncLit inside describe statement. Somebody done goofed.") - } - - return funcLit.Body -} - -/* convenience function for creating an It("TestNameHere") - * with all the body of the test function inside the anonymous - * func passed to It() - */ -func createItStatementForTestFunc(testFunc *ast.FuncDecl) *ast.ExprStmt { - blockStatement := &ast.BlockStmt{List: testFunc.Body.List} - fieldList := &ast.FieldList{} - funcType := &ast.FuncType{Params: fieldList} - funcLit := &ast.FuncLit{Type: funcType, Body: blockStatement} - - testName := rewriteTestName(testFunc.Name.Name) - basicLit := &ast.BasicLit{Kind: 9, Value: fmt.Sprintf("\"%s\"", testName)} - itBlockIdent := &ast.Ident{Name: "It"} - callExpr := &ast.CallExpr{Fun: itBlockIdent, Args: []ast.Expr{basicLit, funcLit}} - return &ast.ExprStmt{X: callExpr} -} - -/* -* rewrite test names to be human readable -* eg: rewrites "TestSomethingAmazing" as "something amazing" - */ -func rewriteTestName(testName string) string { - nameComponents := []string{} - currentString := "" - indexOfTest := strings.Index(testName, "Test") - if indexOfTest != 0 { - return testName - } - - testName = strings.Replace(testName, "Test", "", 1) - first, rest := testName[0], testName[1:] - testName = string(unicode.ToLower(rune(first))) + rest - - for _, rune := range testName { - if unicode.IsUpper(rune) { - nameComponents = append(nameComponents, currentString) - currentString = string(unicode.ToLower(rune)) - } else { - currentString += string(rune) - } - } - - return strings.Join(append(nameComponents, currentString), " ") -} - -func newGinkgoTFromIdent(ident *ast.Ident) *ast.CallExpr { - return &ast.CallExpr{ - Lparen: ident.NamePos + 1, - Rparen: ident.NamePos + 2, - Fun: &ast.Ident{Name: "GinkgoT"}, - } -} - -func newGinkgoTInterface() *ast.Ident { - return &ast.Ident{Name: "GinkgoTInterface"} -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go deleted file mode 100644 index e226196..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go +++ /dev/null @@ -1,91 +0,0 @@ -package convert - -import ( - "errors" - "fmt" - "go/ast" -) - -/* - * Given the root node of an AST, returns the node containing the - * import statements for the file. - */ -func importsForRootNode(rootNode *ast.File) (imports *ast.GenDecl, err error) { - for _, declaration := range rootNode.Decls { - decl, ok := declaration.(*ast.GenDecl) - if !ok || len(decl.Specs) == 0 { - continue - } - - _, ok = decl.Specs[0].(*ast.ImportSpec) - if ok { - imports = decl - return - } - } - - err = errors.New(fmt.Sprintf("Could not find imports for root node:\n\t%#v\n", rootNode)) - return -} - -/* - * Removes "testing" import, if present - */ -func removeTestingImport(rootNode *ast.File) { - importDecl, err := importsForRootNode(rootNode) - if err != nil { - panic(err.Error()) - } - - var index int - for i, importSpec := range importDecl.Specs { - importSpec := importSpec.(*ast.ImportSpec) - if importSpec.Path.Value == "\"testing\"" { - index = i - break - } - } - - importDecl.Specs = append(importDecl.Specs[:index], importDecl.Specs[index+1:]...) -} - -/* - * Adds import statements for onsi/ginkgo, if missing - */ -func addGinkgoImports(rootNode *ast.File) { - importDecl, err := importsForRootNode(rootNode) - if err != nil { - panic(err.Error()) - } - - if len(importDecl.Specs) == 0 { - // TODO: might need to create a import decl here - panic("unimplemented : expected to find an imports block") - } - - needsGinkgo := true - for _, importSpec := range importDecl.Specs { - importSpec, ok := importSpec.(*ast.ImportSpec) - if !ok { - continue - } - - if importSpec.Path.Value == "\"github.com/onsi/ginkgo\"" { - needsGinkgo = false - } - } - - if needsGinkgo { - importDecl.Specs = append(importDecl.Specs, createImport(".", "\"github.com/onsi/ginkgo\"")) - } -} - -/* - * convenience function to create an import statement - */ -func createImport(name, path string) *ast.ImportSpec { - return &ast.ImportSpec{ - Name: &ast.Ident{Name: name}, - Path: &ast.BasicLit{Kind: 9, Value: path}, - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go deleted file mode 100644 index ed09c46..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go +++ /dev/null @@ -1,127 +0,0 @@ -package convert - -import ( - "fmt" - "go/build" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "regexp" -) - -/* - * RewritePackage takes a name (eg: my-package/tools), finds its test files using - * Go's build package, and then rewrites them. A ginkgo test suite file will - * also be added for this package, and all of its child packages. - */ -func RewritePackage(packageName string) { - pkg, err := packageWithName(packageName) - if err != nil { - panic(fmt.Sprintf("unexpected error reading package: '%s'\n%s\n", packageName, err.Error())) - } - - for _, filename := range findTestsInPackage(pkg) { - rewriteTestsInFile(filename) - } - return -} - -/* - * Given a package, findTestsInPackage reads the test files in the directory, - * and then recurses on each child package, returning a slice of all test files - * found in this process. - */ -func findTestsInPackage(pkg *build.Package) (testfiles []string) { - for _, file := range append(pkg.TestGoFiles, pkg.XTestGoFiles...) { - testfiles = append(testfiles, filepath.Join(pkg.Dir, file)) - } - - dirFiles, err := ioutil.ReadDir(pkg.Dir) - if err != nil { - panic(fmt.Sprintf("unexpected error reading dir: '%s'\n%s\n", pkg.Dir, err.Error())) - } - - re := regexp.MustCompile(`^[._]`) - - for _, file := range dirFiles { - if !file.IsDir() { - continue - } - - if re.Match([]byte(file.Name())) { - continue - } - - packageName := filepath.Join(pkg.ImportPath, file.Name()) - subPackage, err := packageWithName(packageName) - if err != nil { - panic(fmt.Sprintf("unexpected error reading package: '%s'\n%s\n", packageName, err.Error())) - } - - testfiles = append(testfiles, findTestsInPackage(subPackage)...) - } - - addGinkgoSuiteForPackage(pkg) - goFmtPackage(pkg) - return -} - -/* - * Shells out to `ginkgo bootstrap` to create a test suite file - */ -func addGinkgoSuiteForPackage(pkg *build.Package) { - originalDir, err := os.Getwd() - if err != nil { - panic(err) - } - - suite_test_file := filepath.Join(pkg.Dir, pkg.Name+"_suite_test.go") - - _, err = os.Stat(suite_test_file) - if err == nil { - return // test file already exists, this should be a no-op - } - - err = os.Chdir(pkg.Dir) - if err != nil { - panic(err) - } - - output, err := exec.Command("ginkgo", "bootstrap").Output() - - if err != nil { - panic(fmt.Sprintf("error running 'ginkgo bootstrap'.\nstdout: %s\n%s\n", output, err.Error())) - } - - err = os.Chdir(originalDir) - if err != nil { - panic(err) - } -} - -/* - * Shells out to `go fmt` to format the package - */ -func goFmtPackage(pkg *build.Package) { - output, err := exec.Command("go", "fmt", pkg.ImportPath).Output() - - if err != nil { - fmt.Printf("Warning: Error running 'go fmt %s'.\nstdout: %s\n%s\n", pkg.ImportPath, output, err.Error()) - } -} - -/* - * Attempts to return a package with its test files already read. - * The ImportMode arg to build.Import lets you specify if you want go to read the - * buildable go files inside the package, but it fails if the package has no go files - */ -func packageWithName(name string) (pkg *build.Package, err error) { - pkg, err = build.Default.Import(name, ".", build.ImportMode(0)) - if err == nil { - return - } - - pkg, err = build.Default.Import(name, ".", build.ImportMode(1)) - return -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/test_finder.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/test_finder.go deleted file mode 100644 index b33595c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/test_finder.go +++ /dev/null @@ -1,56 +0,0 @@ -package convert - -import ( - "go/ast" - "regexp" -) - -/* - * Given a root node, walks its top level statements and returns - * points to function nodes to rewrite as It statements. - * These functions, according to Go testing convention, must be named - * TestWithCamelCasedName and receive a single *testing.T argument. - */ -func findTestFuncs(rootNode *ast.File) (testsToRewrite []*ast.FuncDecl) { - testNameRegexp := regexp.MustCompile("^Test[0-9A-Z].+") - - ast.Inspect(rootNode, func(node ast.Node) bool { - if node == nil { - return false - } - - switch node := node.(type) { - case *ast.FuncDecl: - matches := testNameRegexp.MatchString(node.Name.Name) - - if matches && receivesTestingT(node) { - testsToRewrite = append(testsToRewrite, node) - } - } - - return true - }) - - return -} - -/* - * convenience function that looks at args to a function and determines if its - * params include an argument of type *testing.T - */ -func receivesTestingT(node *ast.FuncDecl) bool { - if len(node.Type.Params.List) != 1 { - return false - } - - base, ok := node.Type.Params.List[0].Type.(*ast.StarExpr) - if !ok { - return false - } - - intermediate := base.X.(*ast.SelectorExpr) - isTestingPackage := intermediate.X.(*ast.Ident).Name == "testing" - isTestingT := intermediate.Sel.Name == "T" - - return isTestingPackage && isTestingT -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go deleted file mode 100644 index 4b001a7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testfile_rewriter.go +++ /dev/null @@ -1,163 +0,0 @@ -package convert - -import ( - "bytes" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "os" -) - -/* - * Given a file path, rewrites any tests in the Ginkgo format. - * First, we parse the AST, and update the imports declaration. - * Then, we walk the first child elements in the file, returning tests to rewrite. - * A top level init func is declared, with a single Describe func inside. - * Then the test functions to rewrite are inserted as It statements inside the Describe. - * Finally we walk the rest of the file, replacing other usages of *testing.T - * Once that is complete, we write the AST back out again to its file. - */ -func rewriteTestsInFile(pathToFile string) { - fileSet := token.NewFileSet() - rootNode, err := parser.ParseFile(fileSet, pathToFile, nil, 0) - if err != nil { - panic(fmt.Sprintf("Error parsing test file '%s':\n%s\n", pathToFile, err.Error())) - } - - addGinkgoImports(rootNode) - removeTestingImport(rootNode) - - varUnderscoreBlock := createVarUnderscoreBlock() - describeBlock := createDescribeBlock() - varUnderscoreBlock.Values = []ast.Expr{describeBlock} - - for _, testFunc := range findTestFuncs(rootNode) { - rewriteTestFuncAsItStatement(testFunc, rootNode, describeBlock) - } - - underscoreDecl := &ast.GenDecl{ - Tok: 85, // gah, magick numbers are needed to make this work - TokPos: 14, // this tricks Go into writing "var _ = Describe" - Specs: []ast.Spec{varUnderscoreBlock}, - } - - imports := rootNode.Decls[0] - tail := rootNode.Decls[1:] - rootNode.Decls = append(append([]ast.Decl{imports}, underscoreDecl), tail...) - rewriteOtherFuncsToUseGinkgoT(rootNode.Decls) - walkNodesInRootNodeReplacingTestingT(rootNode) - - var buffer bytes.Buffer - if err = format.Node(&buffer, fileSet, rootNode); err != nil { - panic(fmt.Sprintf("Error formatting ast node after rewriting tests.\n%s\n", err.Error())) - } - - fileInfo, err := os.Stat(pathToFile) - if err != nil { - panic(fmt.Sprintf("Error stat'ing file: %s\n", pathToFile)) - } - - ioutil.WriteFile(pathToFile, buffer.Bytes(), fileInfo.Mode()) - return -} - -/* - * Given a test func named TestDoesSomethingNeat, rewrites it as - * It("does something neat", func() { __test_body_here__ }) and adds it - * to the Describe's list of statements - */ -func rewriteTestFuncAsItStatement(testFunc *ast.FuncDecl, rootNode *ast.File, describe *ast.CallExpr) { - var funcIndex int = -1 - for index, child := range rootNode.Decls { - if child == testFunc { - funcIndex = index - break - } - } - - if funcIndex < 0 { - panic(fmt.Sprintf("Assert failed: Error finding index for test node %s\n", testFunc.Name.Name)) - } - - var block *ast.BlockStmt = blockStatementFromDescribe(describe) - block.List = append(block.List, createItStatementForTestFunc(testFunc)) - replaceTestingTsWithGinkgoT(block, namedTestingTArg(testFunc)) - - // remove the old test func from the root node's declarations - rootNode.Decls = append(rootNode.Decls[:funcIndex], rootNode.Decls[funcIndex+1:]...) - return -} - -/* - * walks nodes inside of a test func's statements and replaces the usage of - * it's named *testing.T param with GinkgoT's - */ -func replaceTestingTsWithGinkgoT(statementsBlock *ast.BlockStmt, testingT string) { - ast.Inspect(statementsBlock, func(node ast.Node) bool { - if node == nil { - return false - } - - keyValueExpr, ok := node.(*ast.KeyValueExpr) - if ok { - replaceNamedTestingTsInKeyValueExpression(keyValueExpr, testingT) - return true - } - - funcLiteral, ok := node.(*ast.FuncLit) - if ok { - replaceTypeDeclTestingTsInFuncLiteral(funcLiteral) - return true - } - - callExpr, ok := node.(*ast.CallExpr) - if !ok { - return true - } - replaceTestingTsInArgsLists(callExpr, testingT) - - funCall, ok := callExpr.Fun.(*ast.SelectorExpr) - if ok { - replaceTestingTsMethodCalls(funCall, testingT) - } - - return true - }) -} - -/* - * rewrite t.Fail() or any other *testing.T method by replacing with T().Fail() - * This function receives a selector expression (eg: t.Fail()) and - * the name of the *testing.T param from the function declaration. Rewrites the - * selector expression in place if the target was a *testing.T - */ -func replaceTestingTsMethodCalls(selectorExpr *ast.SelectorExpr, testingT string) { - ident, ok := selectorExpr.X.(*ast.Ident) - if !ok { - return - } - - if ident.Name == testingT { - selectorExpr.X = newGinkgoTFromIdent(ident) - } -} - -/* - * replaces usages of a named *testing.T param inside of a call expression - * with a new GinkgoT object - */ -func replaceTestingTsInArgsLists(callExpr *ast.CallExpr, testingT string) { - for index, arg := range callExpr.Args { - ident, ok := arg.(*ast.Ident) - if !ok { - continue - } - - if ident.Name == testingT { - callExpr.Args[index] = newGinkgoTFromIdent(ident) - } - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testing_t_rewriter.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testing_t_rewriter.go deleted file mode 100644 index 418cdc4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert/testing_t_rewriter.go +++ /dev/null @@ -1,130 +0,0 @@ -package convert - -import ( - "go/ast" -) - -/* - * Rewrites any other top level funcs that receive a *testing.T param - */ -func rewriteOtherFuncsToUseGinkgoT(declarations []ast.Decl) { - for _, decl := range declarations { - decl, ok := decl.(*ast.FuncDecl) - if !ok { - continue - } - - for _, param := range decl.Type.Params.List { - starExpr, ok := param.Type.(*ast.StarExpr) - if !ok { - continue - } - - selectorExpr, ok := starExpr.X.(*ast.SelectorExpr) - if !ok { - continue - } - - xIdent, ok := selectorExpr.X.(*ast.Ident) - if !ok || xIdent.Name != "testing" { - continue - } - - if selectorExpr.Sel.Name != "T" { - continue - } - - param.Type = newGinkgoTInterface() - } - } -} - -/* - * Walks all of the nodes in the file, replacing *testing.T in struct - * and func literal nodes. eg: - * type foo struct { *testing.T } - * var bar = func(t *testing.T) { } - */ -func walkNodesInRootNodeReplacingTestingT(rootNode *ast.File) { - ast.Inspect(rootNode, func(node ast.Node) bool { - if node == nil { - return false - } - - switch node := node.(type) { - case *ast.StructType: - replaceTestingTsInStructType(node) - case *ast.FuncLit: - replaceTypeDeclTestingTsInFuncLiteral(node) - } - - return true - }) -} - -/* - * replaces named *testing.T inside a composite literal - */ -func replaceNamedTestingTsInKeyValueExpression(kve *ast.KeyValueExpr, testingT string) { - ident, ok := kve.Value.(*ast.Ident) - if !ok { - return - } - - if ident.Name == testingT { - kve.Value = newGinkgoTFromIdent(ident) - } -} - -/* - * replaces *testing.T params in a func literal with GinkgoT - */ -func replaceTypeDeclTestingTsInFuncLiteral(functionLiteral *ast.FuncLit) { - for _, arg := range functionLiteral.Type.Params.List { - starExpr, ok := arg.Type.(*ast.StarExpr) - if !ok { - continue - } - - selectorExpr, ok := starExpr.X.(*ast.SelectorExpr) - if !ok { - continue - } - - target, ok := selectorExpr.X.(*ast.Ident) - if !ok { - continue - } - - if target.Name == "testing" && selectorExpr.Sel.Name == "T" { - arg.Type = newGinkgoTInterface() - } - } -} - -/* - * Replaces *testing.T types inside of a struct declaration with a GinkgoT - * eg: type foo struct { *testing.T } - */ -func replaceTestingTsInStructType(structType *ast.StructType) { - for _, field := range structType.Fields.List { - starExpr, ok := field.Type.(*ast.StarExpr) - if !ok { - continue - } - - selectorExpr, ok := starExpr.X.(*ast.SelectorExpr) - if !ok { - continue - } - - xIdent, ok := selectorExpr.X.(*ast.Ident) - if !ok { - continue - } - - if xIdent.Name == "testing" && selectorExpr.Sel.Name == "T" { - field.Type = newGinkgoTInterface() - } - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert_command.go deleted file mode 100644 index 5944ed8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/convert_command.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/onsi/ginkgo/ginkgo/convert" -) - -func BuildConvertCommand() *Command { - return &Command{ - Name: "convert", - FlagSet: flag.NewFlagSet("convert", flag.ExitOnError), - UsageCommand: "ginkgo convert /path/to/package", - Usage: []string{ - "Convert the package at the passed in path from an XUnit-style test to a Ginkgo-style test", - }, - Command: convertPackage, - } -} - -func convertPackage(args []string, additionalArgs []string) { - if len(args) != 1 { - println(fmt.Sprintf("usage: ginkgo convert /path/to/your/package")) - os.Exit(1) - } - - defer func() { - err := recover() - if err != nil { - switch err := err.(type) { - case error: - println(err.Error()) - case string: - println(err) - default: - println(fmt.Sprintf("unexpected error: %#v", err)) - } - os.Exit(1) - } - }() - - convert.RewritePackage(args[0]) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go deleted file mode 100644 index ad04430..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go +++ /dev/null @@ -1,173 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "os" - "path/filepath" - "strings" - "text/template" -) - -func BuildGenerateCommand() *Command { - var agouti, noDot, internal bool - flagSet := flag.NewFlagSet("generate", flag.ExitOnError) - flagSet.BoolVar(&agouti, "agouti", false, "If set, generate will generate a test file for writing Agouti tests") - flagSet.BoolVar(&noDot, "nodot", false, "If set, generate will generate a test file that does not . import ginkgo and gomega") - flagSet.BoolVar(&internal, "internal", false, "If set, generate will generate a test file that uses the regular package name") - - return &Command{ - Name: "generate", - FlagSet: flagSet, - UsageCommand: "ginkgo generate ", - Usage: []string{ - "Generate a test file named filename_test.go", - "If the optional argument is omitted, a file named after the package in the current directory will be created.", - "Accepts the following flags:", - }, - Command: func(args []string, additionalArgs []string) { - generateSpec(args, agouti, noDot, internal) - }, - } -} - -var specText = `package {{.Package}} - -import ( - {{if .IncludeImports}}. "github.com/onsi/ginkgo"{{end}} - {{if .IncludeImports}}. "github.com/onsi/gomega"{{end}} - - {{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}} -) - -var _ = Describe("{{.Subject}}", func() { - -}) -` - -var agoutiSpecText = `package {{.Package}} - -import ( - {{if .IncludeImports}}. "github.com/onsi/ginkgo"{{end}} - {{if .IncludeImports}}. "github.com/onsi/gomega"{{end}} - "github.com/sclevine/agouti" - . "github.com/sclevine/agouti/matchers" - - {{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}} -) - -var _ = Describe("{{.Subject}}", func() { - var page *agouti.Page - - BeforeEach(func() { - var err error - page, err = agoutiDriver.NewPage() - Expect(err).NotTo(HaveOccurred()) - }) - - AfterEach(func() { - Expect(page.Destroy()).To(Succeed()) - }) -}) -` - -type specData struct { - Package string - Subject string - PackageImportPath string - IncludeImports bool - DotImportPackage bool -} - -func generateSpec(args []string, agouti, noDot, internal bool) { - if len(args) == 0 { - err := generateSpecForSubject("", agouti, noDot, internal) - if err != nil { - fmt.Println(err.Error()) - fmt.Println("") - os.Exit(1) - } - fmt.Println("") - return - } - - var failed bool - for _, arg := range args { - err := generateSpecForSubject(arg, agouti, noDot, internal) - if err != nil { - failed = true - fmt.Println(err.Error()) - } - } - fmt.Println("") - if failed { - os.Exit(1) - } -} - -func generateSpecForSubject(subject string, agouti, noDot, internal bool) error { - packageName, specFilePrefix, formattedName := getPackageAndFormattedName() - if subject != "" { - specFilePrefix = formatSubject(subject) - formattedName = prettifyPackageName(specFilePrefix) - } - - data := specData{ - Package: determinePackageName(packageName, internal), - Subject: formattedName, - PackageImportPath: getPackageImportPath(), - IncludeImports: !noDot, - DotImportPackage: !internal, - } - - targetFile := fmt.Sprintf("%s_test.go", specFilePrefix) - if fileExists(targetFile) { - return fmt.Errorf("%s already exists.", targetFile) - } else { - fmt.Printf("Generating ginkgo test for %s in:\n %s\n", data.Subject, targetFile) - } - - f, err := os.Create(targetFile) - if err != nil { - return err - } - defer f.Close() - - var templateText string - if agouti { - templateText = agoutiSpecText - } else { - templateText = specText - } - - specTemplate, err := template.New("spec").Parse(templateText) - if err != nil { - return err - } - - specTemplate.Execute(f, data) - goFmt(targetFile) - return nil -} - -func formatSubject(name string) string { - name = strings.Replace(name, "-", "_", -1) - name = strings.Replace(name, " ", "_", -1) - name = strings.Split(name, ".go")[0] - name = strings.Split(name, "_test")[0] - return name -} - -func getPackageImportPath() string { - workingDir, err := os.Getwd() - if err != nil { - panic(err.Error()) - } - sep := string(filepath.Separator) - paths := strings.Split(workingDir, sep+"src"+sep) - if len(paths) == 1 { - fmt.Printf("\nCouldn't identify package import path.\n\n\tginkgo generate\n\nMust be run within a package directory under $GOPATH/src/...\nYou're going to have to change UNKNOWN_PACKAGE_PATH in the generated file...\n\n") - return "UNKNOWN_PACKAGE_PATH" - } - return filepath.ToSlash(paths[len(paths)-1]) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/help_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/help_command.go deleted file mode 100644 index 23b1d2f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/help_command.go +++ /dev/null @@ -1,31 +0,0 @@ -package main - -import ( - "flag" - "fmt" -) - -func BuildHelpCommand() *Command { - return &Command{ - Name: "help", - FlagSet: flag.NewFlagSet("help", flag.ExitOnError), - UsageCommand: "ginkgo help ", - Usage: []string{ - "Print usage information. If a command is passed in, print usage information just for that command.", - }, - Command: printHelp, - } -} - -func printHelp(args []string, additionalArgs []string) { - if len(args) == 0 { - usage() - } else { - command, found := commandMatching(args[0]) - if !found { - complainAndQuit(fmt.Sprintf("Unknown command: %s", args[0])) - } - - usageForCommand(command, true) - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go deleted file mode 100644 index c15db0b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go +++ /dev/null @@ -1,52 +0,0 @@ -package interrupthandler - -import ( - "os" - "os/signal" - "sync" - "syscall" -) - -type InterruptHandler struct { - interruptCount int - lock *sync.Mutex - C chan bool -} - -func NewInterruptHandler() *InterruptHandler { - h := &InterruptHandler{ - lock: &sync.Mutex{}, - C: make(chan bool, 0), - } - - go h.handleInterrupt() - SwallowSigQuit() - - return h -} - -func (h *InterruptHandler) WasInterrupted() bool { - h.lock.Lock() - defer h.lock.Unlock() - - return h.interruptCount > 0 -} - -func (h *InterruptHandler) handleInterrupt() { - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt, syscall.SIGTERM) - - <-c - signal.Stop(c) - - h.lock.Lock() - h.interruptCount++ - if h.interruptCount == 1 { - close(h.C) - } else if h.interruptCount > 5 { - os.Exit(1) - } - h.lock.Unlock() - - go h.handleInterrupt() -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_unix.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_unix.go deleted file mode 100644 index 43c1854..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_unix.go +++ /dev/null @@ -1,14 +0,0 @@ -// +build freebsd openbsd netbsd dragonfly darwin linux solaris - -package interrupthandler - -import ( - "os" - "os/signal" - "syscall" -) - -func SwallowSigQuit() { - c := make(chan os.Signal, 1024) - signal.Notify(c, syscall.SIGQUIT) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_windows.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_windows.go deleted file mode 100644 index 7f4a50e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_windows.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build windows - -package interrupthandler - -func SwallowSigQuit() { - //noop -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/main.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/main.go deleted file mode 100644 index 0741ba8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/main.go +++ /dev/null @@ -1,302 +0,0 @@ -/* -The Ginkgo CLI - -The Ginkgo CLI is fully documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) - -You can also learn more by running: - - ginkgo help - -Here are some of the more commonly used commands: - -To install: - - go install github.com/onsi/ginkgo/ginkgo - -To run tests: - - ginkgo - -To run tests in all subdirectories: - - ginkgo -r - -To run tests in particular packages: - - ginkgo /path/to/package /path/to/another/package - -To pass arguments/flags to your tests: - - ginkgo -- - -To run tests in parallel - - ginkgo -p - -this will automatically detect the optimal number of nodes to use. Alternatively, you can specify the number of nodes with: - - ginkgo -nodes=N - -(note that you don't need to provide -p in this case). - -By default the Ginkgo CLI will spin up a server that the individual test processes send test output to. The CLI aggregates this output and then presents coherent test output, one test at a time, as each test completes. -An alternative is to have the parallel nodes run and stream interleaved output back. This useful for debugging, particularly in contexts where tests hang/fail to start. To get this interleaved output: - - ginkgo -nodes=N -stream=true - -On windows, the default value for stream is true. - -By default, when running multiple tests (with -r or a list of packages) Ginkgo will abort when a test fails. To have Ginkgo run subsequent test suites instead you can: - - ginkgo -keepGoing - -To fail if there are ginkgo tests in a directory but no test suite (missing `RunSpecs`) - - ginkgo -requireSuite - -To monitor packages and rerun tests when changes occur: - - ginkgo watch <-r>
- -passing `ginkgo watch` the `-r` flag will recursively detect all test suites under the current directory and monitor them. -`watch` does not detect *new* packages. Moreover, changes in package X only rerun the tests for package X, tests for packages -that depend on X are not rerun. - -[OSX & Linux only] To receive (desktop) notifications when a test run completes: - - ginkgo -notify - -this is particularly useful with `ginkgo watch`. Notifications are currently only supported on OS X and require that you `brew install terminal-notifier` - -Sometimes (to suss out race conditions/flakey tests, for example) you want to keep running a test suite until it fails. You can do this with: - - ginkgo -untilItFails - -To bootstrap a test suite: - - ginkgo bootstrap - -To generate a test file: - - ginkgo generate - -To bootstrap/generate test files without using "." imports: - - ginkgo bootstrap --nodot - ginkgo generate --nodot - -this will explicitly export all the identifiers in Ginkgo and Gomega allowing you to rename them to avoid collisions. When you pull to the latest Ginkgo/Gomega you'll want to run - - ginkgo nodot - -to refresh this list and pull in any new identifiers. In particular, this will pull in any new Gomega matchers that get added. - -To convert an existing XUnit style test suite to a Ginkgo-style test suite: - - ginkgo convert . - -To unfocus tests: - - ginkgo unfocus - -or - - ginkgo blur - -To compile a test suite: - - ginkgo build - -will output an executable file named `package.test`. This can be run directly or by invoking - - ginkgo - -To print out Ginkgo's version: - - ginkgo version - -To get more help: - - ginkgo help -*/ -package main - -import ( - "flag" - "fmt" - "os" - "os/exec" - "strings" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/ginkgo/testsuite" -) - -const greenColor = "\x1b[32m" -const redColor = "\x1b[91m" -const defaultStyle = "\x1b[0m" -const lightGrayColor = "\x1b[37m" - -type Command struct { - Name string - AltName string - FlagSet *flag.FlagSet - Usage []string - UsageCommand string - Command func(args []string, additionalArgs []string) - SuppressFlagDocumentation bool - FlagDocSubstitute []string -} - -func (c *Command) Matches(name string) bool { - return c.Name == name || (c.AltName != "" && c.AltName == name) -} - -func (c *Command) Run(args []string, additionalArgs []string) { - c.FlagSet.Usage = usage - c.FlagSet.Parse(args) - c.Command(c.FlagSet.Args(), additionalArgs) -} - -var DefaultCommand *Command -var Commands []*Command - -func init() { - DefaultCommand = BuildRunCommand() - Commands = append(Commands, BuildWatchCommand()) - Commands = append(Commands, BuildBuildCommand()) - Commands = append(Commands, BuildBootstrapCommand()) - Commands = append(Commands, BuildGenerateCommand()) - Commands = append(Commands, BuildNodotCommand()) - Commands = append(Commands, BuildConvertCommand()) - Commands = append(Commands, BuildUnfocusCommand()) - Commands = append(Commands, BuildVersionCommand()) - Commands = append(Commands, BuildHelpCommand()) -} - -func main() { - args := []string{} - additionalArgs := []string{} - - foundDelimiter := false - - for _, arg := range os.Args[1:] { - if !foundDelimiter { - if arg == "--" { - foundDelimiter = true - continue - } - } - - if foundDelimiter { - additionalArgs = append(additionalArgs, arg) - } else { - args = append(args, arg) - } - } - - if len(args) > 0 { - commandToRun, found := commandMatching(args[0]) - if found { - commandToRun.Run(args[1:], additionalArgs) - return - } - } - - DefaultCommand.Run(args, additionalArgs) -} - -func commandMatching(name string) (*Command, bool) { - for _, command := range Commands { - if command.Matches(name) { - return command, true - } - } - return nil, false -} - -func usage() { - fmt.Printf("Ginkgo Version %s\n\n", config.VERSION) - usageForCommand(DefaultCommand, false) - for _, command := range Commands { - fmt.Printf("\n") - usageForCommand(command, false) - } -} - -func usageForCommand(command *Command, longForm bool) { - fmt.Printf("%s\n%s\n", command.UsageCommand, strings.Repeat("-", len(command.UsageCommand))) - fmt.Printf("%s\n", strings.Join(command.Usage, "\n")) - if command.SuppressFlagDocumentation && !longForm { - fmt.Printf("%s\n", strings.Join(command.FlagDocSubstitute, "\n ")) - } else { - command.FlagSet.SetOutput(os.Stdout) - command.FlagSet.PrintDefaults() - } -} - -func complainAndQuit(complaint string) { - fmt.Fprintf(os.Stderr, "%s\nFor usage instructions:\n\tginkgo help\n", complaint) - os.Exit(1) -} - -func findSuites(args []string, recurseForAll bool, skipPackage string, allowPrecompiled bool) ([]testsuite.TestSuite, []string) { - suites := []testsuite.TestSuite{} - - if len(args) > 0 { - for _, arg := range args { - if allowPrecompiled { - suite, err := testsuite.PrecompiledTestSuite(arg) - if err == nil { - suites = append(suites, suite) - continue - } - } - recurseForSuite := recurseForAll - if strings.HasSuffix(arg, "/...") && arg != "/..." { - arg = arg[:len(arg)-4] - recurseForSuite = true - } - suites = append(suites, testsuite.SuitesInDir(arg, recurseForSuite)...) - } - } else { - suites = testsuite.SuitesInDir(".", recurseForAll) - } - - skippedPackages := []string{} - if skipPackage != "" { - skipFilters := strings.Split(skipPackage, ",") - filteredSuites := []testsuite.TestSuite{} - for _, suite := range suites { - skip := false - for _, skipFilter := range skipFilters { - if strings.Contains(suite.Path, skipFilter) { - skip = true - break - } - } - if skip { - skippedPackages = append(skippedPackages, suite.Path) - } else { - filteredSuites = append(filteredSuites, suite) - } - } - suites = filteredSuites - } - - return suites, skippedPackages -} - -func goFmt(path string) { - err := exec.Command("go", "fmt", path).Run() - if err != nil { - complainAndQuit("Could not fmt: " + err.Error()) - } -} - -func pluralizedWord(singular, plural string, count int) string { - if count == 1 { - return singular - } - return plural -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot.go deleted file mode 100644 index 3f7237c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot.go +++ /dev/null @@ -1,194 +0,0 @@ -package nodot - -import ( - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "path/filepath" - "strings" -) - -func ApplyNoDot(data []byte) ([]byte, error) { - sections, err := generateNodotSections() - if err != nil { - return nil, err - } - - for _, section := range sections { - data = section.createOrUpdateIn(data) - } - - return data, nil -} - -type nodotSection struct { - name string - pkg string - declarations []string - types []string -} - -func (s nodotSection) createOrUpdateIn(data []byte) []byte { - renames := map[string]string{} - - contents := string(data) - - lines := strings.Split(contents, "\n") - - comment := "// Declarations for " + s.name - - newLines := []string{} - for _, line := range lines { - if line == comment { - continue - } - - words := strings.Split(line, " ") - lastWord := words[len(words)-1] - - if s.containsDeclarationOrType(lastWord) { - renames[lastWord] = words[1] - continue - } - - newLines = append(newLines, line) - } - - if len(newLines[len(newLines)-1]) > 0 { - newLines = append(newLines, "") - } - - newLines = append(newLines, comment) - - for _, typ := range s.types { - name, ok := renames[s.prefix(typ)] - if !ok { - name = typ - } - newLines = append(newLines, fmt.Sprintf("type %s %s", name, s.prefix(typ))) - } - - for _, decl := range s.declarations { - name, ok := renames[s.prefix(decl)] - if !ok { - name = decl - } - newLines = append(newLines, fmt.Sprintf("var %s = %s", name, s.prefix(decl))) - } - - newLines = append(newLines, "") - - newContents := strings.Join(newLines, "\n") - - return []byte(newContents) -} - -func (s nodotSection) prefix(declOrType string) string { - return s.pkg + "." + declOrType -} - -func (s nodotSection) containsDeclarationOrType(word string) bool { - for _, declaration := range s.declarations { - if s.prefix(declaration) == word { - return true - } - } - - for _, typ := range s.types { - if s.prefix(typ) == word { - return true - } - } - - return false -} - -func generateNodotSections() ([]nodotSection, error) { - sections := []nodotSection{} - - declarations, err := getExportedDeclerationsForPackage("github.com/onsi/ginkgo", "ginkgo_dsl.go", "GINKGO_VERSION", "GINKGO_PANIC") - if err != nil { - return nil, err - } - sections = append(sections, nodotSection{ - name: "Ginkgo DSL", - pkg: "ginkgo", - declarations: declarations, - types: []string{"Done", "Benchmarker"}, - }) - - declarations, err = getExportedDeclerationsForPackage("github.com/onsi/gomega", "gomega_dsl.go", "GOMEGA_VERSION") - if err != nil { - return nil, err - } - sections = append(sections, nodotSection{ - name: "Gomega DSL", - pkg: "gomega", - declarations: declarations, - }) - - declarations, err = getExportedDeclerationsForPackage("github.com/onsi/gomega", "matchers.go") - if err != nil { - return nil, err - } - sections = append(sections, nodotSection{ - name: "Gomega Matchers", - pkg: "gomega", - declarations: declarations, - }) - - return sections, nil -} - -func getExportedDeclerationsForPackage(pkgPath string, filename string, blacklist ...string) ([]string, error) { - pkg, err := build.Import(pkgPath, ".", 0) - if err != nil { - return []string{}, err - } - - declarations, err := getExportedDeclarationsForFile(filepath.Join(pkg.Dir, filename)) - if err != nil { - return []string{}, err - } - - blacklistLookup := map[string]bool{} - for _, declaration := range blacklist { - blacklistLookup[declaration] = true - } - - filteredDeclarations := []string{} - for _, declaration := range declarations { - if blacklistLookup[declaration] { - continue - } - filteredDeclarations = append(filteredDeclarations, declaration) - } - - return filteredDeclarations, nil -} - -func getExportedDeclarationsForFile(path string) ([]string, error) { - fset := token.NewFileSet() - tree, err := parser.ParseFile(fset, path, nil, 0) - if err != nil { - return []string{}, err - } - - declarations := []string{} - ast.FileExports(tree) - for _, decl := range tree.Decls { - switch x := decl.(type) { - case *ast.GenDecl: - switch s := x.Specs[0].(type) { - case *ast.ValueSpec: - declarations = append(declarations, s.Names[0].Name) - } - case *ast.FuncDecl: - declarations = append(declarations, x.Name.Name) - } - } - - return declarations, nil -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go deleted file mode 100644 index 72b7332..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package nodot_test - -import ( - "github.com/onsi/ginkgo" - "github.com/onsi/gomega" - - "testing" -) - -func TestNodot(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Nodot Suite") -} - -// Declarations for Ginkgo DSL -type Done ginkgo.Done -type Benchmarker ginkgo.Benchmarker - -var GinkgoWriter = ginkgo.GinkgoWriter -var GinkgoParallelNode = ginkgo.GinkgoParallelNode -var GinkgoT = ginkgo.GinkgoT -var CurrentGinkgoTestDescription = ginkgo.CurrentGinkgoTestDescription -var RunSpecs = ginkgo.RunSpecs -var RunSpecsWithDefaultAndCustomReporters = ginkgo.RunSpecsWithDefaultAndCustomReporters -var RunSpecsWithCustomReporters = ginkgo.RunSpecsWithCustomReporters -var Fail = ginkgo.Fail -var GinkgoRecover = ginkgo.GinkgoRecover -var Describe = ginkgo.Describe -var FDescribe = ginkgo.FDescribe -var PDescribe = ginkgo.PDescribe -var XDescribe = ginkgo.XDescribe -var Context = ginkgo.Context -var FContext = ginkgo.FContext -var PContext = ginkgo.PContext -var XContext = ginkgo.XContext -var It = ginkgo.It -var FIt = ginkgo.FIt -var PIt = ginkgo.PIt -var XIt = ginkgo.XIt -var Measure = ginkgo.Measure -var FMeasure = ginkgo.FMeasure -var PMeasure = ginkgo.PMeasure -var XMeasure = ginkgo.XMeasure -var BeforeSuite = ginkgo.BeforeSuite -var AfterSuite = ginkgo.AfterSuite -var SynchronizedBeforeSuite = ginkgo.SynchronizedBeforeSuite -var SynchronizedAfterSuite = ginkgo.SynchronizedAfterSuite -var BeforeEach = ginkgo.BeforeEach -var JustBeforeEach = ginkgo.JustBeforeEach -var JustAfterEach = ginkgo.JustAfterEach -var AfterEach = ginkgo.AfterEach - -// Declarations for Gomega DSL -var RegisterFailHandler = gomega.RegisterFailHandler -var RegisterTestingT = gomega.RegisterTestingT -var InterceptGomegaFailures = gomega.InterceptGomegaFailures -var Ω = gomega.Ω -var Expect = gomega.Expect -var ExpectWithOffset = gomega.ExpectWithOffset -var Eventually = gomega.Eventually -var EventuallyWithOffset = gomega.EventuallyWithOffset -var Consistently = gomega.Consistently -var ConsistentlyWithOffset = gomega.ConsistentlyWithOffset -var SetDefaultEventuallyTimeout = gomega.SetDefaultEventuallyTimeout -var SetDefaultEventuallyPollingInterval = gomega.SetDefaultEventuallyPollingInterval -var SetDefaultConsistentlyDuration = gomega.SetDefaultConsistentlyDuration -var SetDefaultConsistentlyPollingInterval = gomega.SetDefaultConsistentlyPollingInterval - -// Declarations for Gomega Matchers -var Equal = gomega.Equal -var BeEquivalentTo = gomega.BeEquivalentTo -var BeNil = gomega.BeNil -var BeTrue = gomega.BeTrue -var BeFalse = gomega.BeFalse -var HaveOccurred = gomega.HaveOccurred -var MatchError = gomega.MatchError -var BeClosed = gomega.BeClosed -var Receive = gomega.Receive -var MatchRegexp = gomega.MatchRegexp -var ContainSubstring = gomega.ContainSubstring -var MatchJSON = gomega.MatchJSON -var BeEmpty = gomega.BeEmpty -var HaveLen = gomega.HaveLen -var BeZero = gomega.BeZero -var ContainElement = gomega.ContainElement -var ConsistOf = gomega.ConsistOf -var HaveKey = gomega.HaveKey -var HaveKeyWithValue = gomega.HaveKeyWithValue -var BeNumerically = gomega.BeNumerically -var BeTemporally = gomega.BeTemporally -var BeAssignableToTypeOf = gomega.BeAssignableToTypeOf -var Panic = gomega.Panic diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go deleted file mode 100644 index 1470b74..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go +++ /dev/null @@ -1,82 +0,0 @@ -package nodot_test - -import ( - "strings" - - . "github.com/onsi/ginkgo/ginkgo/nodot" -) - -var _ = Describe("ApplyNoDot", func() { - var result string - - apply := func(input string) string { - output, err := ApplyNoDot([]byte(input)) - Ω(err).ShouldNot(HaveOccurred()) - return string(output) - } - - Context("when no declarations have been imported yet", func() { - BeforeEach(func() { - result = apply("") - }) - - It("should add headings for the various declarations", func() { - Ω(result).Should(ContainSubstring("// Declarations for Ginkgo DSL")) - Ω(result).Should(ContainSubstring("// Declarations for Gomega DSL")) - Ω(result).Should(ContainSubstring("// Declarations for Gomega Matchers")) - }) - - It("should import Ginkgo's declarations", func() { - Ω(result).Should(ContainSubstring("var It = ginkgo.It")) - Ω(result).Should(ContainSubstring("var XDescribe = ginkgo.XDescribe")) - }) - - It("should import Ginkgo's types", func() { - Ω(result).Should(ContainSubstring("type Done ginkgo.Done")) - Ω(result).Should(ContainSubstring("type Benchmarker ginkgo.Benchmarker")) - Ω(strings.Count(result, "type ")).Should(Equal(2)) - }) - - It("should import Gomega's DSL and matchers", func() { - Ω(result).Should(ContainSubstring("var Ω = gomega.Ω")) - Ω(result).Should(ContainSubstring("var ContainSubstring = gomega.ContainSubstring")) - Ω(result).Should(ContainSubstring("var Equal = gomega.Equal")) - }) - - It("should not import blacklisted things", func() { - Ω(result).ShouldNot(ContainSubstring("GINKGO_VERSION")) - Ω(result).ShouldNot(ContainSubstring("GINKGO_PANIC")) - Ω(result).ShouldNot(ContainSubstring("GOMEGA_VERSION")) - }) - }) - - It("should be idempotent (module empty lines - go fmt can fix those for us)", func() { - first := apply("") - second := apply(first) - first = strings.Trim(first, "\n") - second = strings.Trim(second, "\n") - Ω(first).Should(Equal(second)) - }) - - It("should not mess with other things in the input", func() { - result = apply("var MyThing = SomethingThatsMine") - Ω(result).Should(ContainSubstring("var MyThing = SomethingThatsMine")) - }) - - Context("when the user has redefined a name", func() { - It("should honor the redefinition", func() { - result = apply(` -var _ = gomega.Ω -var When = ginkgo.It - `) - - Ω(result).Should(ContainSubstring("var _ = gomega.Ω")) - Ω(result).ShouldNot(ContainSubstring("var Ω = gomega.Ω")) - - Ω(result).Should(ContainSubstring("var When = ginkgo.It")) - Ω(result).ShouldNot(ContainSubstring("var It = ginkgo.It")) - - Ω(result).Should(ContainSubstring("var Context = ginkgo.Context")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot_command.go deleted file mode 100644 index 39b88b5..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/nodot_command.go +++ /dev/null @@ -1,77 +0,0 @@ -package main - -import ( - "bufio" - "flag" - "io/ioutil" - "os" - "path/filepath" - "regexp" - - "github.com/onsi/ginkgo/ginkgo/nodot" -) - -func BuildNodotCommand() *Command { - return &Command{ - Name: "nodot", - FlagSet: flag.NewFlagSet("bootstrap", flag.ExitOnError), - UsageCommand: "ginkgo nodot", - Usage: []string{ - "Update the nodot declarations in your test suite", - "Any missing declarations (from, say, a recently added matcher) will be added to your bootstrap file.", - "If you've renamed a declaration, that name will be honored and not overwritten.", - }, - Command: updateNodot, - } -} - -func updateNodot(args []string, additionalArgs []string) { - suiteFile, perm := findSuiteFile() - - data, err := ioutil.ReadFile(suiteFile) - if err != nil { - complainAndQuit("Failed to update nodot declarations: " + err.Error()) - } - - content, err := nodot.ApplyNoDot(data) - if err != nil { - complainAndQuit("Failed to update nodot declarations: " + err.Error()) - } - ioutil.WriteFile(suiteFile, content, perm) - - goFmt(suiteFile) -} - -func findSuiteFile() (string, os.FileMode) { - workingDir, err := os.Getwd() - if err != nil { - complainAndQuit("Could not find suite file for nodot: " + err.Error()) - } - - files, err := ioutil.ReadDir(workingDir) - if err != nil { - complainAndQuit("Could not find suite file for nodot: " + err.Error()) - } - - re := regexp.MustCompile(`RunSpecs\(|RunSpecsWithDefaultAndCustomReporters\(|RunSpecsWithCustomReporters\(`) - - for _, file := range files { - if file.IsDir() { - continue - } - path := filepath.Join(workingDir, file.Name()) - f, err := os.Open(path) - if err != nil { - complainAndQuit("Could not find suite file for nodot: " + err.Error()) - } - defer f.Close() - - if re.MatchReader(bufio.NewReader(f)) { - return path, file.Mode() - } - } - - complainAndQuit("Could not find a suite file for nodot: you need a bootstrap file that call's Ginkgo's RunSpecs() command.\nTry running ginkgo bootstrap first.") - - return "", 0 -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/notifications.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/notifications.go deleted file mode 100644 index 368d61f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/notifications.go +++ /dev/null @@ -1,141 +0,0 @@ -package main - -import ( - "fmt" - "os" - "os/exec" - "regexp" - "runtime" - "strings" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/ginkgo/testsuite" -) - -type Notifier struct { - commandFlags *RunWatchAndBuildCommandFlags -} - -func NewNotifier(commandFlags *RunWatchAndBuildCommandFlags) *Notifier { - return &Notifier{ - commandFlags: commandFlags, - } -} - -func (n *Notifier) VerifyNotificationsAreAvailable() { - if n.commandFlags.Notify { - onLinux := (runtime.GOOS == "linux") - onOSX := (runtime.GOOS == "darwin") - if onOSX { - - _, err := exec.LookPath("terminal-notifier") - if err != nil { - fmt.Printf(`--notify requires terminal-notifier, which you don't seem to have installed. - -OSX: - -To remedy this: - - brew install terminal-notifier - -To learn more about terminal-notifier: - - https://github.com/alloy/terminal-notifier -`) - os.Exit(1) - } - - } else if onLinux { - - _, err := exec.LookPath("notify-send") - if err != nil { - fmt.Printf(`--notify requires terminal-notifier or notify-send, which you don't seem to have installed. - -Linux: - -Download and install notify-send for your distribution -`) - os.Exit(1) - } - - } - } -} - -func (n *Notifier) SendSuiteCompletionNotification(suite testsuite.TestSuite, suitePassed bool) { - if suitePassed { - n.SendNotification("Ginkgo [PASS]", fmt.Sprintf(`Test suite for "%s" passed.`, suite.PackageName)) - } else { - n.SendNotification("Ginkgo [FAIL]", fmt.Sprintf(`Test suite for "%s" failed.`, suite.PackageName)) - } -} - -func (n *Notifier) SendNotification(title string, subtitle string) { - - if n.commandFlags.Notify { - onLinux := (runtime.GOOS == "linux") - onOSX := (runtime.GOOS == "darwin") - - if onOSX { - - _, err := exec.LookPath("terminal-notifier") - if err == nil { - args := []string{"-title", title, "-subtitle", subtitle, "-group", "com.onsi.ginkgo"} - terminal := os.Getenv("TERM_PROGRAM") - if terminal == "iTerm.app" { - args = append(args, "-activate", "com.googlecode.iterm2") - } else if terminal == "Apple_Terminal" { - args = append(args, "-activate", "com.apple.Terminal") - } - - exec.Command("terminal-notifier", args...).Run() - } - - } else if onLinux { - - _, err := exec.LookPath("notify-send") - if err == nil { - args := []string{"-a", "ginkgo", title, subtitle} - exec.Command("notify-send", args...).Run() - } - - } - } -} - -func (n *Notifier) RunCommand(suite testsuite.TestSuite, suitePassed bool) { - - command := n.commandFlags.AfterSuiteHook - if command != "" { - - // Allow for string replacement to pass input to the command - passed := "[FAIL]" - if suitePassed { - passed = "[PASS]" - } - command = strings.Replace(command, "(ginkgo-suite-passed)", passed, -1) - command = strings.Replace(command, "(ginkgo-suite-name)", suite.PackageName, -1) - - // Must break command into parts - splitArgs := regexp.MustCompile(`'.+'|".+"|\S+`) - parts := splitArgs.FindAllString(command, -1) - - output, err := exec.Command(parts[0], parts[1:]...).CombinedOutput() - if err != nil { - fmt.Println("Post-suite command failed:") - if config.DefaultReporterConfig.NoColor { - fmt.Printf("\t%s\n", output) - } else { - fmt.Printf("\t%s%s%s\n", redColor, string(output), defaultStyle) - } - n.SendNotification("Ginkgo [ERROR]", fmt.Sprintf(`After suite command "%s" failed`, n.commandFlags.AfterSuiteHook)) - } else { - fmt.Println("Post-suite command succeeded:") - if config.DefaultReporterConfig.NoColor { - fmt.Printf("\t%s\n", output) - } else { - fmt.Printf("\t%s%s%s\n", greenColor, string(output), defaultStyle) - } - } - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_command.go deleted file mode 100644 index 569b6a2..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_command.go +++ /dev/null @@ -1,275 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "math/rand" - "os" - "strings" - "time" - - "io/ioutil" - "path/filepath" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/ginkgo/interrupthandler" - "github.com/onsi/ginkgo/ginkgo/testrunner" - "github.com/onsi/ginkgo/types" -) - -func BuildRunCommand() *Command { - commandFlags := NewRunCommandFlags(flag.NewFlagSet("ginkgo", flag.ExitOnError)) - notifier := NewNotifier(commandFlags) - interruptHandler := interrupthandler.NewInterruptHandler() - runner := &SpecRunner{ - commandFlags: commandFlags, - notifier: notifier, - interruptHandler: interruptHandler, - suiteRunner: NewSuiteRunner(notifier, interruptHandler), - } - - return &Command{ - Name: "", - FlagSet: commandFlags.FlagSet, - UsageCommand: "ginkgo -- ", - Usage: []string{ - "Run the tests in the passed in (or the package in the current directory if left blank).", - "Any arguments after -- will be passed to the test.", - "Accepts the following flags:", - }, - Command: runner.RunSpecs, - } -} - -type SpecRunner struct { - commandFlags *RunWatchAndBuildCommandFlags - notifier *Notifier - interruptHandler *interrupthandler.InterruptHandler - suiteRunner *SuiteRunner -} - -func (r *SpecRunner) RunSpecs(args []string, additionalArgs []string) { - r.commandFlags.computeNodes() - r.notifier.VerifyNotificationsAreAvailable() - - suites, skippedPackages := findSuites(args, r.commandFlags.Recurse, r.commandFlags.SkipPackage, true) - if len(skippedPackages) > 0 { - fmt.Println("Will skip:") - for _, skippedPackage := range skippedPackages { - fmt.Println(" " + skippedPackage) - } - } - - if len(skippedPackages) > 0 && len(suites) == 0 { - fmt.Println("All tests skipped! Exiting...") - os.Exit(0) - } - - if len(suites) == 0 { - complainAndQuit("Found no test suites") - } - - r.ComputeSuccinctMode(len(suites)) - - t := time.Now() - - runners := []*testrunner.TestRunner{} - for _, suite := range suites { - runners = append(runners, testrunner.New(suite, r.commandFlags.NumCPU, r.commandFlags.ParallelStream, r.commandFlags.Timeout, r.commandFlags.GoOpts, additionalArgs)) - } - - numSuites := 0 - runResult := testrunner.PassingRunResult() - if r.commandFlags.UntilItFails { - iteration := 0 - for { - r.UpdateSeed() - randomizedRunners := r.randomizeOrder(runners) - runResult, numSuites = r.suiteRunner.RunSuites(randomizedRunners, r.commandFlags.NumCompilers, r.commandFlags.KeepGoing, nil) - iteration++ - - if r.interruptHandler.WasInterrupted() { - break - } - - if runResult.Passed { - fmt.Printf("\nAll tests passed...\nWill keep running them until they fail.\nThis was attempt #%d\n%s\n", iteration, orcMessage(iteration)) - } else { - fmt.Printf("\nTests failed on attempt #%d\n\n", iteration) - break - } - } - } else { - randomizedRunners := r.randomizeOrder(runners) - runResult, numSuites = r.suiteRunner.RunSuites(randomizedRunners, r.commandFlags.NumCompilers, r.commandFlags.KeepGoing, nil) - } - - for _, runner := range runners { - runner.CleanUp() - } - - if r.isInCoverageMode() { - if r.getOutputDir() != "" { - // If coverprofile is set, combine coverages - if r.getCoverprofile() != "" { - if err := r.combineCoverprofiles(runners); err != nil { - fmt.Println(err.Error()) - os.Exit(1) - } - } else { - // Just move them - r.moveCoverprofiles(runners) - } - } - } - - fmt.Printf("\nGinkgo ran %d %s in %s\n", numSuites, pluralizedWord("suite", "suites", numSuites), time.Since(t)) - - if runResult.Passed { - if runResult.HasProgrammaticFocus && strings.TrimSpace(os.Getenv("GINKGO_EDITOR_INTEGRATION")) == "" { - fmt.Printf("Test Suite Passed\n") - fmt.Printf("Detected Programmatic Focus - setting exit status to %d\n", types.GINKGO_FOCUS_EXIT_CODE) - os.Exit(types.GINKGO_FOCUS_EXIT_CODE) - } else { - fmt.Printf("Test Suite Passed\n") - os.Exit(0) - } - } else { - fmt.Printf("Test Suite Failed\n") - os.Exit(1) - } -} - -// Moves all generated profiles to specified directory -func (r *SpecRunner) moveCoverprofiles(runners []*testrunner.TestRunner) { - for _, runner := range runners { - _, filename := filepath.Split(runner.CoverageFile) - err := os.Rename(runner.CoverageFile, filepath.Join(r.getOutputDir(), filename)) - - if err != nil { - fmt.Printf("Unable to move coverprofile %s, %v\n", runner.CoverageFile, err) - return - } - } -} - -// Combines all generated profiles in the specified directory -func (r *SpecRunner) combineCoverprofiles(runners []*testrunner.TestRunner) error { - - path, _ := filepath.Abs(r.getOutputDir()) - if !fileExists(path) { - return fmt.Errorf("Unable to create combined profile, outputdir does not exist: %s", r.getOutputDir()) - } - - fmt.Println("path is " + path) - - combined, err := os.OpenFile(filepath.Join(path, r.getCoverprofile()), - os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0666) - - if err != nil { - fmt.Printf("Unable to create combined profile, %v\n", err) - return nil // non-fatal error - } - - for _, runner := range runners { - contents, err := ioutil.ReadFile(runner.CoverageFile) - - if err != nil { - fmt.Printf("Unable to read coverage file %s to combine, %v\n", runner.CoverageFile, err) - return nil // non-fatal error - } - - _, err = combined.Write(contents) - - if err != nil { - fmt.Printf("Unable to append to coverprofile, %v\n", err) - return nil // non-fatal error - } - } - - fmt.Println("All profiles combined") - return nil -} - -func (r *SpecRunner) isInCoverageMode() bool { - opts := r.commandFlags.GoOpts - return *opts["cover"].(*bool) || *opts["coverpkg"].(*string) != "" || *opts["covermode"].(*string) != "" -} - -func (r *SpecRunner) getCoverprofile() string { - return *r.commandFlags.GoOpts["coverprofile"].(*string) -} - -func (r *SpecRunner) getOutputDir() string { - return *r.commandFlags.GoOpts["outputdir"].(*string) -} - -func (r *SpecRunner) ComputeSuccinctMode(numSuites int) { - if config.DefaultReporterConfig.Verbose { - config.DefaultReporterConfig.Succinct = false - return - } - - if numSuites == 1 { - return - } - - if numSuites > 1 && !r.commandFlags.wasSet("succinct") { - config.DefaultReporterConfig.Succinct = true - } -} - -func (r *SpecRunner) UpdateSeed() { - if !r.commandFlags.wasSet("seed") { - config.GinkgoConfig.RandomSeed = time.Now().Unix() - } -} - -func (r *SpecRunner) randomizeOrder(runners []*testrunner.TestRunner) []*testrunner.TestRunner { - if !r.commandFlags.RandomizeSuites { - return runners - } - - if len(runners) <= 1 { - return runners - } - - randomizedRunners := make([]*testrunner.TestRunner, len(runners)) - randomizer := rand.New(rand.NewSource(config.GinkgoConfig.RandomSeed)) - permutation := randomizer.Perm(len(runners)) - for i, j := range permutation { - randomizedRunners[i] = runners[j] - } - return randomizedRunners -} - -func orcMessage(iteration int) string { - if iteration < 10 { - return "" - } else if iteration < 30 { - return []string{ - "If at first you succeed...", - "...try, try again.", - "Looking good!", - "Still good...", - "I think your tests are fine....", - "Yep, still passing", - "Oh boy, here I go testin' again!", - "Even the gophers are getting bored", - "Did you try -race?", - "Maybe you should stop now?", - "I'm getting tired...", - "What if I just made you a sandwich?", - "Hit ^C, hit ^C, please hit ^C", - "Make it stop. Please!", - "Come on! Enough is enough!", - "Dave, this conversation can serve no purpose anymore. Goodbye.", - "Just what do you think you're doing, Dave? ", - "I, Sisyphus", - "Insanity: doing the same thing over and over again and expecting different results. -Einstein", - "I guess Einstein never tried to churn butter", - }[iteration-10] + "\n" - } else { - return "No, seriously... you can probably stop now.\n" - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go deleted file mode 100644 index e0994fc..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go +++ /dev/null @@ -1,169 +0,0 @@ -package main - -import ( - "flag" - "runtime" - - "time" - - "github.com/onsi/ginkgo/config" -) - -type RunWatchAndBuildCommandFlags struct { - Recurse bool - SkipPackage string - GoOpts map[string]interface{} - - //for run and watch commands - NumCPU int - NumCompilers int - ParallelStream bool - Notify bool - AfterSuiteHook string - AutoNodes bool - Timeout time.Duration - - //only for run command - KeepGoing bool - UntilItFails bool - RandomizeSuites bool - - //only for watch command - Depth int - WatchRegExp string - - FlagSet *flag.FlagSet -} - -const runMode = 1 -const watchMode = 2 -const buildMode = 3 - -func NewRunCommandFlags(flagSet *flag.FlagSet) *RunWatchAndBuildCommandFlags { - c := &RunWatchAndBuildCommandFlags{ - FlagSet: flagSet, - } - c.flags(runMode) - return c -} - -func NewWatchCommandFlags(flagSet *flag.FlagSet) *RunWatchAndBuildCommandFlags { - c := &RunWatchAndBuildCommandFlags{ - FlagSet: flagSet, - } - c.flags(watchMode) - return c -} - -func NewBuildCommandFlags(flagSet *flag.FlagSet) *RunWatchAndBuildCommandFlags { - c := &RunWatchAndBuildCommandFlags{ - FlagSet: flagSet, - } - c.flags(buildMode) - return c -} - -func (c *RunWatchAndBuildCommandFlags) wasSet(flagName string) bool { - wasSet := false - c.FlagSet.Visit(func(f *flag.Flag) { - if f.Name == flagName { - wasSet = true - } - }) - - return wasSet -} - -func (c *RunWatchAndBuildCommandFlags) computeNodes() { - if c.wasSet("nodes") { - return - } - if c.AutoNodes { - switch n := runtime.NumCPU(); { - case n <= 4: - c.NumCPU = n - default: - c.NumCPU = n - 1 - } - } -} - -func (c *RunWatchAndBuildCommandFlags) stringSlot(slot string) *string { - var opt string - c.GoOpts[slot] = &opt - return &opt -} - -func (c *RunWatchAndBuildCommandFlags) boolSlot(slot string) *bool { - var opt bool - c.GoOpts[slot] = &opt - return &opt -} - -func (c *RunWatchAndBuildCommandFlags) intSlot(slot string) *int { - var opt int - c.GoOpts[slot] = &opt - return &opt -} - -func (c *RunWatchAndBuildCommandFlags) flags(mode int) { - c.GoOpts = make(map[string]interface{}) - - onWindows := (runtime.GOOS == "windows") - - c.FlagSet.BoolVar(&(c.Recurse), "r", false, "Find and run test suites under the current directory recursively.") - c.FlagSet.BoolVar(c.boolSlot("race"), "race", false, "Run tests with race detection enabled.") - c.FlagSet.BoolVar(c.boolSlot("cover"), "cover", false, "Run tests with coverage analysis, will generate coverage profiles with the package name in the current directory.") - c.FlagSet.StringVar(c.stringSlot("coverpkg"), "coverpkg", "", "Run tests with coverage on the given external modules.") - c.FlagSet.StringVar(&(c.SkipPackage), "skipPackage", "", "A comma-separated list of package names to be skipped. If any part of the package's path matches, that package is ignored.") - c.FlagSet.StringVar(c.stringSlot("tags"), "tags", "", "A list of build tags to consider satisfied during the build.") - c.FlagSet.StringVar(c.stringSlot("gcflags"), "gcflags", "", "Arguments to pass on each go tool compile invocation.") - c.FlagSet.StringVar(c.stringSlot("covermode"), "covermode", "", "Set the mode for coverage analysis.") - c.FlagSet.BoolVar(c.boolSlot("a"), "a", false, "Force rebuilding of packages that are already up-to-date.") - c.FlagSet.BoolVar(c.boolSlot("n"), "n", false, "Have `go test` print the commands but do not run them.") - c.FlagSet.BoolVar(c.boolSlot("msan"), "msan", false, "Enable interoperation with memory sanitizer.") - c.FlagSet.BoolVar(c.boolSlot("x"), "x", false, "Have `go test` print the commands.") - c.FlagSet.BoolVar(c.boolSlot("work"), "work", false, "Print the name of the temporary work directory and do not delete it when exiting.") - c.FlagSet.StringVar(c.stringSlot("asmflags"), "asmflags", "", "Arguments to pass on each go tool asm invocation.") - c.FlagSet.StringVar(c.stringSlot("buildmode"), "buildmode", "", "Build mode to use. See 'go help buildmode' for more.") - c.FlagSet.StringVar(c.stringSlot("mod"), "mod", "", "Go module control. See 'go help modules' for more.") - c.FlagSet.StringVar(c.stringSlot("compiler"), "compiler", "", "Name of compiler to use, as in runtime.Compiler (gccgo or gc).") - c.FlagSet.StringVar(c.stringSlot("gccgoflags"), "gccgoflags", "", "Arguments to pass on each gccgo compiler/linker invocation.") - c.FlagSet.StringVar(c.stringSlot("installsuffix"), "installsuffix", "", "A suffix to use in the name of the package installation directory.") - c.FlagSet.StringVar(c.stringSlot("ldflags"), "ldflags", "", "Arguments to pass on each go tool link invocation.") - c.FlagSet.BoolVar(c.boolSlot("linkshared"), "linkshared", false, "Link against shared libraries previously created with -buildmode=shared.") - c.FlagSet.StringVar(c.stringSlot("pkgdir"), "pkgdir", "", "install and load all packages from the given dir instead of the usual locations.") - c.FlagSet.StringVar(c.stringSlot("toolexec"), "toolexec", "", "a program to use to invoke toolchain programs like vet and asm.") - c.FlagSet.IntVar(c.intSlot("blockprofilerate"), "blockprofilerate", 1, "Control the detail provided in goroutine blocking profiles by calling runtime.SetBlockProfileRate with the given value.") - c.FlagSet.StringVar(c.stringSlot("coverprofile"), "coverprofile", "", "Write a coverage profile to the specified file after all tests have passed.") - c.FlagSet.StringVar(c.stringSlot("cpuprofile"), "cpuprofile", "", "Write a CPU profile to the specified file before exiting.") - c.FlagSet.StringVar(c.stringSlot("memprofile"), "memprofile", "", "Write a memory profile to the specified file after all tests have passed.") - c.FlagSet.IntVar(c.intSlot("memprofilerate"), "memprofilerate", 0, "Enable more precise (and expensive) memory profiles by setting runtime.MemProfileRate.") - c.FlagSet.StringVar(c.stringSlot("outputdir"), "outputdir", "", "Place output files from profiling in the specified directory.") - c.FlagSet.BoolVar(c.boolSlot("requireSuite"), "requireSuite", false, "Fail if there are ginkgo tests in a directory but no test suite (missing RunSpecs)") - c.FlagSet.StringVar(c.stringSlot("vet"), "vet", "", "Configure the invocation of 'go vet' to use the comma-separated list of vet checks. If list is 'off', 'go test' does not run 'go vet' at all.") - - if mode == runMode || mode == watchMode { - config.Flags(c.FlagSet, "", false) - c.FlagSet.IntVar(&(c.NumCPU), "nodes", 1, "The number of parallel test nodes to run") - c.FlagSet.IntVar(&(c.NumCompilers), "compilers", 0, "The number of concurrent compilations to run (0 will autodetect)") - c.FlagSet.BoolVar(&(c.AutoNodes), "p", false, "Run in parallel with auto-detected number of nodes") - c.FlagSet.BoolVar(&(c.ParallelStream), "stream", onWindows, "stream parallel test output in real time: less coherent, but useful for debugging") - if !onWindows { - c.FlagSet.BoolVar(&(c.Notify), "notify", false, "Send desktop notifications when a test run completes") - } - c.FlagSet.StringVar(&(c.AfterSuiteHook), "afterSuiteHook", "", "Run a command when a suite test run completes") - c.FlagSet.DurationVar(&(c.Timeout), "timeout", 24*time.Hour, "Suite fails if it does not complete within the specified timeout") - } - - if mode == runMode { - c.FlagSet.BoolVar(&(c.KeepGoing), "keepGoing", false, "When true, failures from earlier test suites do not prevent later test suites from running") - c.FlagSet.BoolVar(&(c.UntilItFails), "untilItFails", false, "When true, Ginkgo will keep rerunning tests until a failure occurs") - c.FlagSet.BoolVar(&(c.RandomizeSuites), "randomizeSuites", false, "When true, Ginkgo will randomize the order in which test suites run") - } - - if mode == watchMode { - c.FlagSet.IntVar(&(c.Depth), "depth", 1, "Ginkgo will watch dependencies down to this depth in the dependency tree") - c.FlagSet.StringVar(&(c.WatchRegExp), "watchRegExp", `\.go$`, "Files matching this regular expression will be watched for changes") - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go deleted file mode 100644 index ce6c946..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/suite_runner.go +++ /dev/null @@ -1,173 +0,0 @@ -package main - -import ( - "fmt" - "runtime" - "sync" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/ginkgo/interrupthandler" - "github.com/onsi/ginkgo/ginkgo/testrunner" - "github.com/onsi/ginkgo/ginkgo/testsuite" - colorable "github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable" -) - -type compilationInput struct { - runner *testrunner.TestRunner - result chan compilationOutput -} - -type compilationOutput struct { - runner *testrunner.TestRunner - err error -} - -type SuiteRunner struct { - notifier *Notifier - interruptHandler *interrupthandler.InterruptHandler -} - -func NewSuiteRunner(notifier *Notifier, interruptHandler *interrupthandler.InterruptHandler) *SuiteRunner { - return &SuiteRunner{ - notifier: notifier, - interruptHandler: interruptHandler, - } -} - -func (r *SuiteRunner) compileInParallel(runners []*testrunner.TestRunner, numCompilers int, willCompile func(suite testsuite.TestSuite)) chan compilationOutput { - //we return this to the consumer, it will return each runner in order as it compiles - compilationOutputs := make(chan compilationOutput, len(runners)) - - //an array of channels - the nth runner's compilation output is sent to the nth channel in this array - //we read from these channels in order to ensure we run the suites in order - orderedCompilationOutputs := []chan compilationOutput{} - for _ = range runners { - orderedCompilationOutputs = append(orderedCompilationOutputs, make(chan compilationOutput, 1)) - } - - //we're going to spin up numCompilers compilers - they're going to run concurrently and will consume this channel - //we prefill the channel then close it, this ensures we compile things in the correct order - workPool := make(chan compilationInput, len(runners)) - for i, runner := range runners { - workPool <- compilationInput{runner, orderedCompilationOutputs[i]} - } - close(workPool) - - //pick a reasonable numCompilers - if numCompilers == 0 { - numCompilers = runtime.NumCPU() - } - - //a WaitGroup to help us wait for all compilers to shut down - wg := &sync.WaitGroup{} - wg.Add(numCompilers) - - //spin up the concurrent compilers - for i := 0; i < numCompilers; i++ { - go func() { - defer wg.Done() - for input := range workPool { - if r.interruptHandler.WasInterrupted() { - return - } - - if willCompile != nil { - willCompile(input.runner.Suite) - } - - //We retry because Go sometimes steps on itself when multiple compiles happen in parallel. This is ugly, but should help resolve flakiness... - var err error - retries := 0 - for retries <= 5 { - if r.interruptHandler.WasInterrupted() { - return - } - if err = input.runner.Compile(); err == nil { - break - } - retries++ - } - - input.result <- compilationOutput{input.runner, err} - } - }() - } - - //read from the compilation output channels *in order* and send them to the caller - //close the compilationOutputs channel to tell the caller we're done - go func() { - defer close(compilationOutputs) - for _, orderedCompilationOutput := range orderedCompilationOutputs { - select { - case compilationOutput := <-orderedCompilationOutput: - compilationOutputs <- compilationOutput - case <-r.interruptHandler.C: - //interrupt detected, wait for the compilers to shut down then bail - //this ensure we clean up after ourselves as we don't leave any compilation processes running - wg.Wait() - return - } - } - }() - - return compilationOutputs -} - -func (r *SuiteRunner) RunSuites(runners []*testrunner.TestRunner, numCompilers int, keepGoing bool, willCompile func(suite testsuite.TestSuite)) (testrunner.RunResult, int) { - runResult := testrunner.PassingRunResult() - - compilationOutputs := r.compileInParallel(runners, numCompilers, willCompile) - - numSuitesThatRan := 0 - suitesThatFailed := []testsuite.TestSuite{} - for compilationOutput := range compilationOutputs { - if compilationOutput.err != nil { - fmt.Print(compilationOutput.err.Error()) - } - numSuitesThatRan++ - suiteRunResult := testrunner.FailingRunResult() - if compilationOutput.err == nil { - suiteRunResult = compilationOutput.runner.Run() - } - r.notifier.SendSuiteCompletionNotification(compilationOutput.runner.Suite, suiteRunResult.Passed) - r.notifier.RunCommand(compilationOutput.runner.Suite, suiteRunResult.Passed) - runResult = runResult.Merge(suiteRunResult) - if !suiteRunResult.Passed { - suitesThatFailed = append(suitesThatFailed, compilationOutput.runner.Suite) - if !keepGoing { - break - } - } - if numSuitesThatRan < len(runners) && !config.DefaultReporterConfig.Succinct { - fmt.Println("") - } - } - - if keepGoing && !runResult.Passed { - r.listFailedSuites(suitesThatFailed) - } - - return runResult, numSuitesThatRan -} - -func (r *SuiteRunner) listFailedSuites(suitesThatFailed []testsuite.TestSuite) { - fmt.Println("") - fmt.Println("There were failures detected in the following suites:") - - maxPackageNameLength := 0 - for _, suite := range suitesThatFailed { - if len(suite.PackageName) > maxPackageNameLength { - maxPackageNameLength = len(suite.PackageName) - } - } - - packageNameFormatter := fmt.Sprintf("%%%ds", maxPackageNameLength) - - for _, suite := range suitesThatFailed { - if config.DefaultReporterConfig.NoColor { - fmt.Printf("\t"+packageNameFormatter+" %s\n", suite.PackageName, suite.Path) - } else { - fmt.Fprintf(colorable.NewColorableStdout(), "\t%s"+packageNameFormatter+"%s %s%s%s\n", redColor, suite.PackageName, defaultStyle, lightGrayColor, suite.Path, defaultStyle) - } - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args.go deleted file mode 100644 index 3b1a238..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build go1.10 - -package testrunner - -var ( - buildArgs = []string{"test", "-c"} -) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args_old.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args_old.go deleted file mode 100644 index 14d70db..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/build_args_old.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !go1.10 - -package testrunner - -var ( - buildArgs = []string{"test", "-c", "-i"} -) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/log_writer.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/log_writer.go deleted file mode 100644 index a73a6e3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/log_writer.go +++ /dev/null @@ -1,52 +0,0 @@ -package testrunner - -import ( - "bytes" - "fmt" - "io" - "log" - "strings" - "sync" -) - -type logWriter struct { - buffer *bytes.Buffer - lock *sync.Mutex - log *log.Logger -} - -func newLogWriter(target io.Writer, node int) *logWriter { - return &logWriter{ - buffer: &bytes.Buffer{}, - lock: &sync.Mutex{}, - log: log.New(target, fmt.Sprintf("[%d] ", node), 0), - } -} - -func (w *logWriter) Write(data []byte) (n int, err error) { - w.lock.Lock() - defer w.lock.Unlock() - - w.buffer.Write(data) - contents := w.buffer.String() - - lines := strings.Split(contents, "\n") - for _, line := range lines[0 : len(lines)-1] { - w.log.Println(line) - } - - w.buffer.Reset() - w.buffer.Write([]byte(lines[len(lines)-1])) - return len(data), nil -} - -func (w *logWriter) Close() error { - w.lock.Lock() - defer w.lock.Unlock() - - if w.buffer.Len() > 0 { - w.log.Println(w.buffer.String()) - } - - return nil -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/run_result.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/run_result.go deleted file mode 100644 index 5d472ac..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/run_result.go +++ /dev/null @@ -1,27 +0,0 @@ -package testrunner - -type RunResult struct { - Passed bool - HasProgrammaticFocus bool -} - -func PassingRunResult() RunResult { - return RunResult{ - Passed: true, - HasProgrammaticFocus: false, - } -} - -func FailingRunResult() RunResult { - return RunResult{ - Passed: false, - HasProgrammaticFocus: false, - } -} - -func (r RunResult) Merge(o RunResult) RunResult { - return RunResult{ - Passed: r.Passed && o.Passed, - HasProgrammaticFocus: r.HasProgrammaticFocus || o.HasProgrammaticFocus, - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go deleted file mode 100644 index dccb395..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go +++ /dev/null @@ -1,558 +0,0 @@ -package testrunner - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strconv" - "strings" - "syscall" - "time" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/ginkgo/testsuite" - "github.com/onsi/ginkgo/internal/remote" - "github.com/onsi/ginkgo/reporters/stenographer" - colorable "github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable" - "github.com/onsi/ginkgo/types" -) - -type TestRunner struct { - Suite testsuite.TestSuite - - compiled bool - compilationTargetPath string - - numCPU int - parallelStream bool - timeout time.Duration - goOpts map[string]interface{} - additionalArgs []string - stderr *bytes.Buffer - - CoverageFile string -} - -func New(suite testsuite.TestSuite, numCPU int, parallelStream bool, timeout time.Duration, goOpts map[string]interface{}, additionalArgs []string) *TestRunner { - runner := &TestRunner{ - Suite: suite, - numCPU: numCPU, - parallelStream: parallelStream, - goOpts: goOpts, - additionalArgs: additionalArgs, - timeout: timeout, - stderr: new(bytes.Buffer), - } - - if !suite.Precompiled { - dir, err := ioutil.TempDir("", "ginkgo") - if err != nil { - panic(fmt.Sprintf("couldn't create temporary directory... might be time to rm -rf:\n%s", err.Error())) - } - runner.compilationTargetPath = filepath.Join(dir, suite.PackageName+".test") - } - - return runner -} - -func (t *TestRunner) Compile() error { - return t.CompileTo(t.compilationTargetPath) -} - -func (t *TestRunner) BuildArgs(path string) []string { - args := make([]string, len(buildArgs), len(buildArgs)+3) - copy(args, buildArgs) - args = append(args, "-o", path, t.Suite.Path) - - if t.getCoverMode() != "" { - args = append(args, "-cover", fmt.Sprintf("-covermode=%s", t.getCoverMode())) - } else { - if t.shouldCover() || t.getCoverPackage() != "" { - args = append(args, "-cover", "-covermode=atomic") - } - } - - boolOpts := []string{ - "a", - "n", - "msan", - "race", - "x", - "work", - "linkshared", - } - - for _, opt := range boolOpts { - if s, found := t.goOpts[opt].(*bool); found && *s { - args = append(args, fmt.Sprintf("-%s", opt)) - } - } - - intOpts := []string{ - "memprofilerate", - "blockprofilerate", - } - - for _, opt := range intOpts { - if s, found := t.goOpts[opt].(*int); found { - args = append(args, fmt.Sprintf("-%s=%d", opt, *s)) - } - } - - stringOpts := []string{ - "asmflags", - "buildmode", - "compiler", - "gccgoflags", - "installsuffix", - "ldflags", - "pkgdir", - "toolexec", - "coverprofile", - "cpuprofile", - "memprofile", - "outputdir", - "coverpkg", - "tags", - "gcflags", - "vet", - "mod", - } - - for _, opt := range stringOpts { - if s, found := t.goOpts[opt].(*string); found && *s != "" { - args = append(args, fmt.Sprintf("-%s=%s", opt, *s)) - } - } - return args -} - -func (t *TestRunner) CompileTo(path string) error { - if t.compiled { - return nil - } - - if t.Suite.Precompiled { - return nil - } - - args := t.BuildArgs(path) - cmd := exec.Command("go", args...) - - output, err := cmd.CombinedOutput() - - if err != nil { - if len(output) > 0 { - return fmt.Errorf("Failed to compile %s:\n\n%s", t.Suite.PackageName, output) - } - return fmt.Errorf("Failed to compile %s", t.Suite.PackageName) - } - - if len(output) > 0 { - fmt.Println(string(output)) - } - - if fileExists(path) == false { - compiledFile := t.Suite.PackageName + ".test" - if fileExists(compiledFile) { - // seems like we are on an old go version that does not support the -o flag on go test - // move the compiled test file to the desired location by hand - err = os.Rename(compiledFile, path) - if err != nil { - // We cannot move the file, perhaps because the source and destination - // are on different partitions. We can copy the file, however. - err = copyFile(compiledFile, path) - if err != nil { - return fmt.Errorf("Failed to copy compiled file: %s", err) - } - } - } else { - return fmt.Errorf("Failed to compile %s: output file %q could not be found", t.Suite.PackageName, path) - } - } - - t.compiled = true - - return nil -} - -func fileExists(path string) bool { - _, err := os.Stat(path) - return err == nil || os.IsNotExist(err) == false -} - -// copyFile copies the contents of the file named src to the file named -// by dst. The file will be created if it does not already exist. If the -// destination file exists, all it's contents will be replaced by the contents -// of the source file. -func copyFile(src, dst string) error { - srcInfo, err := os.Stat(src) - if err != nil { - return err - } - mode := srcInfo.Mode() - - in, err := os.Open(src) - if err != nil { - return err - } - - defer in.Close() - - out, err := os.Create(dst) - if err != nil { - return err - } - - defer func() { - closeErr := out.Close() - if err == nil { - err = closeErr - } - }() - - _, err = io.Copy(out, in) - if err != nil { - return err - } - - err = out.Sync() - if err != nil { - return err - } - - return out.Chmod(mode) -} - -func (t *TestRunner) Run() RunResult { - if t.Suite.IsGinkgo { - if t.numCPU > 1 { - if t.parallelStream { - return t.runAndStreamParallelGinkgoSuite() - } else { - return t.runParallelGinkgoSuite() - } - } else { - return t.runSerialGinkgoSuite() - } - } else { - return t.runGoTestSuite() - } -} - -func (t *TestRunner) CleanUp() { - if t.Suite.Precompiled { - return - } - os.RemoveAll(filepath.Dir(t.compilationTargetPath)) -} - -func (t *TestRunner) runSerialGinkgoSuite() RunResult { - ginkgoArgs := config.BuildFlagArgs("ginkgo", config.GinkgoConfig, config.DefaultReporterConfig) - return t.run(t.cmd(ginkgoArgs, os.Stdout, 1), nil) -} - -func (t *TestRunner) runGoTestSuite() RunResult { - return t.run(t.cmd([]string{"-test.v"}, os.Stdout, 1), nil) -} - -func (t *TestRunner) runAndStreamParallelGinkgoSuite() RunResult { - completions := make(chan RunResult) - writers := make([]*logWriter, t.numCPU) - - server, err := remote.NewServer(t.numCPU) - if err != nil { - panic("Failed to start parallel spec server") - } - - server.Start() - defer server.Close() - - for cpu := 0; cpu < t.numCPU; cpu++ { - config.GinkgoConfig.ParallelNode = cpu + 1 - config.GinkgoConfig.ParallelTotal = t.numCPU - config.GinkgoConfig.SyncHost = server.Address() - - ginkgoArgs := config.BuildFlagArgs("ginkgo", config.GinkgoConfig, config.DefaultReporterConfig) - - writers[cpu] = newLogWriter(os.Stdout, cpu+1) - - cmd := t.cmd(ginkgoArgs, writers[cpu], cpu+1) - - server.RegisterAlive(cpu+1, func() bool { - if cmd.ProcessState == nil { - return true - } - return !cmd.ProcessState.Exited() - }) - - go t.run(cmd, completions) - } - - res := PassingRunResult() - - for cpu := 0; cpu < t.numCPU; cpu++ { - res = res.Merge(<-completions) - } - - for _, writer := range writers { - writer.Close() - } - - os.Stdout.Sync() - - if t.shouldCombineCoverprofiles() { - t.combineCoverprofiles() - } - - return res -} - -func (t *TestRunner) runParallelGinkgoSuite() RunResult { - result := make(chan bool) - completions := make(chan RunResult) - writers := make([]*logWriter, t.numCPU) - reports := make([]*bytes.Buffer, t.numCPU) - - stenographer := stenographer.New(!config.DefaultReporterConfig.NoColor, config.GinkgoConfig.FlakeAttempts > 1, colorable.NewColorableStdout()) - aggregator := remote.NewAggregator(t.numCPU, result, config.DefaultReporterConfig, stenographer) - - server, err := remote.NewServer(t.numCPU) - if err != nil { - panic("Failed to start parallel spec server") - } - server.RegisterReporters(aggregator) - server.Start() - defer server.Close() - - for cpu := 0; cpu < t.numCPU; cpu++ { - config.GinkgoConfig.ParallelNode = cpu + 1 - config.GinkgoConfig.ParallelTotal = t.numCPU - config.GinkgoConfig.SyncHost = server.Address() - config.GinkgoConfig.StreamHost = server.Address() - - ginkgoArgs := config.BuildFlagArgs("ginkgo", config.GinkgoConfig, config.DefaultReporterConfig) - - reports[cpu] = &bytes.Buffer{} - writers[cpu] = newLogWriter(reports[cpu], cpu+1) - - cmd := t.cmd(ginkgoArgs, writers[cpu], cpu+1) - - server.RegisterAlive(cpu+1, func() bool { - if cmd.ProcessState == nil { - return true - } - return !cmd.ProcessState.Exited() - }) - - go t.run(cmd, completions) - } - - res := PassingRunResult() - - for cpu := 0; cpu < t.numCPU; cpu++ { - res = res.Merge(<-completions) - } - - //all test processes are done, at this point - //we should be able to wait for the aggregator to tell us that it's done - - select { - case <-result: - fmt.Println("") - case <-time.After(time.Second): - //the aggregator never got back to us! something must have gone wrong - fmt.Println(` - ------------------------------------------------------------------- - | | - | Ginkgo timed out waiting for all parallel nodes to report back! | - | | - -------------------------------------------------------------------`) - fmt.Println("\n", t.Suite.PackageName, "timed out. path:", t.Suite.Path) - os.Stdout.Sync() - - for _, writer := range writers { - writer.Close() - } - - for _, report := range reports { - fmt.Print(report.String()) - } - - os.Stdout.Sync() - } - - if t.shouldCombineCoverprofiles() { - t.combineCoverprofiles() - } - - return res -} - -const CoverProfileSuffix = ".coverprofile" - -func (t *TestRunner) cmd(ginkgoArgs []string, stream io.Writer, node int) *exec.Cmd { - args := []string{"--test.timeout=" + t.timeout.String()} - - coverProfile := t.getCoverProfile() - - if t.shouldCombineCoverprofiles() { - - testCoverProfile := "--test.coverprofile=" - - coverageFile := "" - // Set default name for coverage results - if coverProfile == "" { - coverageFile = t.Suite.PackageName + CoverProfileSuffix - } else { - coverageFile = coverProfile - } - - testCoverProfile += coverageFile - - t.CoverageFile = filepath.Join(t.Suite.Path, coverageFile) - - if t.numCPU > 1 { - testCoverProfile = fmt.Sprintf("%s.%d", testCoverProfile, node) - } - args = append(args, testCoverProfile) - } - - args = append(args, ginkgoArgs...) - args = append(args, t.additionalArgs...) - - path := t.compilationTargetPath - if t.Suite.Precompiled { - path, _ = filepath.Abs(filepath.Join(t.Suite.Path, fmt.Sprintf("%s.test", t.Suite.PackageName))) - } - - cmd := exec.Command(path, args...) - - cmd.Dir = t.Suite.Path - cmd.Stderr = io.MultiWriter(stream, t.stderr) - cmd.Stdout = stream - - return cmd -} - -func (t *TestRunner) shouldCover() bool { - return *t.goOpts["cover"].(*bool) -} - -func (t *TestRunner) shouldRequireSuite() bool { - return *t.goOpts["requireSuite"].(*bool) -} - -func (t *TestRunner) getCoverProfile() string { - return *t.goOpts["coverprofile"].(*string) -} - -func (t *TestRunner) getCoverPackage() string { - return *t.goOpts["coverpkg"].(*string) -} - -func (t *TestRunner) getCoverMode() string { - return *t.goOpts["covermode"].(*string) -} - -func (t *TestRunner) shouldCombineCoverprofiles() bool { - return t.shouldCover() || t.getCoverPackage() != "" || t.getCoverMode() != "" -} - -func (t *TestRunner) run(cmd *exec.Cmd, completions chan RunResult) RunResult { - var res RunResult - - defer func() { - if completions != nil { - completions <- res - } - }() - - err := cmd.Start() - if err != nil { - fmt.Printf("Failed to run test suite!\n\t%s", err.Error()) - return res - } - - cmd.Wait() - - exitStatus := cmd.ProcessState.Sys().(syscall.WaitStatus).ExitStatus() - res.Passed = (exitStatus == 0) || (exitStatus == types.GINKGO_FOCUS_EXIT_CODE) - res.HasProgrammaticFocus = (exitStatus == types.GINKGO_FOCUS_EXIT_CODE) - - if strings.Contains(t.stderr.String(), "warning: no tests to run") { - if t.shouldRequireSuite() { - res.Passed = false - } - fmt.Fprintf(os.Stderr, `Found no test suites, did you forget to run "ginkgo bootstrap"?`) - } - - return res -} - -func (t *TestRunner) combineCoverprofiles() { - profiles := []string{} - - coverProfile := t.getCoverProfile() - - for cpu := 1; cpu <= t.numCPU; cpu++ { - var coverFile string - if coverProfile == "" { - coverFile = fmt.Sprintf("%s%s.%d", t.Suite.PackageName, CoverProfileSuffix, cpu) - } else { - coverFile = fmt.Sprintf("%s.%d", coverProfile, cpu) - } - - coverFile = filepath.Join(t.Suite.Path, coverFile) - coverProfile, err := ioutil.ReadFile(coverFile) - os.Remove(coverFile) - - if err == nil { - profiles = append(profiles, string(coverProfile)) - } - } - - if len(profiles) != t.numCPU { - return - } - - lines := map[string]int{} - lineOrder := []string{} - for i, coverProfile := range profiles { - for _, line := range strings.Split(string(coverProfile), "\n")[1:] { - if len(line) == 0 { - continue - } - components := strings.Split(line, " ") - count, _ := strconv.Atoi(components[len(components)-1]) - prefix := strings.Join(components[0:len(components)-1], " ") - lines[prefix] += count - if i == 0 { - lineOrder = append(lineOrder, prefix) - } - } - } - - output := []string{"mode: atomic"} - for _, line := range lineOrder { - output = append(output, fmt.Sprintf("%s %d", line, lines[line])) - } - finalOutput := strings.Join(output, "\n") - - finalFilename := "" - - if coverProfile != "" { - finalFilename = coverProfile - } else { - finalFilename = fmt.Sprintf("%s%s", t.Suite.PackageName, CoverProfileSuffix) - } - - coverageFilepath := filepath.Join(t.Suite.Path, finalFilename) - ioutil.WriteFile(coverageFilepath, []byte(finalOutput), 0666) - - t.CoverageFile = coverageFilepath -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go deleted file mode 100644 index 89e4f07..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package testrunner_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/ginkgo/testrunner" - "github.com/onsi/ginkgo/ginkgo/testsuite" - . "github.com/onsi/gomega" -) - -func strAddr(s string) interface{} { - return &s -} - -func boolAddr(s bool) interface{} { - return &s -} - -func intAddr(s int) interface{} { - return &s -} - -var _ = Describe("TestRunner", func() { - It("should pass through go opts", func() { - //var opts map[string]interface{} - opts := map[string]interface{}{ - "asmflags": strAddr("a"), - "pkgdir": strAddr("b"), - "gcflags": strAddr("c"), - "covermode": strAddr(""), - "coverpkg": strAddr(""), - "cover": boolAddr(false), - "blockprofilerate": intAddr(100), - "vet": strAddr("off"), - "mod": strAddr("vendor"), - } - tr := testrunner.New(testsuite.TestSuite{}, 1, false, 0, opts, []string{}) - - args := tr.BuildArgs(".") - // Remove the "-i" argument; This is discarded in Golang 1.10+. - if args[2] == "-i" { - args = append(args[0:2], args[3:]...) - } - Ω(args).Should(Equal([]string{ - "test", - "-c", - "-o", - ".", - "", - "-blockprofilerate=100", - "-asmflags=a", - "-pkgdir=b", - "-gcflags=c", - "-vet=off", - "-mod=vendor", - })) - }) -}) - -func TestTestRunner(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Test Runner Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go deleted file mode 100644 index 9de8c2b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go +++ /dev/null @@ -1,115 +0,0 @@ -package testsuite - -import ( - "errors" - "io/ioutil" - "os" - "path/filepath" - "regexp" - "strings" -) - -type TestSuite struct { - Path string - PackageName string - IsGinkgo bool - Precompiled bool -} - -func PrecompiledTestSuite(path string) (TestSuite, error) { - info, err := os.Stat(path) - if err != nil { - return TestSuite{}, err - } - - if info.IsDir() { - return TestSuite{}, errors.New("this is a directory, not a file") - } - - if filepath.Ext(path) != ".test" { - return TestSuite{}, errors.New("this is not a .test binary") - } - - if info.Mode()&0111 == 0 { - return TestSuite{}, errors.New("this is not executable") - } - - dir := relPath(filepath.Dir(path)) - packageName := strings.TrimSuffix(filepath.Base(path), filepath.Ext(path)) - - return TestSuite{ - Path: dir, - PackageName: packageName, - IsGinkgo: true, - Precompiled: true, - }, nil -} - -func SuitesInDir(dir string, recurse bool) []TestSuite { - suites := []TestSuite{} - - if vendorExperimentCheck(dir) { - return suites - } - - files, _ := ioutil.ReadDir(dir) - re := regexp.MustCompile(`^[^._].*_test\.go$`) - for _, file := range files { - if !file.IsDir() && re.Match([]byte(file.Name())) { - suites = append(suites, New(dir, files)) - break - } - } - - if recurse { - re = regexp.MustCompile(`^[._]`) - for _, file := range files { - if file.IsDir() && !re.Match([]byte(file.Name())) { - suites = append(suites, SuitesInDir(dir+"/"+file.Name(), recurse)...) - } - } - } - - return suites -} - -func relPath(dir string) string { - dir, _ = filepath.Abs(dir) - cwd, _ := os.Getwd() - dir, _ = filepath.Rel(cwd, filepath.Clean(dir)) - - if string(dir[0]) != "." { - dir = "." + string(filepath.Separator) + dir - } - - return dir -} - -func New(dir string, files []os.FileInfo) TestSuite { - return TestSuite{ - Path: relPath(dir), - PackageName: packageNameForSuite(dir), - IsGinkgo: filesHaveGinkgoSuite(dir, files), - } -} - -func packageNameForSuite(dir string) string { - path, _ := filepath.Abs(dir) - return filepath.Base(path) -} - -func filesHaveGinkgoSuite(dir string, files []os.FileInfo) bool { - reTestFile := regexp.MustCompile(`_test\.go$`) - reGinkgo := regexp.MustCompile(`package ginkgo|\/ginkgo"`) - - for _, file := range files { - if !file.IsDir() && reTestFile.Match([]byte(file.Name())) { - contents, _ := ioutil.ReadFile(dir + "/" + file.Name()) - if reGinkgo.Match(contents) { - return true - } - } - } - - return false -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go deleted file mode 100644 index d1e8b21..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package testsuite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestTestsuite(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Testsuite Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go deleted file mode 100644 index 7a0753b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go +++ /dev/null @@ -1,212 +0,0 @@ -// +build go1.6 - -package testsuite_test - -import ( - "io/ioutil" - "os" - "path/filepath" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/ginkgo/testsuite" - . "github.com/onsi/gomega" -) - -var _ = Describe("TestSuite", func() { - var tmpDir string - var relTmpDir string - - writeFile := func(folder string, filename string, content string, mode os.FileMode) { - path := filepath.Join(tmpDir, folder) - err := os.MkdirAll(path, 0700) - Ω(err).ShouldNot(HaveOccurred()) - - path = filepath.Join(path, filename) - ioutil.WriteFile(path, []byte(content), mode) - } - - var origVendor string - - BeforeSuite(func() { - origVendor = os.Getenv("GO15VENDOREXPERIMENT") - }) - - AfterSuite(func() { - os.Setenv("GO15VENDOREXPERIMENT", origVendor) - }) - - BeforeEach(func() { - var err error - tmpDir, err = ioutil.TempDir("/tmp", "ginkgo") - Ω(err).ShouldNot(HaveOccurred()) - - cwd, err := os.Getwd() - Ω(err).ShouldNot(HaveOccurred()) - relTmpDir, err = filepath.Rel(cwd, tmpDir) - Ω(err).ShouldNot(HaveOccurred()) - - //go files in the root directory (no tests) - writeFile("/", "main.go", "package main", 0666) - - //non-go files in a nested directory - writeFile("/redherring", "big_test.jpg", "package ginkgo", 0666) - - //ginkgo tests in ignored go files - writeFile("/ignored", ".ignore_dot_test.go", `import "github.com/onsi/ginkgo"`, 0666) - writeFile("/ignored", "_ignore_underscore_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //non-ginkgo tests in a nested directory - writeFile("/professorplum", "professorplum_test.go", `import "testing"`, 0666) - - //ginkgo tests in a nested directory - writeFile("/colonelmustard", "colonelmustard_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //ginkgo tests in a deeply nested directory - writeFile("/colonelmustard/library", "library_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //ginkgo tests deeply nested in a vendored dependency - writeFile("/vendor/mrspeacock/lounge", "lounge_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //a precompiled ginkgo test - writeFile("/precompiled-dir", "precompiled.test", `fake-binary-file`, 0777) - writeFile("/precompiled-dir", "some-other-binary", `fake-binary-file`, 0777) - writeFile("/precompiled-dir", "nonexecutable.test", `fake-binary-file`, 0666) - }) - - AfterEach(func() { - os.RemoveAll(tmpDir) - }) - - Describe("Finding precompiled test suites", func() { - Context("if pointed at an executable file that ends with .test", func() { - It("should return a precompiled test suite", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "precompiled.test")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(suite).Should(Equal(TestSuite{ - Path: relTmpDir + "/precompiled-dir", - PackageName: "precompiled", - IsGinkgo: true, - Precompiled: true, - })) - }) - }) - - Context("if pointed at a directory", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - - Context("if pointed at an executable that doesn't have .test", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "some-other-binary")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - - Context("if pointed at a .test that isn't executable", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nonexecutable.test")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - - Context("if pointed at a nonexisting file", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nope-nothing-to-see-here")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - }) - - Describe("scanning for suites in a directory", func() { - Context("when there are no tests in the specified directory", func() { - It("should come up empty", func() { - suites := SuitesInDir(tmpDir, false) - Ω(suites).Should(BeEmpty()) - }) - }) - - Context("when there are ginkgo tests in the specified directory", func() { - It("should return an appropriately configured suite", func() { - suites := SuitesInDir(filepath.Join(tmpDir, "colonelmustard"), false) - Ω(suites).Should(HaveLen(1)) - - Ω(suites[0].Path).Should(Equal(relTmpDir + "/colonelmustard")) - Ω(suites[0].PackageName).Should(Equal("colonelmustard")) - Ω(suites[0].IsGinkgo).Should(BeTrue()) - Ω(suites[0].Precompiled).Should(BeFalse()) - }) - }) - - Context("when there are ginkgo tests that are ignored by go in the specified directory ", func() { - It("should come up empty", func() { - suites := SuitesInDir(filepath.Join(tmpDir, "ignored"), false) - Ω(suites).Should(BeEmpty()) - }) - }) - - Context("when there are non-ginkgo tests in the specified directory", func() { - It("should return an appropriately configured suite", func() { - suites := SuitesInDir(filepath.Join(tmpDir, "professorplum"), false) - Ω(suites).Should(HaveLen(1)) - - Ω(suites[0].Path).Should(Equal(relTmpDir + "/professorplum")) - Ω(suites[0].PackageName).Should(Equal("professorplum")) - Ω(suites[0].IsGinkgo).Should(BeFalse()) - Ω(suites[0].Precompiled).Should(BeFalse()) - }) - }) - - Context("given GO15VENDOREXPERIMENT disabled", func() { - BeforeEach(func() { - os.Setenv("GO15VENDOREXPERIMENT", "0") - }) - - AfterEach(func() { - os.Setenv("GO15VENDOREXPERIMENT", "") - }) - - It("should not skip vendor dirs", func() { - suites := SuitesInDir(filepath.Join(tmpDir+"/vendor"), true) - Ω(suites).Should(HaveLen(1)) - }) - - It("should recurse into vendor dirs", func() { - suites := SuitesInDir(filepath.Join(tmpDir), true) - Ω(suites).Should(HaveLen(4)) - }) - }) - - Context("when recursively scanning", func() { - It("should return suites for corresponding test suites, only", func() { - suites := SuitesInDir(tmpDir, true) - Ω(suites).Should(HaveLen(3)) - - Ω(suites).Should(ContainElement(TestSuite{ - Path: relTmpDir + "/colonelmustard", - PackageName: "colonelmustard", - IsGinkgo: true, - Precompiled: false, - })) - Ω(suites).Should(ContainElement(TestSuite{ - Path: relTmpDir + "/professorplum", - PackageName: "professorplum", - IsGinkgo: false, - Precompiled: false, - })) - Ω(suites).Should(ContainElement(TestSuite{ - Path: relTmpDir + "/colonelmustard/library", - PackageName: "library", - IsGinkgo: true, - Precompiled: false, - })) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15.go deleted file mode 100644 index 75f827a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build !go1.6 - -package testsuite - -import ( - "os" - "path" -) - -// "This change will only be enabled if the go command is run with -// GO15VENDOREXPERIMENT=1 in its environment." -// c.f. the vendor-experiment proposal https://goo.gl/2ucMeC -func vendorExperimentCheck(dir string) bool { - vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") - return vendorExperiment == "1" && path.Base(dir) == "vendor" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go deleted file mode 100644 index dc3ca2a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go +++ /dev/null @@ -1,201 +0,0 @@ -// +build !go1.6 - -package testsuite_test - -import ( - "io/ioutil" - "os" - "path/filepath" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/ginkgo/testsuite" - . "github.com/onsi/gomega" -) - -var _ = Describe("TestSuite", func() { - var tmpDir string - var relTmpDir string - - writeFile := func(folder string, filename string, content string, mode os.FileMode) { - path := filepath.Join(tmpDir, folder) - err := os.MkdirAll(path, 0700) - Ω(err).ShouldNot(HaveOccurred()) - - path = filepath.Join(path, filename) - ioutil.WriteFile(path, []byte(content), mode) - } - - var origVendor string - - BeforeSuite(func() { - origVendor = os.Getenv("GO15VENDOREXPERIMENT") - }) - - AfterSuite(func() { - os.Setenv("GO15VENDOREXPERIMENT", origVendor) - }) - - BeforeEach(func() { - var err error - tmpDir, err = ioutil.TempDir("/tmp", "ginkgo") - Ω(err).ShouldNot(HaveOccurred()) - - cwd, err := os.Getwd() - Ω(err).ShouldNot(HaveOccurred()) - relTmpDir, err = filepath.Rel(cwd, tmpDir) - Ω(err).ShouldNot(HaveOccurred()) - - //go files in the root directory (no tests) - writeFile("/", "main.go", "package main", 0666) - - //non-go files in a nested directory - writeFile("/redherring", "big_test.jpg", "package ginkgo", 0666) - - //non-ginkgo tests in a nested directory - writeFile("/professorplum", "professorplum_test.go", `import "testing"`, 0666) - - //ginkgo tests in a nested directory - writeFile("/colonelmustard", "colonelmustard_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //ginkgo tests in a deeply nested directory - writeFile("/colonelmustard/library", "library_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //ginkgo tests deeply nested in a vendored dependency - writeFile("/vendor/mrspeacock/lounge", "lounge_test.go", `import "github.com/onsi/ginkgo"`, 0666) - - //a precompiled ginkgo test - writeFile("/precompiled-dir", "precompiled.test", `fake-binary-file`, 0777) - writeFile("/precompiled-dir", "some-other-binary", `fake-binary-file`, 0777) - writeFile("/precompiled-dir", "nonexecutable.test", `fake-binary-file`, 0666) - }) - - AfterEach(func() { - os.RemoveAll(tmpDir) - }) - - Describe("Finding precompiled test suites", func() { - Context("if pointed at an executable file that ends with .test", func() { - It("should return a precompiled test suite", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "precompiled.test")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(suite).Should(Equal(TestSuite{ - Path: relTmpDir + "/precompiled-dir", - PackageName: "precompiled", - IsGinkgo: true, - Precompiled: true, - })) - }) - }) - - Context("if pointed at a directory", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - - Context("if pointed at an executable that doesn't have .test", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "some-other-binary")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - - Context("if pointed at a .test that isn't executable", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nonexecutable.test")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - - Context("if pointed at a nonexisting file", func() { - It("should error", func() { - suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nope-nothing-to-see-here")) - Ω(suite).Should(BeZero()) - Ω(err).Should(HaveOccurred()) - }) - }) - }) - - Describe("scanning for suites in a directory", func() { - Context("when there are no tests in the specified directory", func() { - It("should come up empty", func() { - suites := SuitesInDir(tmpDir, false) - Ω(suites).Should(BeEmpty()) - }) - }) - - Context("when there are ginkgo tests in the specified directory", func() { - It("should return an appropriately configured suite", func() { - suites := SuitesInDir(filepath.Join(tmpDir, "colonelmustard"), false) - Ω(suites).Should(HaveLen(1)) - - Ω(suites[0].Path).Should(Equal(relTmpDir + "/colonelmustard")) - Ω(suites[0].PackageName).Should(Equal("colonelmustard")) - Ω(suites[0].IsGinkgo).Should(BeTrue()) - Ω(suites[0].Precompiled).Should(BeFalse()) - }) - }) - - Context("when there are non-ginkgo tests in the specified directory", func() { - It("should return an appropriately configured suite", func() { - suites := SuitesInDir(filepath.Join(tmpDir, "professorplum"), false) - Ω(suites).Should(HaveLen(1)) - - Ω(suites[0].Path).Should(Equal(relTmpDir + "/professorplum")) - Ω(suites[0].PackageName).Should(Equal("professorplum")) - Ω(suites[0].IsGinkgo).Should(BeFalse()) - Ω(suites[0].Precompiled).Should(BeFalse()) - }) - }) - - Context("given GO15VENDOREXPERIMENT", func() { - BeforeEach(func() { - os.Setenv("GO15VENDOREXPERIMENT", "1") - }) - - AfterEach(func() { - os.Setenv("GO15VENDOREXPERIMENT", "") - }) - - It("should skip vendor dirs", func() { - suites := SuitesInDir(filepath.Join(tmpDir+"/vendor"), false) - Ω(suites).Should(HaveLen(0)) - }) - - It("should not recurse into vendor dirs", func() { - suites := SuitesInDir(filepath.Join(tmpDir), true) - Ω(suites).Should(HaveLen(3)) - }) - }) - - Context("when recursively scanning", func() { - It("should return suites for corresponding test suites, only", func() { - suites := SuitesInDir(tmpDir, true) - Ω(suites).Should(HaveLen(4)) - - Ω(suites).Should(ContainElement(TestSuite{ - Path: relTmpDir + "/colonelmustard", - PackageName: "colonelmustard", - IsGinkgo: true, - Precompiled: false, - })) - Ω(suites).Should(ContainElement(TestSuite{ - Path: relTmpDir + "/professorplum", - PackageName: "professorplum", - IsGinkgo: false, - Precompiled: false, - })) - Ω(suites).Should(ContainElement(TestSuite{ - Path: relTmpDir + "/colonelmustard/library", - PackageName: "library", - IsGinkgo: true, - Precompiled: false, - })) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go16.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go16.go deleted file mode 100644 index 596e5e5..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go16.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build go1.6 - -package testsuite - -import ( - "os" - "path" -) - -// in 1.6 the vendor directory became the default go behaviour, so now -// check if its disabled. -func vendorExperimentCheck(dir string) bool { - vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") - return vendorExperiment != "0" && path.Base(dir) == "vendor" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/unfocus_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/unfocus_command.go deleted file mode 100644 index cedc2b5..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/unfocus_command.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "io/ioutil" - "os/exec" - "strings" -) - -func BuildUnfocusCommand() *Command { - return &Command{ - Name: "unfocus", - AltName: "blur", - FlagSet: flag.NewFlagSet("unfocus", flag.ExitOnError), - UsageCommand: "ginkgo unfocus (or ginkgo blur)", - Usage: []string{ - "Recursively unfocuses any focused tests under the current directory", - }, - Command: unfocusSpecs, - } -} - -func unfocusSpecs([]string, []string) { - unfocus("Describe") - unfocus("Context") - unfocus("It") - unfocus("Measure") - unfocus("DescribeTable") - unfocus("Entry") - unfocus("Specify") - unfocus("When") -} - -func unfocus(component string) { - fmt.Printf("Removing F%s...\n", component) - files, err := ioutil.ReadDir(".") - if err != nil { - fmt.Println(err.Error()) - return - } - for _, f := range files { - // Exclude "vendor" directory - if f.IsDir() && f.Name() == "vendor" { - continue - } - // Exclude non-go files in the current directory - if !f.IsDir() && !strings.HasSuffix(f.Name(), ".go") { - continue - } - // Recursively run `gofmt` otherwise - cmd := exec.Command("gofmt", fmt.Sprintf("-r=F%s -> %s", component, component), "-w", f.Name()) - out, err := cmd.CombinedOutput() - if err != nil { - fmt.Println(err.Error()) - } - if string(out) != "" { - fmt.Println(string(out)) - } - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/version_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/version_command.go deleted file mode 100644 index f586908..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/version_command.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "flag" - "fmt" - - "github.com/onsi/ginkgo/config" -) - -func BuildVersionCommand() *Command { - return &Command{ - Name: "version", - FlagSet: flag.NewFlagSet("version", flag.ExitOnError), - UsageCommand: "ginkgo version", - Usage: []string{ - "Print Ginkgo's version", - }, - Command: printVersion, - } -} - -func printVersion([]string, []string) { - fmt.Printf("Ginkgo Version %s\n", config.VERSION) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta.go deleted file mode 100644 index 6c485c5..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta.go +++ /dev/null @@ -1,22 +0,0 @@ -package watch - -import "sort" - -type Delta struct { - ModifiedPackages []string - - NewSuites []*Suite - RemovedSuites []*Suite - modifiedSuites []*Suite -} - -type DescendingByDelta []*Suite - -func (a DescendingByDelta) Len() int { return len(a) } -func (a DescendingByDelta) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a DescendingByDelta) Less(i, j int) bool { return a[i].Delta() > a[j].Delta() } - -func (d Delta) ModifiedSuites() []*Suite { - sort.Sort(DescendingByDelta(d.modifiedSuites)) - return d.modifiedSuites -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta_tracker.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta_tracker.go deleted file mode 100644 index a628303..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/delta_tracker.go +++ /dev/null @@ -1,75 +0,0 @@ -package watch - -import ( - "fmt" - - "regexp" - - "github.com/onsi/ginkgo/ginkgo/testsuite" -) - -type SuiteErrors map[testsuite.TestSuite]error - -type DeltaTracker struct { - maxDepth int - watchRegExp *regexp.Regexp - suites map[string]*Suite - packageHashes *PackageHashes -} - -func NewDeltaTracker(maxDepth int, watchRegExp *regexp.Regexp) *DeltaTracker { - return &DeltaTracker{ - maxDepth: maxDepth, - watchRegExp: watchRegExp, - packageHashes: NewPackageHashes(watchRegExp), - suites: map[string]*Suite{}, - } -} - -func (d *DeltaTracker) Delta(suites []testsuite.TestSuite) (delta Delta, errors SuiteErrors) { - errors = SuiteErrors{} - delta.ModifiedPackages = d.packageHashes.CheckForChanges() - - providedSuitePaths := map[string]bool{} - for _, suite := range suites { - providedSuitePaths[suite.Path] = true - } - - d.packageHashes.StartTrackingUsage() - - for _, suite := range d.suites { - if providedSuitePaths[suite.Suite.Path] { - if suite.Delta() > 0 { - delta.modifiedSuites = append(delta.modifiedSuites, suite) - } - } else { - delta.RemovedSuites = append(delta.RemovedSuites, suite) - } - } - - d.packageHashes.StopTrackingUsageAndPrune() - - for _, suite := range suites { - _, ok := d.suites[suite.Path] - if !ok { - s, err := NewSuite(suite, d.maxDepth, d.packageHashes) - if err != nil { - errors[suite] = err - continue - } - d.suites[suite.Path] = s - delta.NewSuites = append(delta.NewSuites, s) - } - } - - return delta, errors -} - -func (d *DeltaTracker) WillRun(suite testsuite.TestSuite) error { - s, ok := d.suites[suite.Path] - if !ok { - return fmt.Errorf("unknown suite %s", suite.Path) - } - - return s.MarkAsRunAndRecomputedDependencies(d.maxDepth) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go deleted file mode 100644 index 82c25fa..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go +++ /dev/null @@ -1,91 +0,0 @@ -package watch - -import ( - "go/build" - "regexp" -) - -var ginkgoAndGomegaFilter = regexp.MustCompile(`github\.com/onsi/ginkgo|github\.com/onsi/gomega`) - -type Dependencies struct { - deps map[string]int -} - -func NewDependencies(path string, maxDepth int) (Dependencies, error) { - d := Dependencies{ - deps: map[string]int{}, - } - - if maxDepth == 0 { - return d, nil - } - - err := d.seedWithDepsForPackageAtPath(path) - if err != nil { - return d, err - } - - for depth := 1; depth < maxDepth; depth++ { - n := len(d.deps) - d.addDepsForDepth(depth) - if n == len(d.deps) { - break - } - } - - return d, nil -} - -func (d Dependencies) Dependencies() map[string]int { - return d.deps -} - -func (d Dependencies) seedWithDepsForPackageAtPath(path string) error { - pkg, err := build.ImportDir(path, 0) - if err != nil { - return err - } - - d.resolveAndAdd(pkg.Imports, 1) - d.resolveAndAdd(pkg.TestImports, 1) - d.resolveAndAdd(pkg.XTestImports, 1) - - delete(d.deps, pkg.Dir) - return nil -} - -func (d Dependencies) addDepsForDepth(depth int) { - for dep, depDepth := range d.deps { - if depDepth == depth { - d.addDepsForDep(dep, depth+1) - } - } -} - -func (d Dependencies) addDepsForDep(dep string, depth int) { - pkg, err := build.ImportDir(dep, 0) - if err != nil { - println(err.Error()) - return - } - d.resolveAndAdd(pkg.Imports, depth) -} - -func (d Dependencies) resolveAndAdd(deps []string, depth int) { - for _, dep := range deps { - pkg, err := build.Import(dep, ".", 0) - if err != nil { - continue - } - if pkg.Goroot == false && !ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) { - d.addDepIfNotPresent(pkg.Dir, depth) - } - } -} - -func (d Dependencies) addDepIfNotPresent(dep string, depth int) { - _, ok := d.deps[dep] - if !ok { - d.deps[dep] = depth - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go deleted file mode 100644 index 7e1e419..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go +++ /dev/null @@ -1,104 +0,0 @@ -package watch - -import ( - "fmt" - "io/ioutil" - "os" - "regexp" - "time" -) - -var goTestRegExp = regexp.MustCompile(`_test\.go$`) - -type PackageHash struct { - CodeModifiedTime time.Time - TestModifiedTime time.Time - Deleted bool - - path string - codeHash string - testHash string - watchRegExp *regexp.Regexp -} - -func NewPackageHash(path string, watchRegExp *regexp.Regexp) *PackageHash { - p := &PackageHash{ - path: path, - watchRegExp: watchRegExp, - } - - p.codeHash, _, p.testHash, _, p.Deleted = p.computeHashes() - - return p -} - -func (p *PackageHash) CheckForChanges() bool { - codeHash, codeModifiedTime, testHash, testModifiedTime, deleted := p.computeHashes() - - if deleted { - if p.Deleted == false { - t := time.Now() - p.CodeModifiedTime = t - p.TestModifiedTime = t - } - p.Deleted = true - return true - } - - modified := false - p.Deleted = false - - if p.codeHash != codeHash { - p.CodeModifiedTime = codeModifiedTime - modified = true - } - if p.testHash != testHash { - p.TestModifiedTime = testModifiedTime - modified = true - } - - p.codeHash = codeHash - p.testHash = testHash - return modified -} - -func (p *PackageHash) computeHashes() (codeHash string, codeModifiedTime time.Time, testHash string, testModifiedTime time.Time, deleted bool) { - infos, err := ioutil.ReadDir(p.path) - - if err != nil { - deleted = true - return - } - - for _, info := range infos { - if info.IsDir() { - continue - } - - if goTestRegExp.Match([]byte(info.Name())) { - testHash += p.hashForFileInfo(info) - if info.ModTime().After(testModifiedTime) { - testModifiedTime = info.ModTime() - } - continue - } - - if p.watchRegExp.Match([]byte(info.Name())) { - codeHash += p.hashForFileInfo(info) - if info.ModTime().After(codeModifiedTime) { - codeModifiedTime = info.ModTime() - } - } - } - - testHash += codeHash - if codeModifiedTime.After(testModifiedTime) { - testModifiedTime = codeModifiedTime - } - - return -} - -func (p *PackageHash) hashForFileInfo(info os.FileInfo) string { - return fmt.Sprintf("%s_%d_%d", info.Name(), info.Size(), info.ModTime().UnixNano()) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hashes.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hashes.go deleted file mode 100644 index b4892be..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hashes.go +++ /dev/null @@ -1,85 +0,0 @@ -package watch - -import ( - "path/filepath" - "regexp" - "sync" -) - -type PackageHashes struct { - PackageHashes map[string]*PackageHash - usedPaths map[string]bool - watchRegExp *regexp.Regexp - lock *sync.Mutex -} - -func NewPackageHashes(watchRegExp *regexp.Regexp) *PackageHashes { - return &PackageHashes{ - PackageHashes: map[string]*PackageHash{}, - usedPaths: nil, - watchRegExp: watchRegExp, - lock: &sync.Mutex{}, - } -} - -func (p *PackageHashes) CheckForChanges() []string { - p.lock.Lock() - defer p.lock.Unlock() - - modified := []string{} - - for _, packageHash := range p.PackageHashes { - if packageHash.CheckForChanges() { - modified = append(modified, packageHash.path) - } - } - - return modified -} - -func (p *PackageHashes) Add(path string) *PackageHash { - p.lock.Lock() - defer p.lock.Unlock() - - path, _ = filepath.Abs(path) - _, ok := p.PackageHashes[path] - if !ok { - p.PackageHashes[path] = NewPackageHash(path, p.watchRegExp) - } - - if p.usedPaths != nil { - p.usedPaths[path] = true - } - return p.PackageHashes[path] -} - -func (p *PackageHashes) Get(path string) *PackageHash { - p.lock.Lock() - defer p.lock.Unlock() - - path, _ = filepath.Abs(path) - if p.usedPaths != nil { - p.usedPaths[path] = true - } - return p.PackageHashes[path] -} - -func (p *PackageHashes) StartTrackingUsage() { - p.lock.Lock() - defer p.lock.Unlock() - - p.usedPaths = map[string]bool{} -} - -func (p *PackageHashes) StopTrackingUsageAndPrune() { - p.lock.Lock() - defer p.lock.Unlock() - - for path := range p.PackageHashes { - if !p.usedPaths[path] { - delete(p.PackageHashes, path) - } - } - - p.usedPaths = nil -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/suite.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/suite.go deleted file mode 100644 index 5deaba7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch/suite.go +++ /dev/null @@ -1,87 +0,0 @@ -package watch - -import ( - "fmt" - "math" - "time" - - "github.com/onsi/ginkgo/ginkgo/testsuite" -) - -type Suite struct { - Suite testsuite.TestSuite - RunTime time.Time - Dependencies Dependencies - - sharedPackageHashes *PackageHashes -} - -func NewSuite(suite testsuite.TestSuite, maxDepth int, sharedPackageHashes *PackageHashes) (*Suite, error) { - deps, err := NewDependencies(suite.Path, maxDepth) - if err != nil { - return nil, err - } - - sharedPackageHashes.Add(suite.Path) - for dep := range deps.Dependencies() { - sharedPackageHashes.Add(dep) - } - - return &Suite{ - Suite: suite, - Dependencies: deps, - - sharedPackageHashes: sharedPackageHashes, - }, nil -} - -func (s *Suite) Delta() float64 { - delta := s.delta(s.Suite.Path, true, 0) * 1000 - for dep, depth := range s.Dependencies.Dependencies() { - delta += s.delta(dep, false, depth) - } - return delta -} - -func (s *Suite) MarkAsRunAndRecomputedDependencies(maxDepth int) error { - s.RunTime = time.Now() - - deps, err := NewDependencies(s.Suite.Path, maxDepth) - if err != nil { - return err - } - - s.sharedPackageHashes.Add(s.Suite.Path) - for dep := range deps.Dependencies() { - s.sharedPackageHashes.Add(dep) - } - - s.Dependencies = deps - - return nil -} - -func (s *Suite) Description() string { - numDeps := len(s.Dependencies.Dependencies()) - pluralizer := "ies" - if numDeps == 1 { - pluralizer = "y" - } - return fmt.Sprintf("%s [%d dependenc%s]", s.Suite.Path, numDeps, pluralizer) -} - -func (s *Suite) delta(packagePath string, includeTests bool, depth int) float64 { - return math.Max(float64(s.dt(packagePath, includeTests)), 0) / float64(depth+1) -} - -func (s *Suite) dt(packagePath string, includeTests bool) time.Duration { - packageHash := s.sharedPackageHashes.Get(packagePath) - var modifiedTime time.Time - if includeTests { - modifiedTime = packageHash.TestModifiedTime - } else { - modifiedTime = packageHash.CodeModifiedTime - } - - return modifiedTime.Sub(s.RunTime) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch_command.go deleted file mode 100644 index a6ef053..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/ginkgo/watch_command.go +++ /dev/null @@ -1,175 +0,0 @@ -package main - -import ( - "flag" - "fmt" - "regexp" - "time" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/ginkgo/interrupthandler" - "github.com/onsi/ginkgo/ginkgo/testrunner" - "github.com/onsi/ginkgo/ginkgo/testsuite" - "github.com/onsi/ginkgo/ginkgo/watch" - colorable "github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable" -) - -func BuildWatchCommand() *Command { - commandFlags := NewWatchCommandFlags(flag.NewFlagSet("watch", flag.ExitOnError)) - interruptHandler := interrupthandler.NewInterruptHandler() - notifier := NewNotifier(commandFlags) - watcher := &SpecWatcher{ - commandFlags: commandFlags, - notifier: notifier, - interruptHandler: interruptHandler, - suiteRunner: NewSuiteRunner(notifier, interruptHandler), - } - - return &Command{ - Name: "watch", - FlagSet: commandFlags.FlagSet, - UsageCommand: "ginkgo watch -- ", - Usage: []string{ - "Watches the tests in the passed in and runs them when changes occur.", - "Any arguments after -- will be passed to the test.", - }, - Command: watcher.WatchSpecs, - SuppressFlagDocumentation: true, - FlagDocSubstitute: []string{ - "Accepts all the flags that the ginkgo command accepts except for --keepGoing and --untilItFails", - }, - } -} - -type SpecWatcher struct { - commandFlags *RunWatchAndBuildCommandFlags - notifier *Notifier - interruptHandler *interrupthandler.InterruptHandler - suiteRunner *SuiteRunner -} - -func (w *SpecWatcher) WatchSpecs(args []string, additionalArgs []string) { - w.commandFlags.computeNodes() - w.notifier.VerifyNotificationsAreAvailable() - - w.WatchSuites(args, additionalArgs) -} - -func (w *SpecWatcher) runnersForSuites(suites []testsuite.TestSuite, additionalArgs []string) []*testrunner.TestRunner { - runners := []*testrunner.TestRunner{} - - for _, suite := range suites { - runners = append(runners, testrunner.New(suite, w.commandFlags.NumCPU, w.commandFlags.ParallelStream, w.commandFlags.Timeout, w.commandFlags.GoOpts, additionalArgs)) - } - - return runners -} - -func (w *SpecWatcher) WatchSuites(args []string, additionalArgs []string) { - suites, _ := findSuites(args, w.commandFlags.Recurse, w.commandFlags.SkipPackage, false) - - if len(suites) == 0 { - complainAndQuit("Found no test suites") - } - - fmt.Printf("Identified %d test %s. Locating dependencies to a depth of %d (this may take a while)...\n", len(suites), pluralizedWord("suite", "suites", len(suites)), w.commandFlags.Depth) - deltaTracker := watch.NewDeltaTracker(w.commandFlags.Depth, regexp.MustCompile(w.commandFlags.WatchRegExp)) - delta, errors := deltaTracker.Delta(suites) - - fmt.Printf("Watching %d %s:\n", len(delta.NewSuites), pluralizedWord("suite", "suites", len(delta.NewSuites))) - for _, suite := range delta.NewSuites { - fmt.Println(" " + suite.Description()) - } - - for suite, err := range errors { - fmt.Printf("Failed to watch %s: %s\n", suite.PackageName, err) - } - - if len(suites) == 1 { - runners := w.runnersForSuites(suites, additionalArgs) - w.suiteRunner.RunSuites(runners, w.commandFlags.NumCompilers, true, nil) - runners[0].CleanUp() - } - - ticker := time.NewTicker(time.Second) - - for { - select { - case <-ticker.C: - suites, _ := findSuites(args, w.commandFlags.Recurse, w.commandFlags.SkipPackage, false) - delta, _ := deltaTracker.Delta(suites) - coloredStream := colorable.NewColorableStdout() - - suitesToRun := []testsuite.TestSuite{} - - if len(delta.NewSuites) > 0 { - fmt.Fprintf(coloredStream, greenColor+"Detected %d new %s:\n"+defaultStyle, len(delta.NewSuites), pluralizedWord("suite", "suites", len(delta.NewSuites))) - for _, suite := range delta.NewSuites { - suitesToRun = append(suitesToRun, suite.Suite) - fmt.Fprintln(coloredStream, " "+suite.Description()) - } - } - - modifiedSuites := delta.ModifiedSuites() - if len(modifiedSuites) > 0 { - fmt.Fprintln(coloredStream, greenColor+"\nDetected changes in:"+defaultStyle) - for _, pkg := range delta.ModifiedPackages { - fmt.Fprintln(coloredStream, " "+pkg) - } - fmt.Fprintf(coloredStream, greenColor+"Will run %d %s:\n"+defaultStyle, len(modifiedSuites), pluralizedWord("suite", "suites", len(modifiedSuites))) - for _, suite := range modifiedSuites { - suitesToRun = append(suitesToRun, suite.Suite) - fmt.Fprintln(coloredStream, " "+suite.Description()) - } - fmt.Fprintln(coloredStream, "") - } - - if len(suitesToRun) > 0 { - w.UpdateSeed() - w.ComputeSuccinctMode(len(suitesToRun)) - runners := w.runnersForSuites(suitesToRun, additionalArgs) - result, _ := w.suiteRunner.RunSuites(runners, w.commandFlags.NumCompilers, true, func(suite testsuite.TestSuite) { - deltaTracker.WillRun(suite) - }) - for _, runner := range runners { - runner.CleanUp() - } - if !w.interruptHandler.WasInterrupted() { - color := redColor - if result.Passed { - color = greenColor - } - fmt.Fprintln(coloredStream, color+"\nDone. Resuming watch..."+defaultStyle) - } - } - - case <-w.interruptHandler.C: - return - } - } -} - -func (w *SpecWatcher) ComputeSuccinctMode(numSuites int) { - if config.DefaultReporterConfig.Verbose { - config.DefaultReporterConfig.Succinct = false - return - } - - if w.commandFlags.wasSet("succinct") { - return - } - - if numSuites == 1 { - config.DefaultReporterConfig.Succinct = false - } - - if numSuites > 1 { - config.DefaultReporterConfig.Succinct = true - } -} - -func (w *SpecWatcher) UpdateSeed() { - if !w.commandFlags.wasSet("seed") { - config.GinkgoConfig.RandomSeed = time.Now().Unix() - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go deleted file mode 100644 index 10c1c1b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go +++ /dev/null @@ -1,21 +0,0 @@ -package first_package - -func A() string { - return "A" -} - -func B() string { - return "B" -} - -func C() string { - return "C" -} - -func D() string { - return "D" -} - -func E() string { - return "untested" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go deleted file mode 100644 index 4e0976c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package first_package_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestCoverageFixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "CombinedFixture First Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go deleted file mode 100644 index dfe3e11..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package first_package_test - -import ( - . "github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package" - . "github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("CoverageFixture", func() { - It("should test A", func() { - Ω(A()).Should(Equal("A")) - }) - - It("should test B", func() { - Ω(B()).Should(Equal("B")) - }) - - It("should test C", func() { - Ω(C()).Should(Equal("C")) - }) - - It("should test D", func() { - Ω(D()).Should(Equal("D")) - }) - - It("should test external package", func() { - Ω(Tested()).Should(Equal("tested")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go deleted file mode 100644 index 5280d4d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go +++ /dev/null @@ -1,9 +0,0 @@ -package external_coverage - -func Tested() string { - return "tested" -} - -func Untested() string { - return "untested" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go deleted file mode 100644 index 5216098..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go +++ /dev/null @@ -1,21 +0,0 @@ -package second_package - -func A() string { - return "A" -} - -func B() string { - return "B" -} - -func C() string { - return "C" -} - -func D() string { - return "D" -} - -func E() string { - return "E" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go deleted file mode 100644 index 583a0af..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package second_package_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestCoverageFixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "CombinedFixture Second Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go deleted file mode 100644 index 2692bec..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package second_package_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package" - . "github.com/onsi/gomega" -) - -var _ = Describe("CoverageFixture", func() { - It("should test A", func() { - Ω(A()).Should(Equal("A")) - }) - - It("should test B", func() { - Ω(B()).Should(Equal("B")) - }) - - It("should test C", func() { - Ω(C()).Should(Equal("C")) - }) - - It("should test D", func() { - Ω(D()).Should(Equal("D")) - }) - - It("should test E", func() { - Ω(E()).Should(Equal("E")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go deleted file mode 100644 index ccb3669..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package tmp - -import ( - "testing" -) - -func TestSomethingLessImportant(t *testing.T) { - strp := "hello!" - somethingImportant(t, &strp) -} - -func somethingImportant(t *testing.T, message *string) { - t.Log("Something important happened in a test: " + *message) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go deleted file mode 100644 index cde42e4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go +++ /dev/null @@ -1,10 +0,0 @@ -package nested - -import ( - "testing" -) - -func TestSomethingLessImportant(t *testing.T) { - whatever := &UselessStruct{} - t.Fail(whatever.ImportantField != "SECRET_PASSWORD") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go deleted file mode 100644 index 7cdd326..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package subpackage - -import ( - "testing" -) - -func TestNestedSubPackages(t *testing.T) { - t.Fail(true) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go deleted file mode 100644 index a682eea..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package tmp_test - -import ( - "testing" -) - -type UselessStruct struct { - ImportantField string -} - -func TestSomethingImportant(t *testing.T) { - whatever := &UselessStruct{} - if whatever.ImportantField != "SECRET_PASSWORD" { - t.Fail() - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go deleted file mode 100644 index 049829a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package tmp - -import ( - "testing" -) - -type UselessStruct struct { - ImportantField string - T *testing.T -} - -var testFunc = func(t *testing.T, arg *string) {} - -func assertEqual(t *testing.T, arg1, arg2 interface{}) { - if arg1 != arg2 { - t.Fail() - } -} - -func TestSomethingImportant(t *testing.T) { - whatever := &UselessStruct{ - T: t, - ImportantField: "SECRET_PASSWORD", - } - something := &UselessStruct{ImportantField: "string value"} - assertEqual(t, whatever.ImportantField, "SECRET_PASSWORD") - assertEqual(t, something.ImportantField, "string value") - - var foo = func(t *testing.T) {} - foo(t) - - strp := "something" - testFunc(t, &strp) - t.Fail() -} - -func Test3Things(t *testing.T) { - if 3 != 3 { - t.Fail() - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go deleted file mode 100644 index 1c2c56c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package tmp - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("Testing with Ginkgo", func() { - It("something less important", func() { - - strp := "hello!" - somethingImportant(GinkgoT(), &strp) - }) -}) - -func somethingImportant(t GinkgoTInterface, message *string) { - t.Log("Something important happened in a test: " + *message) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go deleted file mode 100644 index a9a404b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package tmp - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestTmp(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Tmp Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go deleted file mode 100644 index 3653eae..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package subpackage - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("Testing with Ginkgo", func() { - It("nested sub packages", func() { - GinkgoT().Fail(true) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go deleted file mode 100644 index 721d0f2..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package nested_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestNested(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Nested Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go deleted file mode 100644 index 47364b8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package nested - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("Testing with Ginkgo", func() { - It("something less important", func() { - - whatever := &UselessStruct{} - GinkgoT().Fail(whatever.ImportantField != "SECRET_PASSWORD") - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go deleted file mode 100644 index 1f2e332..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package tmp_test - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("Testing with Ginkgo", func() { - It("something important", func() { - - whatever := &UselessStruct{} - if whatever.ImportantField != "SECRET_PASSWORD" { - GinkgoT().Fail() - } - }) -}) - -type UselessStruct struct { - ImportantField string -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go deleted file mode 100644 index 9ea2291..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package tmp_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestConvertFixtures(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "ConvertFixtures Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go deleted file mode 100644 index dbe3b41..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package tmp - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("Testing with Ginkgo", func() { - It("something important", func() { - - whatever := &UselessStruct{ - T: GinkgoT(), - ImportantField: "SECRET_PASSWORD", - } - something := &UselessStruct{ImportantField: "string value"} - assertEqual(GinkgoT(), whatever.ImportantField, "SECRET_PASSWORD") - assertEqual(GinkgoT(), something.ImportantField, "string value") - - var foo = func(t GinkgoTInterface) {} - foo(GinkgoT()) - - strp := "something" - testFunc(GinkgoT(), &strp) - GinkgoT().Fail() - }) - It("3 things", func() { - - if 3 != 3 { - GinkgoT().Fail() - } - }) -}) - -type UselessStruct struct { - ImportantField string - T GinkgoTInterface -} - -var testFunc = func(t GinkgoTInterface, arg *string) {} - -func assertEqual(t GinkgoTInterface, arg1, arg2 interface{}) { - if arg1 != arg2 { - t.Fail() - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go deleted file mode 100644 index e4d7e43..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go +++ /dev/null @@ -1,25 +0,0 @@ -package coverage_fixture - -import ( - _ "github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture" -) - -func A() string { - return "A" -} - -func B() string { - return "B" -} - -func C() string { - return "C" -} - -func D() string { - return "D" -} - -func E() string { - return "untested" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go deleted file mode 100644 index 2831bf7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package coverage_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestCoverageFixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "CoverageFixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go deleted file mode 100644 index 12a72dc..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package coverage_fixture_test - -import ( - . "github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture" - . "github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("CoverageFixture", func() { - It("should test A", func() { - Ω(A()).Should(Equal("A")) - }) - - It("should test B", func() { - Ω(B()).Should(Equal("B")) - }) - - It("should test C", func() { - Ω(C()).Should(Equal("C")) - }) - - It("should test D", func() { - Ω(D()).Should(Equal("D")) - }) - - It("should test external package", func() { - Ω(Tested()).Should(Equal("tested")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go deleted file mode 100644 index 5280d4d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go +++ /dev/null @@ -1,9 +0,0 @@ -package external_coverage - -func Tested() string { - return "tested" -} - -func Untested() string { - return "untested" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go deleted file mode 100644 index 429aebc..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package debug_parallel_fixture_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func TestDebugParallelFixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "DebugParallelFixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go deleted file mode 100644 index b609a8b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package debug_parallel_fixture_test - -import ( - "fmt" - "time" - - . "github.com/onsi/ginkgo" -) - -var _ = Describe("DebugParallelFixture", func() { - It("emits output to a file", func() { - for i := 0; i < 10; i += 1 { - fmt.Printf("StdOut %d\n", i) - GinkgoWriter.Write([]byte(fmt.Sprintf("GinkgoWriter %d\n", i))) - } - time.Sleep(time.Second) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go deleted file mode 100644 index 01e7926..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package does_not_compile_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestDoes_not_compile(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Does_not_compile Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go deleted file mode 100644 index e4f22b3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package does_not_compile_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/does_not_compile" - . "github.com/onsi/gomega" -) - -var _ = Describe("DoesNotCompile", func() { - -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go deleted file mode 100644 index 97fa2e7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package eventually_failing_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestEventuallyFailing(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "EventuallyFailing Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go deleted file mode 100644 index 6c83b42..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package eventually_failing_test - -import ( - "fmt" - "io/ioutil" - "strings" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("EventuallyFailing", func() { - It("should fail on the third try", func() { - time.Sleep(time.Second) - files, err := ioutil.ReadDir(".") - Ω(err).ShouldNot(HaveOccurred()) - - numRuns := 1 - for _, file := range files { - if strings.HasPrefix(file.Name(), "counter") { - numRuns++ - } - } - - Ω(numRuns).Should(BeNumerically("<", 3)) - ioutil.WriteFile(fmt.Sprintf("./counter-%d", numRuns), []byte("foo"), 0777) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go deleted file mode 100644 index 045ca7c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package synchronized_setup_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "fmt" - "os" - "testing" -) - -func TestSynchronized_setup_tests(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Synchronized_setup_tests Suite") -} - -var beforeData string - -var _ = SynchronizedBeforeSuite(func() []byte { - fmt.Printf("BEFORE_A_%d\n", GinkgoParallelNode()) - os.Exit(1) - return []byte("WHAT EVZ") -}, func(data []byte) { - println("NEVER SEE THIS") -}) - -var _ = Describe("Synchronized Setup", func() { - It("should do nothing", func() { - Ω(true).Should(BeTrue()) - }) - - It("should do nothing", func() { - Ω(true).Should(BeTrue()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go deleted file mode 100644 index 6e82264..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package fail_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFail_fixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Fail_fixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go deleted file mode 100644 index ea6f71c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package fail_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = It("handles top level failures", func() { - Ω("a top level failure on line 9").Should(Equal("nope")) - println("NEVER SEE THIS") -}) - -var _ = It("handles async top level failures", func(done Done) { - Fail("an async top level failure on line 14") - println("NEVER SEE THIS") -}, 0.1) - -var _ = It("FAIL in a goroutine", func(done Done) { - go func() { - defer GinkgoRecover() - Fail("a top level goroutine failure on line 21") - println("NEVER SEE THIS") - }() -}, 0.1) - -var _ = Describe("Excercising different failure modes", func() { - It("synchronous failures", func() { - Ω("a sync failure").Should(Equal("nope")) - println("NEVER SEE THIS") - }) - - It("synchronous panics", func() { - panic("a sync panic") - println("NEVER SEE THIS") - }) - - It("synchronous failures with FAIL", func() { - Fail("a sync FAIL failure") - println("NEVER SEE THIS") - }) - - It("async timeout", func(done Done) { - Ω(true).Should(BeTrue()) - }, 0.1) - - It("async failure", func(done Done) { - Ω("an async failure").Should(Equal("nope")) - println("NEVER SEE THIS") - }, 0.1) - - It("async panic", func(done Done) { - panic("an async panic") - println("NEVER SEE THIS") - }, 0.1) - - It("async failure with FAIL", func(done Done) { - Fail("an async FAIL failure") - println("NEVER SEE THIS") - }, 0.1) - - It("FAIL in a goroutine", func(done Done) { - go func() { - defer GinkgoRecover() - Fail("a goroutine FAIL failure") - println("NEVER SEE THIS") - }() - }, 0.1) - - It("Gomega in a goroutine", func(done Done) { - go func() { - defer GinkgoRecover() - Ω("a goroutine failure").Should(Equal("nope")) - println("NEVER SEE THIS") - }() - }, 0.1) - - It("Panic in a goroutine", func(done Done) { - go func() { - defer GinkgoRecover() - panic("a goroutine panic") - println("NEVER SEE THIS") - }() - }, 0.1) - - Measure("a FAIL measure", func(Benchmarker) { - Fail("a measure FAIL failure") - println("NEVER SEE THIS") - }, 1) - - Measure("a gomega failed measure", func(Benchmarker) { - Ω("a measure failure").Should(Equal("nope")) - println("NEVER SEE THIS") - }, 1) - - Measure("a panicking measure", func(Benchmarker) { - panic("a measure panic") - println("NEVER SEE THIS") - }, 1) -}) - -var _ = Specify("a top level specify", func() { - Fail("fail the test") -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go deleted file mode 100644 index 0e410aa..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package failing_before_suite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFailingAfterSuite(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "FailingAfterSuite Suite") -} - -var _ = BeforeSuite(func() { - println("BEFORE SUITE") -}) - -var _ = AfterSuite(func() { - println("AFTER SUITE") - panic("BAM!") -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go deleted file mode 100644 index 3902ec6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package failing_before_suite_test - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("FailingBeforeSuite", func() { - It("should run", func() { - println("A TEST") - }) - - It("should run", func() { - println("A TEST") - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go deleted file mode 100644 index 109ea36..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package failing_before_suite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFailing_before_suite(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Failing_before_suite Suite") -} - -var _ = BeforeSuite(func() { - println("BEFORE SUITE") - panic("BAM!") -}) - -var _ = AfterSuite(func() { - println("AFTER SUITE") -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go deleted file mode 100644 index e8697c6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go +++ /dev/null @@ -1,15 +0,0 @@ -package failing_before_suite_test - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("FailingBeforeSuite", func() { - It("should never run", func() { - println("NEVER SEE THIS") - }) - - It("should never run", func() { - println("NEVER SEE THIS") - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go deleted file mode 100644 index e32cd61..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go +++ /dev/null @@ -1,5 +0,0 @@ -package failing_ginkgo_tests - -func AlwaysFalse() bool { - return false -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go deleted file mode 100644 index 49939bd..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package failing_ginkgo_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFailing_ginkgo_tests(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Failing_ginkgo_tests Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go deleted file mode 100644 index d9c01e3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package failing_ginkgo_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests" - . "github.com/onsi/gomega" -) - -var _ = Describe("FailingGinkgoTests", func() { - It("should fail", func() { - Ω(AlwaysFalse()).Should(BeTrue()) - }) - - It("should pass", func() { - Ω(AlwaysFalse()).Should(BeFalse()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go deleted file mode 100644 index a440abd..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go +++ /dev/null @@ -1,9 +0,0 @@ -package flags - -func Tested() string { - return "tested" -} - -func Untested() string { - return "untested" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go deleted file mode 100644 index 0b3071f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package flags_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFlags(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Flags Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go deleted file mode 100644 index 27dadf1..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go +++ /dev/null @@ -1,97 +0,0 @@ -package flags_test - -import ( - "flag" - "fmt" - remapped "math" - _ "math/cmplx" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/flags_tests" - . "github.com/onsi/gomega" -) - -var customFlag string - -func init() { - flag.StringVar(&customFlag, "customFlag", "default", "custom flag!") -} - -var _ = Describe("Testing various flags", func() { - FDescribe("the focused set", func() { - Measure("a measurement", func(b Benchmarker) { - b.RecordValue("a value", 3) - }, 3) - - It("should honor -cover", func() { - Ω(Tested()).Should(Equal("tested")) - }) - - It("should allow gcflags", func() { - fmt.Printf("NaN returns %T\n", remapped.NaN()) - }) - - PIt("should honor -failOnPending and -noisyPendings") - - Describe("smores", func() { - It("should honor -skip: marshmallow", func() { - println("marshmallow") - }) - - It("should honor -focus: chocolate", func() { - println("chocolate") - }) - }) - - It("should detect races", func(done Done) { - var a string - go func() { - a = "now you don't" - close(done) - }() - a = "now you see me" - println(a) - }) - - It("should randomize A", func() { - println("RANDOM_A") - }) - - It("should randomize B", func() { - println("RANDOM_B") - }) - - It("should randomize C", func() { - println("RANDOM_C") - }) - - It("should honor -slowSpecThreshold", func() { - time.Sleep(100 * time.Millisecond) - }) - - It("should pass in additional arguments after '--' directly to the test process", func() { - fmt.Printf("CUSTOM_FLAG: %s", customFlag) - }) - }) - - Describe("more smores", func() { - It("should not run these unless -focus is set", func() { - println("smores") - }) - }) - - Describe("a failing test", func() { - It("should fail", func() { - Ω(true).Should(Equal(false)) - }) - }) - - Describe("a flaky test", func() { - runs := 0 - It("should only pass the second time it's run", func() { - runs++ - Ω(runs).Should(BeNumerically("==", 2)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md deleted file mode 100644 index 2b501a2..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md +++ /dev/null @@ -1 +0,0 @@ -This file should remain the same, regardless the fact that contains FIt, FDescribe, or FWhen. diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go deleted file mode 100644 index 92d0c6e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package focused_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFocused_fixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Focused_fixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go deleted file mode 100644 index ea500ea..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package focused_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" -) - -var _ = Describe("FocusedFixture", func() { - FDescribe("focused", func() { - It("focused", func() { - - }) - }) - - FContext("focused", func() { - It("focused", func() { - - }) - }) - - FWhen("focused", func() { - It("focused", func() { - - }) - }) - - FIt("focused", func() { - - }) - - FSpecify("focused", func() { - - }) - - FMeasure("focused", func(b Benchmarker) { - - }, 2) - - FDescribeTable("focused", - func() {}, - Entry("focused"), - ) - - DescribeTable("focused", - func() {}, - FEntry("focused"), - ) - - Describe("not focused", func() { - It("not focused", func() { - - }) - }) - - Context("not focused", func() { - It("not focused", func() { - - }) - }) - - It("not focused", func() { - - }) - - Measure("not focused", func(b Benchmarker) { - - }, 2) - - DescribeTable("not focused", - func() {}, - Entry("not focused"), - ) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go deleted file mode 100644 index 92d0c6e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package focused_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFocused_fixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Focused_fixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go deleted file mode 100644 index ea500ea..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package focused_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" -) - -var _ = Describe("FocusedFixture", func() { - FDescribe("focused", func() { - It("focused", func() { - - }) - }) - - FContext("focused", func() { - It("focused", func() { - - }) - }) - - FWhen("focused", func() { - It("focused", func() { - - }) - }) - - FIt("focused", func() { - - }) - - FSpecify("focused", func() { - - }) - - FMeasure("focused", func(b Benchmarker) { - - }, 2) - - FDescribeTable("focused", - func() {}, - Entry("focused"), - ) - - DescribeTable("focused", - func() {}, - FEntry("focused"), - ) - - Describe("not focused", func() { - It("not focused", func() { - - }) - }) - - Context("not focused", func() { - It("not focused", func() { - - }) - }) - - It("not focused", func() { - - }) - - Measure("not focused", func(b Benchmarker) { - - }, 2) - - DescribeTable("not focused", - func() {}, - Entry("not focused"), - ) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go deleted file mode 100644 index e8dd54b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package hanging_suite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestHangingSuite(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "HangingSuite Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go deleted file mode 100644 index 6a5a070..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package hanging_suite_test - -import ( - "fmt" - "time" - - . "github.com/onsi/ginkgo" -) - -var _ = AfterSuite(func() { - fmt.Println("Heading Out After Suite") -}) - -var _ = Describe("HangingSuite", func() { - BeforeEach(func() { - fmt.Fprintln(GinkgoWriter, "Just beginning") - }) - - Context("inner context", func() { - BeforeEach(func() { - fmt.Fprintln(GinkgoWriter, "Almost there...") - }) - - It("should hang out for a while", func() { - fmt.Fprintln(GinkgoWriter, "Hanging Out") - fmt.Println("Sleeping...") - time.Sleep(time.Hour) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go deleted file mode 100644 index ca12c0d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go +++ /dev/null @@ -1,5 +0,0 @@ -package more_ginkgo_tests - -func AlwaysTrue() bool { - return true -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go deleted file mode 100644 index 1e15c88..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package more_ginkgo_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestMore_ginkgo_tests(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "More_ginkgo_tests Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go deleted file mode 100644 index 0549f62..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package more_ginkgo_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests" - . "github.com/onsi/gomega" -) - -var _ = Describe("MoreGinkgoTests", func() { - It("should pass", func() { - Ω(AlwaysTrue()).Should(BeTrue()) - }) - - It("should always pass", func() { - Ω(AlwaysTrue()).Should(BeTrue()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go deleted file mode 100644 index bdf1b54..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go +++ /dev/null @@ -1,5 +0,0 @@ -package no_test_fn - -func StringIdentity(a string) string { - return a -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go deleted file mode 100644 index 6c38b1e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package no_test_fn_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/no_test_fn" - . "github.com/onsi/gomega" -) - -var _ = Describe("NoTestFn", func() { - It("should proxy strings", func() { - Ω(StringIdentity("foo")).Should(Equal("foo")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go deleted file mode 100644 index da29a2c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go +++ /dev/null @@ -1,4 +0,0 @@ -package main - -func main() { -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go deleted file mode 100644 index b710dd1..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go +++ /dev/null @@ -1,9 +0,0 @@ -package passing_ginkgo_tests - -func StringIdentity(a string) string { - return a -} - -func IntegerIdentity(a int) int { - return a -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go deleted file mode 100644 index 31a3f7d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package passing_ginkgo_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestPassing_ginkgo_tests(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Passing_ginkgo_tests Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go deleted file mode 100644 index a5822fd..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package passing_ginkgo_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests" - . "github.com/onsi/gomega" -) - -var _ = Describe("PassingGinkgoTests", func() { - It("should proxy strings", func() { - Ω(StringIdentity("foo")).Should(Equal("foo")) - }) - - It("should proxy integers", func() { - Ω(IntegerIdentity(3)).Should(Equal(3)) - }) - - It("should do it again", func() { - Ω(StringIdentity("foo")).Should(Equal("foo")) - Ω(IntegerIdentity(3)).Should(Equal(3)) - }) - - It("should be able to run Bys", func() { - By("emitting one By") - Ω(3).Should(Equal(3)) - - By("emitting another By") - Ω(4).Should(Equal(4)) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go deleted file mode 100644 index 86c9aa2..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package passing_before_suite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestPassingSuiteSetup(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "PassingSuiteSetup Suite") -} - -var a string -var b string - -var _ = BeforeSuite(func() { - a = "ran before suite" - println("BEFORE SUITE") -}) - -var _ = AfterSuite(func() { - b = "ran after suite" - println("AFTER SUITE") -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go deleted file mode 100644 index f139e1d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package passing_before_suite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("PassingSuiteSetup", func() { - It("should pass", func() { - Ω(a).Should(Equal("ran before suite")) - Ω(b).Should(BeEmpty()) - }) - - It("should pass", func() { - Ω(a).Should(Equal("ran before suite")) - Ω(b).Should(BeEmpty()) - }) - - It("should pass", func() { - Ω(a).Should(Equal("ran before suite")) - Ω(b).Should(BeEmpty()) - }) - - It("should pass", func() { - Ω(a).Should(Equal("ran before suite")) - Ω(b).Should(BeEmpty()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go deleted file mode 100644 index 74262bb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package progress_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestProgressFixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "ProgressFixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go deleted file mode 100644 index b7f26c2..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package progress_fixture_test - -import ( - "fmt" - - . "github.com/onsi/ginkgo" -) - -var _ = Describe("ProgressFixture", func() { - BeforeEach(func() { - fmt.Fprintln(GinkgoWriter, ">outer before<") - }) - - JustBeforeEach(func() { - fmt.Fprintln(GinkgoWriter, ">outer just before<") - }) - - AfterEach(func() { - fmt.Fprintln(GinkgoWriter, ">outer after<") - }) - - Context("Inner Context", func() { - BeforeEach(func() { - fmt.Fprintln(GinkgoWriter, ">inner before<") - }) - - JustBeforeEach(func() { - fmt.Fprintln(GinkgoWriter, ">inner just before<") - }) - - AfterEach(func() { - fmt.Fprintln(GinkgoWriter, ">inner after<") - }) - - When("Inner When", func() { - BeforeEach(func() { - fmt.Fprintln(GinkgoWriter, ">inner before<") - }) - - It("should emit progress as it goes", func() { - fmt.Fprintln(GinkgoWriter, ">it<") - }) - }) - }) - - Specify("should emit progress as it goes", func() { - fmt.Fprintln(GinkgoWriter, ">specify<") - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go deleted file mode 100644 index b2028cf..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package fail_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFail_fixture(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Skip_fixture Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go deleted file mode 100644 index e406aeb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go +++ /dev/null @@ -1,71 +0,0 @@ -package fail_fixture_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = It("handles top level skips", func() { - Skip("a top level skip on line 9") - println("NEVER SEE THIS") -}) - -var _ = It("handles async top level skips", func(done Done) { - Skip("an async top level skip on line 14") - println("NEVER SEE THIS") -}, 0.1) - -var _ = It("SKIP in a goroutine", func(done Done) { - go func() { - defer GinkgoRecover() - Skip("a top level goroutine skip on line 21") - println("NEVER SEE THIS") - }() -}, 0.1) - -var _ = Describe("Excercising different skip modes", func() { - It("synchronous skip", func() { - Skip("a sync SKIP") - println("NEVER SEE THIS") - }) - - It("async skip", func(done Done) { - Skip("an async SKIP") - println("NEVER SEE THIS") - }, 0.1) - - It("SKIP in a goroutine", func(done Done) { - go func() { - defer GinkgoRecover() - Skip("a goroutine SKIP") - println("NEVER SEE THIS") - }() - }, 0.1) - - Measure("a SKIP measure", func(Benchmarker) { - Skip("a measure SKIP") - println("NEVER SEE THIS") - }, 1) -}) - -var _ = Describe("SKIP in a BeforeEach", func() { - BeforeEach(func() { - Skip("a BeforeEach SKIP") - println("NEVER SEE THIS") - }) - - It("a SKIP BeforeEach", func() { - println("NEVER SEE THIS") - }) -}) - -var _ = Describe("SKIP in an AfterEach", func() { - AfterEach(func() { - Skip("an AfterEach SKIP") - println("NEVER SEE THIS") - }) - - It("a SKIP AfterEach", func() { - Expect(true).To(BeTrue()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go deleted file mode 100644 index 1d67048..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go +++ /dev/null @@ -1,9 +0,0 @@ -package suite_command - -func Tested() string { - return "tested" -} - -func Untested() string { - return "untested" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go deleted file mode 100644 index 7f76d8b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package suite_command_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestSuiteCommand(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Suite Command Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go deleted file mode 100644 index e083d27..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package suite_command_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Testing suite command", func() { - It("it should succeed", func() { - Ω(true).Should(Equal(true)) - }) - - PIt("a failing test", func() { - It("should fail", func() { - Ω(true).Should(Equal(false)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go deleted file mode 100644 index b734854..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package synchronized_setup_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "fmt" - "testing" - "time" -) - -func TestSynchronized_setup_tests(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Synchronized_setup_tests Suite") -} - -var beforeData string - -var _ = SynchronizedBeforeSuite(func() []byte { - fmt.Printf("BEFORE_A_%d\n", GinkgoParallelNode()) - time.Sleep(100 * time.Millisecond) - return []byte("DATA") -}, func(data []byte) { - fmt.Printf("BEFORE_B_%d: %s\n", GinkgoParallelNode(), string(data)) - beforeData += string(data) + "OTHER" -}) - -var _ = SynchronizedAfterSuite(func() { - fmt.Printf("\nAFTER_A_%d\n", GinkgoParallelNode()) - time.Sleep(100 * time.Millisecond) -}, func() { - fmt.Printf("AFTER_B_%d\n", GinkgoParallelNode()) -}) - -var _ = Describe("Synchronized Setup", func() { - It("should run the before suite once", func() { - Ω(beforeData).Should(Equal("DATAOTHER")) - }) - - It("should run the before suite once", func() { - Ω(beforeData).Should(Equal("DATAOTHER")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go deleted file mode 100644 index 5176235..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go +++ /dev/null @@ -1,17 +0,0 @@ -// +build complex_tests - -package tags_tests_test - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("Ignored", func() { - It("should not have these tests", func() { - - }) - - It("should not have these tests", func() { - - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go deleted file mode 100644 index dcb11bb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package tags_tests_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestTagsTests(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "TagsTests Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go deleted file mode 100644 index b91a892..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package tags_tests_test - -import ( - . "github.com/onsi/ginkgo" -) - -var _ = Describe("TagsTests", func() { - It("should have a test", func() { - - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go deleted file mode 100644 index 8976370..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package test_description_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestTestDescription(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "TestDescription Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go deleted file mode 100644 index 53c2779..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package test_description_test - -import ( - "fmt" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("TestDescription", func() { - It("should pass", func() { - Ω(true).Should(BeTrue()) - }) - - It("should fail", func() { - Ω(true).Should(BeFalse()) - }) - - AfterEach(func() { - description := CurrentGinkgoTestDescription() - fmt.Printf("%s:%t\n", description.FullTestText, description.Failed) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go deleted file mode 100644 index de2c6bb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go +++ /dev/null @@ -1,7 +0,0 @@ -package A - -import "github.com/onsi/B" - -func DoIt() string { - return B.DoIt() -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go deleted file mode 100644 index 1b6cff4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package A_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestA(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "A Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go deleted file mode 100644 index 003530a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package A_test - -import ( - . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("A", func() { - It("should do it", func() { - Ω(DoIt()).Should(Equal("done!")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go deleted file mode 100644 index 990bab3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go +++ /dev/null @@ -1,7 +0,0 @@ -package B - -import "github.com/onsi/C" - -func DoIt() string { - return C.DoIt() -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go deleted file mode 100644 index e54fce6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package B_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestB(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "B Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go deleted file mode 100644 index b147913..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package B_test - -import ( - . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("B", func() { - It("should do it", func() { - Ω(DoIt()).Should(Equal("done!")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go deleted file mode 100644 index 205b688..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go +++ /dev/null @@ -1,5 +0,0 @@ -package C - -func DoIt() string { - return "done!" -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json deleted file mode 100644 index 421d025..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "fixture": "data" -} \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go deleted file mode 100644 index 57a7a96..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package C_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestC(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "C Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go deleted file mode 100644 index 7703fef..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package C_test - -import ( - . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("C", func() { - It("should do it", func() { - Ω(DoIt()).Should(Equal("done!")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go deleted file mode 100644 index 4371b85..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go +++ /dev/null @@ -1,7 +0,0 @@ -package D - -import "github.com/onsi/C" - -func DoIt() string { - return C.DoIt() -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go deleted file mode 100644 index 0ebefe6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package D_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestD(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "D Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go deleted file mode 100644 index 097945b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package D_test - -import ( - . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("D", func() { - It("should do it", func() { - Ω(DoIt()).Should(Equal("done!")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go deleted file mode 100644 index cb8fc8b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go +++ /dev/null @@ -1,5 +0,0 @@ -package xunit_tests - -func AlwaysTrue() bool { - return true -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go deleted file mode 100644 index a6ebbe1..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package xunit_tests - -import ( - "testing" -) - -func TestAlwaysTrue(t *testing.T) { - if AlwaysTrue() != true { - t.Errorf("Expected true, got false") - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/convert_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/convert_test.go deleted file mode 100644 index f4fd678..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/convert_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package integration_test - -import ( - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("ginkgo convert", func() { - var tmpDir string - - readConvertedFileNamed := func(pathComponents ...string) string { - pathToFile := filepath.Join(tmpDir, "convert_fixtures", filepath.Join(pathComponents...)) - bytes, err := ioutil.ReadFile(pathToFile) - ExpectWithOffset(1, err).NotTo(HaveOccurred()) - - return string(bytes) - } - - readGoldMasterNamed := func(filename string) string { - bytes, err := ioutil.ReadFile(filepath.Join("_fixtures", "convert_goldmasters", filename)) - Ω(err).ShouldNot(HaveOccurred()) - - return string(bytes) - } - - BeforeEach(func() { - var err error - - tmpDir, err = ioutil.TempDir("", "ginkgo-convert") - Ω(err).ShouldNot(HaveOccurred()) - - err = exec.Command("cp", "-r", filepath.Join("_fixtures", "convert_fixtures"), tmpDir).Run() - Ω(err).ShouldNot(HaveOccurred()) - }) - - JustBeforeEach(func() { - cwd, err := os.Getwd() - Ω(err).ShouldNot(HaveOccurred()) - - relPath, err := filepath.Rel(cwd, filepath.Join(tmpDir, "convert_fixtures")) - Ω(err).ShouldNot(HaveOccurred()) - - cmd := exec.Command(pathToGinkgo, "convert", relPath) - cmd.Env = os.Environ() - for i, env := range cmd.Env { - if strings.HasPrefix(env, "PATH") { - cmd.Env[i] = cmd.Env[i] + ":" + filepath.Dir(pathToGinkgo) - break - } - } - err = cmd.Run() - Ω(err).ShouldNot(HaveOccurred()) - }) - - AfterEach(func() { - err := os.RemoveAll(tmpDir) - Ω(err).ShouldNot(HaveOccurred()) - }) - - It("rewrites xunit tests as ginkgo tests", func() { - convertedFile := readConvertedFileNamed("xunit_test.go") - goldMaster := readGoldMasterNamed("xunit_test.go") - Ω(convertedFile).Should(Equal(goldMaster)) - }) - - It("rewrites all usages of *testing.T as mr.T()", func() { - convertedFile := readConvertedFileNamed("extra_functions_test.go") - goldMaster := readGoldMasterNamed("extra_functions_test.go") - Ω(convertedFile).Should(Equal(goldMaster)) - }) - - It("rewrites tests in the package dir that belong to other packages", func() { - convertedFile := readConvertedFileNamed("outside_package_test.go") - goldMaster := readGoldMasterNamed("outside_package_test.go") - Ω(convertedFile).Should(Equal(goldMaster)) - }) - - It("rewrites tests in nested packages", func() { - convertedFile := readConvertedFileNamed("nested", "nested_test.go") - goldMaster := readGoldMasterNamed("nested_test.go") - Ω(convertedFile).Should(Equal(goldMaster)) - }) - - Context("ginkgo test suite files", func() { - It("creates a ginkgo test suite file for the package you specified", func() { - testsuite := readConvertedFileNamed("convert_fixtures_suite_test.go") - goldMaster := readGoldMasterNamed("suite_test.go") - Ω(testsuite).Should(Equal(goldMaster)) - }) - - It("converts go tests in deeply nested packages (some may not contain go files)", func() { - testsuite := readConvertedFileNamed("nested_without_gofiles", "subpackage", "nested_subpackage_test.go") - goldMaster := readGoldMasterNamed("nested_subpackage_test.go") - Ω(testsuite).Should(Equal(goldMaster)) - }) - - It("creates ginkgo test suites for all nested packages", func() { - testsuite := readConvertedFileNamed("nested", "nested_suite_test.go") - goldMaster := readGoldMasterNamed("nested_suite_test.go") - Ω(testsuite).Should(Equal(goldMaster)) - }) - }) - - Context("with an existing test suite file", func() { - BeforeEach(func() { - goldMaster := readGoldMasterNamed("fixtures_suite_test.go") - err := ioutil.WriteFile(filepath.Join(tmpDir, "convert_fixtures", "tmp_suite_test.go"), []byte(goldMaster), 0600) - Ω(err).ShouldNot(HaveOccurred()) - }) - - It("gracefully handles existing test suite files", func() { - //nothing should have gone wrong! - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/coverage_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/coverage_test.go deleted file mode 100644 index a1d24bf..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/coverage_test.go +++ /dev/null @@ -1,147 +0,0 @@ -package integration_test - -import ( - "os/exec" - - "fmt" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Coverage Specs", func() { - Context("when it runs coverage analysis in series and in parallel", func() { - AfterEach(func() { - removeSuccessfully("./_fixtures/coverage_fixture/coverage_fixture.coverprofile") - }) - It("works", func() { - session := startGinkgo("./_fixtures/coverage_fixture", "-cover") - Eventually(session).Should(gexec.Exit(0)) - - Ω(session.Out).Should(gbytes.Say(("coverage: 80.0% of statements"))) - - coverFile := "./_fixtures/coverage_fixture/coverage_fixture.coverprofile" - serialCoverProfileOutput, err := exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput() - Ω(err).ShouldNot(HaveOccurred()) - - removeSuccessfully(coverFile) - - Eventually(startGinkgo("./_fixtures/coverage_fixture", "-cover", "-nodes=4")).Should(gexec.Exit(0)) - - parallelCoverProfileOutput, err := exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput() - Ω(err).ShouldNot(HaveOccurred()) - - Ω(parallelCoverProfileOutput).Should(Equal(serialCoverProfileOutput)) - - By("handling external packages", func() { - session = startGinkgo("./_fixtures/coverage_fixture", "-coverpkg=github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture,github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture") - Eventually(session).Should(gexec.Exit(0)) - - Ω(session.Out).Should(gbytes.Say("coverage: 71.4% of statements in github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture, github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture")) - - serialCoverProfileOutput, err = exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput() - Ω(err).ShouldNot(HaveOccurred()) - - removeSuccessfully("./_fixtures/coverage_fixture/coverage_fixture.coverprofile") - - Eventually(startGinkgo("./_fixtures/coverage_fixture", "-coverpkg=github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture,github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture", "-nodes=4")).Should(gexec.Exit(0)) - - parallelCoverProfileOutput, err = exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput() - Ω(err).ShouldNot(HaveOccurred()) - - Ω(parallelCoverProfileOutput).Should(Equal(serialCoverProfileOutput)) - }) - }) - }) - - Context("when a custom profile name is specified", func() { - AfterEach(func() { - removeSuccessfully("./_fixtures/coverage_fixture/coverage.txt") - }) - - It("generates cover profiles with the specified name", func() { - session := startGinkgo("./_fixtures/coverage_fixture", "-cover", "-coverprofile=coverage.txt") - Eventually(session).Should(gexec.Exit(0)) - - Ω("./_fixtures/coverage_fixture/coverage.txt").Should(BeARegularFile()) - }) - }) - - Context("when run in recursive mode", func() { - AfterEach(func() { - removeSuccessfully("./_fixtures/combined_coverage_fixture/coverage-recursive.txt") - removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package/coverage-recursive.txt") - removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package/coverage-recursive.txt") - }) - - It("generates a coverage file per package", func() { - session := startGinkgo("./_fixtures/combined_coverage_fixture", "-r", "-cover", "-coverprofile=coverage-recursive.txt") - Eventually(session).Should(gexec.Exit(0)) - - Ω("./_fixtures/combined_coverage_fixture/first_package/coverage-recursive.txt").Should(BeARegularFile()) - Ω("./_fixtures/combined_coverage_fixture/second_package/coverage-recursive.txt").Should(BeARegularFile()) - }) - }) - - Context("when run in parallel mode", func() { - AfterEach(func() { - removeSuccessfully("./_fixtures/coverage_fixture/coverage-parallel.txt") - }) - - It("works", func() { - session := startGinkgo("./_fixtures/coverage_fixture", "-p", "-cover", "-coverprofile=coverage-parallel.txt") - - Eventually(session).Should(gexec.Exit(0)) - - Ω("./_fixtures/coverage_fixture/coverage-parallel.txt").Should(BeARegularFile()) - }) - }) - - Context("when run in recursive mode specifying a coverprofile", func() { - AfterEach(func() { - removeSuccessfully("./_fixtures/combined_coverage_fixture/coverprofile-recursive.txt") - removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package/coverprofile-recursive.txt") - removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package/coverprofile-recursive.txt") - }) - - It("combines the coverages", func() { - session := startGinkgo("./_fixtures/combined_coverage_fixture", "-outputdir=./", "-r", "-cover", "-coverprofile=coverprofile-recursive.txt") - Eventually(session).Should(gexec.Exit(0)) - - By("generating a combined coverage file", func() { - Ω("./_fixtures/combined_coverage_fixture/coverprofile-recursive.txt").Should(BeARegularFile()) - }) - - By("also generating the single package coverage files", func() { - Ω("./_fixtures/combined_coverage_fixture/first_package/coverprofile-recursive.txt").Should(BeARegularFile()) - Ω("./_fixtures/combined_coverage_fixture/second_package/coverprofile-recursive.txt").Should(BeARegularFile()) - }) - }) - }) - - It("Fails with an error if output dir and coverprofile were set, but the output dir did not exist", func() { - session := startGinkgo("./_fixtures/combined_coverage_fixture", "-outputdir=./all/profiles/here", "-r", "-cover", "-coverprofile=coverage.txt") - - Eventually(session).Should(gexec.Exit(1)) - output := session.Out.Contents() - Ω(string(output)).Should(ContainSubstring("Unable to create combined profile, outputdir does not exist: ./all/profiles/here")) - }) - - Context("when only output dir was set", func() { - AfterEach(func() { - removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package.coverprofile") - removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package/coverage.txt") - removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package.coverprofile") - removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package/coverage.txt") - }) - It("moves coverages", func() { - session := startGinkgo("./_fixtures/combined_coverage_fixture", "-outputdir=./", "-r", "-cover") - Eventually(session).Should(gexec.Exit(0)) - - Ω("./_fixtures/combined_coverage_fixture/first_package.coverprofile").Should(BeARegularFile()) - Ω("./_fixtures/combined_coverage_fixture/second_package.coverprofile").Should(BeARegularFile()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/fail_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/fail_test.go deleted file mode 100644 index 53b2a67..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/fail_test.go +++ /dev/null @@ -1,55 +0,0 @@ -package integration_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Failing Specs", func() { - var pathToTest string - - BeforeEach(func() { - pathToTest = tmpPath("failing") - copyIn(fixturePath("fail_fixture"), pathToTest, false) - }) - - It("should fail in all the possible ways", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS")) - - Ω(output).Should(ContainSubstring("a top level failure on line 9")) - Ω(output).Should(ContainSubstring("fail_fixture_test.go:9")) - Ω(output).Should(ContainSubstring("an async top level failure on line 14")) - Ω(output).Should(ContainSubstring("fail_fixture_test.go:14")) - Ω(output).Should(ContainSubstring("a top level goroutine failure on line 21")) - Ω(output).Should(ContainSubstring("fail_fixture_test.go:21")) - - Ω(output).Should(ContainSubstring("a sync failure")) - Ω(output).Should(MatchRegexp(`Test Panicked\n\s+a sync panic`)) - Ω(output).Should(ContainSubstring("a sync FAIL failure")) - Ω(output).Should(ContainSubstring("async timeout [It]")) - Ω(output).Should(ContainSubstring("Timed out")) - Ω(output).Should(ContainSubstring("an async failure")) - Ω(output).Should(MatchRegexp(`Test Panicked\n\s+an async panic`)) - Ω(output).Should(ContainSubstring("an async FAIL failure")) - Ω(output).Should(ContainSubstring("a goroutine FAIL failure")) - Ω(output).Should(ContainSubstring("a goroutine failure")) - Ω(output).Should(MatchRegexp(`Test Panicked\n\s+a goroutine panic`)) - Ω(output).Should(ContainSubstring("a measure failure")) - Ω(output).Should(ContainSubstring("a measure FAIL failure")) - Ω(output).Should(MatchRegexp(`Test Panicked\n\s+a measure panic`)) - - Ω(output).Should(ContainSubstring("a top level specify")) - Ω(output).ShouldNot(ContainSubstring("ginkgo_dsl.go")) - // depending on the go version this could be the first line of the Specify - // block (>= go1.9) or the last line of the Specify block (< go1.9) - Ω(output).Should(Or(ContainSubstring("fail_fixture_test.go:101"), ContainSubstring("fail_fixture_test.go:103"))) - Ω(output).Should(ContainSubstring("fail_fixture_test.go:102")) - - Ω(output).Should(ContainSubstring("0 Passed | 17 Failed")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/flags_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/flags_test.go deleted file mode 100644 index d84eb46..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/flags_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package integration_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "strings" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Flags Specs", func() { - var pathToTest string - - BeforeEach(func() { - pathToTest = tmpPath("flags") - copyIn(fixturePath("flags_tests"), pathToTest, false) - }) - - getRandomOrders := func(output string) []int { - return []int{strings.Index(output, "RANDOM_A"), strings.Index(output, "RANDOM_B"), strings.Index(output, "RANDOM_C")} - } - - It("normally passes, runs measurements, prints out noisy pendings, does not randomize tests, and honors the programmatic focus", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Ran 3 samples:"), "has a measurement") - Ω(output).Should(ContainSubstring("11 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - Ω(output).Should(ContainSubstring("1 Pending")) - Ω(output).Should(ContainSubstring("3 Skipped")) - Ω(output).Should(ContainSubstring("[PENDING]")) - Ω(output).Should(ContainSubstring("marshmallow")) - Ω(output).Should(ContainSubstring("chocolate")) - Ω(output).Should(ContainSubstring("CUSTOM_FLAG: default")) - Ω(output).Should(ContainSubstring("Detected Programmatic Focus - setting exit status to %d", types.GINKGO_FOCUS_EXIT_CODE)) - Ω(output).ShouldNot(ContainSubstring("smores")) - Ω(output).ShouldNot(ContainSubstring("SLOW TEST")) - Ω(output).ShouldNot(ContainSubstring("should honor -slowSpecThreshold")) - - orders := getRandomOrders(output) - Ω(orders[0]).Should(BeNumerically("<", orders[1])) - Ω(orders[1]).Should(BeNumerically("<", orders[2])) - }) - - It("should run a coverprofile when passed -cover", func() { - session := startGinkgo(pathToTest, "--noColor", "--cover", "--focus=the focused set") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - _, err := os.Stat(filepath.Join(pathToTest, "flags.coverprofile")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(output).Should(ContainSubstring("coverage: ")) - }) - - It("should fail when there are pending tests and it is passed --failOnPending", func() { - session := startGinkgo(pathToTest, "--noColor", "--failOnPending") - Eventually(session).Should(gexec.Exit(1)) - }) - - It("should fail if the test suite takes longer than the timeout", func() { - session := startGinkgo(pathToTest, "--noColor", "--timeout=1ms") - Eventually(session).Should(gexec.Exit(1)) - }) - - It("should not print out pendings when --noisyPendings=false", func() { - session := startGinkgo(pathToTest, "--noColor", "--noisyPendings=false") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).ShouldNot(ContainSubstring("[PENDING]")) - Ω(output).Should(ContainSubstring("1 Pending")) - }) - - It("should override the programmatic focus when told to focus", func() { - session := startGinkgo(pathToTest, "--noColor", "--focus=smores") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("marshmallow")) - Ω(output).Should(ContainSubstring("chocolate")) - Ω(output).Should(ContainSubstring("smores")) - Ω(output).Should(ContainSubstring("3 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - Ω(output).Should(ContainSubstring("0 Pending")) - Ω(output).Should(ContainSubstring("12 Skipped")) - }) - - It("should override the programmatic focus when told to skip", func() { - session := startGinkgo(pathToTest, "--noColor", "--skip=marshmallow|failing|flaky") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).ShouldNot(ContainSubstring("marshmallow")) - Ω(output).Should(ContainSubstring("chocolate")) - Ω(output).Should(ContainSubstring("smores")) - Ω(output).Should(ContainSubstring("11 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - Ω(output).Should(ContainSubstring("1 Pending")) - Ω(output).Should(ContainSubstring("3 Skipped")) - }) - - It("should run the race detector when told to", func() { - session := startGinkgo(pathToTest, "--noColor", "--race") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("WARNING: DATA RACE")) - }) - - It("should randomize tests when told to", func() { - session := startGinkgo(pathToTest, "--noColor", "--randomizeAllSpecs", "--seed=17") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - orders := getRandomOrders(output) - Ω(orders[0]).ShouldNot(BeNumerically("<", orders[1])) - }) - - It("should skip measurements when told to", func() { - session := startGinkgo(pathToTest, "--skipMeasurements") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).ShouldNot(ContainSubstring("Ran 3 samples:"), "has a measurement") - Ω(output).Should(ContainSubstring("4 Skipped")) - }) - - It("should watch for slow specs", func() { - session := startGinkgo(pathToTest, "--slowSpecThreshold=0.05") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("SLOW TEST")) - Ω(output).Should(ContainSubstring("should honor -slowSpecThreshold")) - }) - - It("should pass additional arguments in", func() { - session := startGinkgo(pathToTest, "--", "--customFlag=madagascar") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("CUSTOM_FLAG: madagascar")) - }) - - It("should print out full stack traces for failures when told to", func() { - session := startGinkgo(pathToTest, "--focus=a failing test", "--trace") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Full Stack Trace")) - }) - - It("should fail fast when told to", func() { - pathToTest = tmpPath("fail") - copyIn(fixturePath("fail_fixture"), pathToTest, false) - session := startGinkgo(pathToTest, "--failFast") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("1 Failed")) - Ω(output).Should(ContainSubstring("16 Skipped")) - }) - - Context("with a flaky test", func() { - It("should normally fail", func() { - session := startGinkgo(pathToTest, "--focus=flaky") - Eventually(session).Should(gexec.Exit(1)) - }) - - It("should pass if retries are requested", func() { - session := startGinkgo(pathToTest, "--focus=flaky --flakeAttempts=2") - Eventually(session).Should(gexec.Exit(0)) - }) - }) - - It("should perform a dry run when told to", func() { - pathToTest = tmpPath("fail") - copyIn(fixturePath("fail_fixture"), pathToTest, false) - session := startGinkgo(pathToTest, "--dryRun", "-v") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("synchronous failures")) - Ω(output).Should(ContainSubstring("17 Specs")) - Ω(output).Should(ContainSubstring("0 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - }) - - regextest := func(regexOption string, skipOrFocus string) string { - pathToTest = tmpPath("passing") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - session := startGinkgo(pathToTest, regexOption, "--dryRun", "-v", skipOrFocus) - Eventually(session).Should(gexec.Exit(0)) - return string(session.Out.Contents()) - } - - It("regexScansFilePath (enabled) should skip and focus on file names", func() { - output := regextest("-regexScansFilePath=true", "-skip=/passing/") // everything gets skipped (nothing runs) - Ω(output).Should(ContainSubstring("0 of 4 Specs")) - output = regextest("-regexScansFilePath=true", "-focus=/passing/") // everything gets focused (everything runs) - Ω(output).Should(ContainSubstring("4 of 4 Specs")) - }) - - It("regexScansFilePath (disabled) should not effect normal filtering", func() { - output := regextest("-regexScansFilePath=false", "-skip=/passing/") // nothing gets skipped (everything runs) - Ω(output).Should(ContainSubstring("4 of 4 Specs")) - output = regextest("-regexScansFilePath=false", "-focus=/passing/") // nothing gets focused (nothing runs) - Ω(output).Should(ContainSubstring("0 of 4 Specs")) - }) - - It("should honor compiler flags", func() { - session := startGinkgo(pathToTest, "-gcflags=-importmap 'math=math/cmplx'") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - Ω(output).Should(ContainSubstring("NaN returns complex128")) - }) - - It("should honor covermode flag", func() { - session := startGinkgo(pathToTest, "--noColor", "--covermode=count", "--focus=the focused set") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - Ω(output).Should(ContainSubstring("coverage: ")) - - coverageFile := filepath.Join(pathToTest, "flags.coverprofile") - _, err := os.Stat(coverageFile) - Ω(err).ShouldNot(HaveOccurred()) - contents, err := ioutil.ReadFile(coverageFile) - Ω(err).ShouldNot(HaveOccurred()) - Ω(contents).Should(ContainSubstring("mode: count")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration.go deleted file mode 100644 index 76ab1b7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration.go +++ /dev/null @@ -1 +0,0 @@ -package integration diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go deleted file mode 100644 index 32ec741..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go +++ /dev/null @@ -1,129 +0,0 @@ -package integration_test - -import ( - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" - - "testing" - "time" -) - -var tmpDir string -var pathToGinkgo string - -func TestIntegration(t *testing.T) { - SetDefaultEventuallyTimeout(30 * time.Second) - RegisterFailHandler(Fail) - RunSpecs(t, "Integration Suite") -} - -var _ = SynchronizedBeforeSuite(func() []byte { - pathToGinkgo, err := gexec.Build("github.com/onsi/ginkgo/ginkgo") - Ω(err).ShouldNot(HaveOccurred()) - return []byte(pathToGinkgo) -}, func(computedPathToGinkgo []byte) { - pathToGinkgo = string(computedPathToGinkgo) -}) - -var _ = BeforeEach(func() { - var err error - tmpDir, err = ioutil.TempDir("", "ginkgo-run") - Ω(err).ShouldNot(HaveOccurred()) -}) - -var _ = AfterEach(func() { - err := os.RemoveAll(tmpDir) - Ω(err).ShouldNot(HaveOccurred()) -}) - -var _ = SynchronizedAfterSuite(func() {}, func() { - gexec.CleanupBuildArtifacts() -}) - -func tmpPath(destination string) string { - return filepath.Join(tmpDir, destination) -} - -func fixturePath(name string) string { - return filepath.Join("_fixtures", name) -} - -func copyIn(sourcePath, destinationPath string, recursive bool) { - err := os.MkdirAll(destinationPath, 0777) - Expect(err).NotTo(HaveOccurred()) - - files, err := ioutil.ReadDir(sourcePath) - Expect(err).NotTo(HaveOccurred()) - for _, f := range files { - srcPath := filepath.Join(sourcePath, f.Name()) - dstPath := filepath.Join(destinationPath, f.Name()) - if f.IsDir() { - if recursive { - copyIn(srcPath, dstPath, recursive) - } - continue - } - - src, err := os.Open(srcPath) - - Expect(err).NotTo(HaveOccurred()) - defer src.Close() - - dst, err := os.Create(dstPath) - Expect(err).NotTo(HaveOccurred()) - defer dst.Close() - - _, err = io.Copy(dst, src) - Expect(err).NotTo(HaveOccurred()) - } -} - -func sameFile(filePath, otherFilePath string) bool { - content, readErr := ioutil.ReadFile(filePath) - Expect(readErr).NotTo(HaveOccurred()) - otherContent, readErr := ioutil.ReadFile(otherFilePath) - Expect(readErr).NotTo(HaveOccurred()) - Expect(string(content)).To(Equal(string(otherContent))) - return true -} - -func sameFolder(sourcePath, destinationPath string) bool { - files, err := ioutil.ReadDir(sourcePath) - Expect(err).NotTo(HaveOccurred()) - for _, f := range files { - srcPath := filepath.Join(sourcePath, f.Name()) - dstPath := filepath.Join(destinationPath, f.Name()) - if f.IsDir() { - sameFolder(srcPath, dstPath) - continue - } - Expect(sameFile(srcPath, dstPath)).To(BeTrue()) - } - return true -} - -func ginkgoCommand(dir string, args ...string) *exec.Cmd { - cmd := exec.Command(pathToGinkgo, args...) - cmd.Dir = dir - - return cmd -} - -func startGinkgo(dir string, args ...string) *gexec.Session { - cmd := ginkgoCommand(dir, args...) - session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter) - Ω(err).ShouldNot(HaveOccurred()) - return session -} - -func removeSuccessfully(path string) { - err := os.RemoveAll(path) - Expect(err).NotTo(HaveOccurred()) -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go deleted file mode 100644 index d4158b8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go +++ /dev/null @@ -1,51 +0,0 @@ -package integration_test - -import ( - "os/exec" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Interrupt", func() { - var pathToTest string - BeforeEach(func() { - pathToTest = tmpPath("hanging") - copyIn(fixturePath("hanging_suite"), pathToTest, false) - }) - - Context("when interrupting a suite", func() { - var session *gexec.Session - BeforeEach(func() { - //we need to signal the actual process, so we must compile the test first - var err error - cmd := exec.Command("go", "test", "-c") - cmd.Dir = pathToTest - session, err = gexec.Start(cmd, GinkgoWriter, GinkgoWriter) - Ω(err).ShouldNot(HaveOccurred()) - Eventually(session).Should(gexec.Exit(0)) - - //then run the compiled test directly - cmd = exec.Command("./hanging.test", "--test.v=true", "--ginkgo.noColor") - cmd.Dir = pathToTest - session, err = gexec.Start(cmd, GinkgoWriter, GinkgoWriter) - Ω(err).ShouldNot(HaveOccurred()) - - Eventually(session).Should(gbytes.Say("Sleeping...")) - session.Interrupt() - Eventually(session, 1000).Should(gexec.Exit(1)) - }) - - It("should emit the contents of the GinkgoWriter", func() { - Ω(session).Should(gbytes.Say("Just beginning")) - Ω(session).Should(gbytes.Say("Almost there...")) - Ω(session).Should(gbytes.Say("Hanging Out")) - }) - - It("should run the AfterSuite", func() { - Ω(session).Should(gbytes.Say("Heading Out After Suite")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go deleted file mode 100644 index 55724a9..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package integration_test - -import ( - "os" - "os/exec" - "path/filepath" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("ginkgo build", func() { - var pathToTest string - - BeforeEach(func() { - pathToTest = tmpPath("passing_ginkgo_tests") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - session := startGinkgo(pathToTest, "build") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - Ω(output).Should(ContainSubstring("Compiling passing_ginkgo_tests")) - Ω(output).Should(ContainSubstring("compiled passing_ginkgo_tests.test")) - }) - - It("should build a test binary", func() { - _, err := os.Stat(filepath.Join(pathToTest, "passing_ginkgo_tests.test")) - Ω(err).ShouldNot(HaveOccurred()) - }) - - It("should be possible to run the test binary directly", func() { - cmd := exec.Command("./passing_ginkgo_tests.test") - cmd.Dir = pathToTest - session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter) - Ω(err).ShouldNot(HaveOccurred()) - Eventually(session).Should(gexec.Exit(0)) - Ω(session).Should(gbytes.Say("Running Suite: Passing_ginkgo_tests Suite")) - }) - - It("should be possible to run the test binary via ginkgo", func() { - session := startGinkgo(pathToTest, "./passing_ginkgo_tests.test") - Eventually(session).Should(gexec.Exit(0)) - Ω(session).Should(gbytes.Say("Running Suite: Passing_ginkgo_tests Suite")) - }) - - It("should be possible to run the test binary in parallel", func() { - session := startGinkgo(pathToTest, "--nodes=4", "--noColor", "./passing_ginkgo_tests.test") - Eventually(session).Should(gexec.Exit(0)) - Ω(session).Should(gbytes.Say("Running Suite: Passing_ginkgo_tests Suite")) - Ω(session).Should(gbytes.Say("Running in parallel across 4 nodes")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/progress_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/progress_test.go deleted file mode 100644 index cda86b6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/progress_test.go +++ /dev/null @@ -1,94 +0,0 @@ -package integration_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Emitting progress", func() { - var pathToTest string - var session *gexec.Session - var args []string - - BeforeEach(func() { - args = []string{"--noColor"} - pathToTest = tmpPath("progress") - copyIn(fixturePath("progress_fixture"), pathToTest, false) - }) - - JustBeforeEach(func() { - session = startGinkgo(pathToTest, args...) - Eventually(session).Should(gexec.Exit(0)) - }) - - Context("with the -progress flag, but no -v flag", func() { - BeforeEach(func() { - args = append(args, "-progress") - }) - - It("should not emit progress", func() { - Ω(session).ShouldNot(gbytes.Say("[bB]efore")) - }) - }) - - Context("with the -v flag", func() { - BeforeEach(func() { - args = append(args, "-v") - }) - - It("should not emit progress", func() { - Ω(session).ShouldNot(gbytes.Say(`\[BeforeEach\]`)) - Ω(session).Should(gbytes.Say(`>outer before<`)) - }) - }) - - Context("with the -progress flag and the -v flag", func() { - BeforeEach(func() { - args = append(args, "-progress", "-v") - }) - - It("should emit progress (by writing to the GinkgoWriter)", func() { - // First spec - - Ω(session).Should(gbytes.Say(`\[BeforeEach\] ProgressFixture`)) - Ω(session).Should(gbytes.Say(`>outer before<`)) - - Ω(session).Should(gbytes.Say(`\[BeforeEach\] Inner Context`)) - Ω(session).Should(gbytes.Say(`>inner before<`)) - - Ω(session).Should(gbytes.Say(`\[BeforeEach\] when Inner When`)) - Ω(session).Should(gbytes.Say(`>inner before<`)) - - Ω(session).Should(gbytes.Say(`\[JustBeforeEach\] ProgressFixture`)) - Ω(session).Should(gbytes.Say(`>outer just before<`)) - - Ω(session).Should(gbytes.Say(`\[JustBeforeEach\] Inner Context`)) - Ω(session).Should(gbytes.Say(`>inner just before<`)) - - Ω(session).Should(gbytes.Say(`\[It\] should emit progress as it goes`)) - Ω(session).Should(gbytes.Say(`>it<`)) - - Ω(session).Should(gbytes.Say(`\[AfterEach\] Inner Context`)) - Ω(session).Should(gbytes.Say(`>inner after<`)) - - Ω(session).Should(gbytes.Say(`\[AfterEach\] ProgressFixture`)) - Ω(session).Should(gbytes.Say(`>outer after<`)) - - // Second spec - - Ω(session).Should(gbytes.Say(`\[BeforeEach\] ProgressFixture`)) - Ω(session).Should(gbytes.Say(`>outer before<`)) - - Ω(session).Should(gbytes.Say(`\[JustBeforeEach\] ProgressFixture`)) - Ω(session).Should(gbytes.Say(`>outer just before<`)) - - Ω(session).Should(gbytes.Say(`\[It\] should emit progress as it goes`)) - Ω(session).Should(gbytes.Say(`>specify<`)) - - Ω(session).Should(gbytes.Say(`\[AfterEach\] ProgressFixture`)) - Ω(session).Should(gbytes.Say(`>outer after<`)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/run_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/run_test.go deleted file mode 100644 index 6c270b6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/run_test.go +++ /dev/null @@ -1,483 +0,0 @@ -package integration_test - -import ( - "fmt" - "io/ioutil" - "os" - "regexp" - "runtime" - "strings" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Running Specs", func() { - var pathToTest string - - isWindows := (runtime.GOOS == "windows") - denoter := "•" - - if isWindows { - denoter = "+" - } - - Context("when pointed at the current directory", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - }) - - It("should run the tests in the working directory", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring(strings.Repeat(denoter, 4))) - Ω(output).Should(ContainSubstring("SUCCESS! -- 4 Passed")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - - Context("when passed an explicit package to run", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - }) - - It("should run the ginkgo style tests", func() { - session := startGinkgo(tmpDir, "--noColor", pathToTest) - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring(strings.Repeat(denoter, 4))) - Ω(output).Should(ContainSubstring("SUCCESS! -- 4 Passed")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - - Context("when passed a number of packages to run", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - otherPathToTest := tmpPath("other") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false) - }) - - It("should run the ginkgo style tests", func() { - session := startGinkgo(tmpDir, "--noColor", "--succinct=false", "ginkgo", "./other") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - - Context("when passed a number of packages to run, some of which have focused tests", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - otherPathToTest := tmpPath("other") - focusedPathToTest := tmpPath("focused") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false) - copyIn(fixturePath("focused_fixture"), focusedPathToTest, false) - }) - - It("should exit with a status code of 2 and explain why", func() { - session := startGinkgo(tmpDir, "--noColor", "--succinct=false", "-r") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - Ω(output).Should(ContainSubstring("Detected Programmatic Focus - setting exit status to %d", types.GINKGO_FOCUS_EXIT_CODE)) - }) - - Context("when the GINKGO_EDITOR_INTEGRATION environment variable is set", func() { - BeforeEach(func() { - os.Setenv("GINKGO_EDITOR_INTEGRATION", "true") - }) - AfterEach(func() { - os.Setenv("GINKGO_EDITOR_INTEGRATION", "") - }) - It("should exit with a status code of 0 to allow a coverage file to be generated", func() { - session := startGinkgo(tmpDir, "--noColor", "--succinct=false", "-r") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - }) - - Context("when told to skipPackages", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - otherPathToTest := tmpPath("other") - focusedPathToTest := tmpPath("focused") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false) - copyIn(fixturePath("focused_fixture"), focusedPathToTest, false) - }) - - It("should skip packages that match the list", func() { - session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Passing_ginkgo_tests Suite")) - Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite")) - Ω(output).ShouldNot(ContainSubstring("Focused_fixture Suite")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - - Context("when all packages are skipped", func() { - It("should not run anything, but still exit 0", func() { - session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused,ginkgo", "-r") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("All tests skipped!")) - Ω(output).ShouldNot(ContainSubstring("Passing_ginkgo_tests Suite")) - Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite")) - Ω(output).ShouldNot(ContainSubstring("Focused_fixture Suite")) - Ω(output).ShouldNot(ContainSubstring("Test Suite Passed")) - }) - }) - }) - - Context("when there are no tests to run", func() { - It("should exit 1", func() { - session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Err.Contents()) - - Ω(output).Should(ContainSubstring("Found no test suites")) - }) - }) - - Context("when there are test files but `go test` reports there are no tests to run", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("no_test_fn"), pathToTest, false) - }) - - It("suggests running ginkgo bootstrap", func() { - session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Err.Contents()) - - Ω(output).Should(ContainSubstring(`Found no test suites, did you forget to run "ginkgo bootstrap"?`)) - }) - - It("fails if told to requireSuite", func() { - session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r", "-requireSuite") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Err.Contents()) - - Ω(output).Should(ContainSubstring(`Found no test suites, did you forget to run "ginkgo bootstrap"?`)) - }) - }) - - Context("when told to randomizeSuites", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - otherPathToTest := tmpPath("other") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false) - }) - - It("should skip packages that match the regexp", func() { - session := startGinkgo(tmpDir, "--noColor", "--randomizeSuites", "-r", "--seed=2") - Eventually(session).Should(gexec.Exit(0)) - - Ω(session).Should(gbytes.Say("More_ginkgo_tests Suite")) - Ω(session).Should(gbytes.Say("Passing_ginkgo_tests Suite")) - - session = startGinkgo(tmpDir, "--noColor", "--randomizeSuites", "-r", "--seed=3") - Eventually(session).Should(gexec.Exit(0)) - - Ω(session).Should(gbytes.Say("Passing_ginkgo_tests Suite")) - Ω(session).Should(gbytes.Say("More_ginkgo_tests Suite")) - }) - }) - - Context("when pointed at a package with xunit style tests", func() { - BeforeEach(func() { - pathToTest = tmpPath("xunit") - copyIn(fixturePath("xunit_tests"), pathToTest, false) - }) - - It("should run the xunit style tests", func() { - session := startGinkgo(pathToTest) - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("--- PASS: TestAlwaysTrue")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - - Context("when pointed at a package with no tests", func() { - BeforeEach(func() { - pathToTest = tmpPath("no_tests") - copyIn(fixturePath("no_tests"), pathToTest, false) - }) - - It("should fail", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(1)) - - Ω(session.Err.Contents()).Should(ContainSubstring("Found no test suites")) - }) - }) - - Context("when pointed at a package that fails to compile", func() { - BeforeEach(func() { - pathToTest = tmpPath("does_not_compile") - copyIn(fixturePath("does_not_compile"), pathToTest, false) - }) - - It("should fail", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Failed to compile")) - }) - }) - - Context("when running in parallel", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - }) - - Context("with a specific number of -nodes", func() { - It("should use the specified number of nodes", func() { - session := startGinkgo(pathToTest, "--noColor", "-succinct", "-nodes=2") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4 specs - 2 nodes [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s`, regexp.QuoteMeta(denoter))) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - - Context("with -p", func() { - It("it should autocompute the number of nodes", func() { - session := startGinkgo(pathToTest, "--noColor", "-succinct", "-p") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - nodes := runtime.NumCPU() - if nodes == 1 { - Skip("Can't test parallel testings with 1 CPU") - } - if nodes > 4 { - nodes = nodes - 1 - } - Ω(output).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4 specs - %d nodes [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]?s`, nodes, regexp.QuoteMeta(denoter))) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - }) - - Context("when running in parallel with -debug", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("debug_parallel_fixture"), pathToTest, false) - }) - - Context("without -v", func() { - It("should emit node output to files on disk", func() { - session := startGinkgo(pathToTest, "--nodes=2", "--debug") - Eventually(session).Should(gexec.Exit(0)) - - f0, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-1.log") - Ω(err).ShouldNot(HaveOccurred()) - f1, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-2.log") - Ω(err).ShouldNot(HaveOccurred()) - content := string(append(f0, f1...)) - - for i := 0; i < 10; i += 1 { - Ω(content).Should(ContainSubstring("StdOut %d\n", i)) - Ω(content).Should(ContainSubstring("GinkgoWriter %d\n", i)) - } - }) - }) - - Context("without -v", func() { - It("should emit node output to files on disk, without duplicating the GinkgoWriter output", func() { - session := startGinkgo(pathToTest, "--nodes=2", "--debug", "-v") - Eventually(session).Should(gexec.Exit(0)) - - f0, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-1.log") - Ω(err).ShouldNot(HaveOccurred()) - f1, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-2.log") - Ω(err).ShouldNot(HaveOccurred()) - content := string(append(f0, f1...)) - - out := strings.Split(content, "GinkgoWriter 2") - Ω(out).Should(HaveLen(2)) - }) - }) - }) - - Context("when streaming in parallel", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - }) - - It("should print output in realtime", func() { - session := startGinkgo(pathToTest, "--noColor", "-stream", "-nodes=2") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring(`[1] Parallel test node 1/2.`)) - Ω(output).Should(ContainSubstring(`[2] Parallel test node 2/2.`)) - Ω(output).Should(ContainSubstring(`[1] SUCCESS!`)) - Ω(output).Should(ContainSubstring(`[2] SUCCESS!`)) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - - Context("when running recursively", func() { - BeforeEach(func() { - passingTest := tmpPath("A") - otherPassingTest := tmpPath("E") - copyIn(fixturePath("passing_ginkgo_tests"), passingTest, false) - copyIn(fixturePath("more_ginkgo_tests"), otherPassingTest, false) - }) - - Context("when all the tests pass", func() { - Context("with the -r flag", func() { - It("should run all the tests (in succinct mode) and succeed", func() { - session := startGinkgo(tmpDir, "--noColor", "-r", ".") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - outputLines := strings.Split(output, "\n") - Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(outputLines[1]).Should(MatchRegexp(`\[\d+\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - Context("with a trailing /...", func() { - It("should run all the tests (in succinct mode) and succeed", func() { - session := startGinkgo(tmpDir, "--noColor", "./...") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - outputLines := strings.Split(output, "\n") - Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(outputLines[1]).Should(MatchRegexp(`\[\d+\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - }) - }) - }) - - Context("when one of the packages has a failing tests", func() { - BeforeEach(func() { - failingTest := tmpPath("C") - copyIn(fixturePath("failing_ginkgo_tests"), failingTest, false) - }) - - It("should fail and stop running tests", func() { - session := startGinkgo(tmpDir, "--noColor", "-r") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - outputLines := strings.Split(output, "\n") - Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(outputLines[1]).Should(MatchRegexp(`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`)) - Ω(output).Should(ContainSubstring(fmt.Sprintf("%s Failure", denoter))) - Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Test Suite Failed")) - - Ω(output).Should(ContainSubstring("Summarizing 1 Failure:")) - Ω(output).Should(ContainSubstring("[Fail] FailingGinkgoTests [It] should fail")) - }) - }) - - Context("when one of the packages fails to compile", func() { - BeforeEach(func() { - doesNotCompileTest := tmpPath("C") - copyIn(fixturePath("does_not_compile"), doesNotCompileTest, false) - }) - - It("should fail and stop running tests", func() { - session := startGinkgo(tmpDir, "--noColor", "-r") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - outputLines := strings.Split(output, "\n") - Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(outputLines[1]).Should(ContainSubstring("Failed to compile C:")) - Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Test Suite Failed")) - }) - }) - - Context("when either is the case, but the keepGoing flag is set", func() { - BeforeEach(func() { - doesNotCompileTest := tmpPath("B") - copyIn(fixturePath("does_not_compile"), doesNotCompileTest, false) - - failingTest := tmpPath("C") - copyIn(fixturePath("failing_ginkgo_tests"), failingTest, false) - }) - - It("should soldier on", func() { - session := startGinkgo(tmpDir, "--noColor", "-r", "-keepGoing") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - outputLines := strings.Split(output, "\n") - Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(outputLines[1]).Should(ContainSubstring("Failed to compile B:")) - Ω(output).Should(MatchRegexp(`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`)) - Ω(output).Should(ContainSubstring(fmt.Sprintf("%s Failure", denoter))) - Ω(output).Should(MatchRegexp(`\[\d+\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter))) - Ω(output).Should(ContainSubstring("Test Suite Failed")) - }) - }) - }) - - Context("when told to keep going --untilItFails", func() { - BeforeEach(func() { - copyIn(fixturePath("eventually_failing"), tmpDir, false) - }) - - It("should keep rerunning the tests, until a failure occurs", func() { - session := startGinkgo(tmpDir, "--untilItFails", "--noColor") - Eventually(session).Should(gexec.Exit(1)) - Ω(session).Should(gbytes.Say("This was attempt #1")) - Ω(session).Should(gbytes.Say("This was attempt #2")) - Ω(session).Should(gbytes.Say("Tests failed on attempt #3")) - - //it should change the random seed between each test - lines := strings.Split(string(session.Out.Contents()), "\n") - randomSeeds := []string{} - for _, line := range lines { - if strings.Contains(line, "Random Seed:") { - randomSeeds = append(randomSeeds, strings.Split(line, ": ")[1]) - } - } - Ω(randomSeeds[0]).ShouldNot(Equal(randomSeeds[1])) - Ω(randomSeeds[1]).ShouldNot(Equal(randomSeeds[2])) - Ω(randomSeeds[0]).ShouldNot(Equal(randomSeeds[2])) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/skip_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/skip_test.go deleted file mode 100644 index f0fc9d5..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/skip_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package integration_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Skipping Specs", func() { - var pathToTest string - - BeforeEach(func() { - pathToTest = tmpPath("skipping") - copyIn(fixturePath("skip_fixture"), pathToTest, false) - }) - - It("should skip in all the possible ways", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS")) - - Ω(output).Should(ContainSubstring("a top level skip on line 9")) - Ω(output).Should(ContainSubstring("skip_fixture_test.go:9")) - Ω(output).Should(ContainSubstring("an async top level skip on line 14")) - Ω(output).Should(ContainSubstring("skip_fixture_test.go:14")) - Ω(output).Should(ContainSubstring("a top level goroutine skip on line 21")) - Ω(output).Should(ContainSubstring("skip_fixture_test.go:21")) - - Ω(output).Should(ContainSubstring("a sync SKIP")) - Ω(output).Should(ContainSubstring("an async SKIP")) - Ω(output).Should(ContainSubstring("a goroutine SKIP")) - Ω(output).Should(ContainSubstring("a measure SKIP")) - - Ω(output).Should(ContainSubstring("S [SKIPPING] in Spec Setup (BeforeEach) [")) - Ω(output).Should(ContainSubstring("a BeforeEach SKIP")) - Ω(output).Should(ContainSubstring("S [SKIPPING] in Spec Teardown (AfterEach) [")) - Ω(output).Should(ContainSubstring("an AfterEach SKIP")) - - Ω(output).Should(ContainSubstring("0 Passed | 0 Failed | 0 Pending | 9 Skipped")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go deleted file mode 100644 index 17b0040..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go +++ /dev/null @@ -1,434 +0,0 @@ -package integration_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "strings" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Subcommand", func() { - Describe("ginkgo bootstrap", func() { - var pkgPath string - BeforeEach(func() { - pkgPath = tmpPath("foo") - os.Mkdir(pkgPath, 0777) - }) - - It("should generate a bootstrap file, as long as one does not exist", func() { - session := startGinkgo(pkgPath, "bootstrap") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_suite_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_test")) - Ω(content).Should(ContainSubstring("func TestFoo(t *testing.T) {")) - Ω(content).Should(ContainSubstring("RegisterFailHandler")) - Ω(content).Should(ContainSubstring("RunSpecs")) - - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`)) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`)) - - session = startGinkgo(pkgPath, "bootstrap") - Eventually(session).Should(gexec.Exit(1)) - output = session.Out.Contents() - Ω(output).Should(ContainSubstring("foo_suite_test.go already exists")) - }) - - It("should import nodot declarations when told to", func() { - session := startGinkgo(pkgPath, "bootstrap", "--nodot") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_suite_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_test")) - Ω(content).Should(ContainSubstring("func TestFoo(t *testing.T) {")) - Ω(content).Should(ContainSubstring("RegisterFailHandler")) - Ω(content).Should(ContainSubstring("RunSpecs")) - - Ω(content).Should(ContainSubstring("var It = ginkgo.It")) - Ω(content).Should(ContainSubstring("var Ω = gomega.Ω")) - - Ω(content).Should(ContainSubstring("\t" + `"github.com/onsi/ginkgo"`)) - Ω(content).Should(ContainSubstring("\t" + `"github.com/onsi/gomega"`)) - }) - - It("should generate an agouti bootstrap file when told to", func() { - session := startGinkgo(pkgPath, "bootstrap", "--agouti") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_suite_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_test")) - Ω(content).Should(ContainSubstring("func TestFoo(t *testing.T) {")) - Ω(content).Should(ContainSubstring("RegisterFailHandler")) - Ω(content).Should(ContainSubstring("RunSpecs")) - - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`)) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`)) - Ω(content).Should(ContainSubstring("\t" + `"github.com/sclevine/agouti"`)) - }) - - It("should generate a bootstrap file using a template when told to", func() { - templateFile := filepath.Join(pkgPath, ".bootstrap") - ioutil.WriteFile(templateFile, []byte(`package {{.Package}} - - import ( - {{.GinkgoImport}} - {{.GomegaImport}} - - "testing" - "binary" - ) - - func Test{{.FormattedName}}(t *testing.T) { - // This is a {{.Package}} test - }`), 0666) - session := startGinkgo(pkgPath, "bootstrap", "--template", templateFile) - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_suite_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_test")) - Ω(content).Should(ContainSubstring(`. "github.com/onsi/ginkgo"`)) - Ω(content).Should(ContainSubstring(`. "github.com/onsi/gomega"`)) - Ω(content).Should(ContainSubstring(`"binary"`)) - Ω(content).Should(ContainSubstring("// This is a foo_test test")) - }) - }) - - Describe("nodot", func() { - It("should update the declarations in the bootstrap file", func() { - pkgPath := tmpPath("foo") - os.Mkdir(pkgPath, 0777) - - session := startGinkgo(pkgPath, "bootstrap", "--nodot") - Eventually(session).Should(gexec.Exit(0)) - - byteContent, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - - content := string(byteContent) - content = strings.Replace(content, "var It =", "var MyIt =", -1) - content = strings.Replace(content, "var Ω = gomega.Ω\n", "", -1) - - err = ioutil.WriteFile(filepath.Join(pkgPath, "foo_suite_test.go"), []byte(content), os.ModePerm) - Ω(err).ShouldNot(HaveOccurred()) - - session = startGinkgo(pkgPath, "nodot") - Eventually(session).Should(gexec.Exit(0)) - - byteContent, err = ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - - Ω(byteContent).Should(ContainSubstring("var MyIt = ginkgo.It")) - Ω(byteContent).ShouldNot(ContainSubstring("var It = ginkgo.It")) - Ω(byteContent).Should(ContainSubstring("var Ω = gomega.Ω")) - }) - }) - - Describe("ginkgo generate", func() { - var pkgPath string - - BeforeEach(func() { - pkgPath = tmpPath("foo_bar") - os.Mkdir(pkgPath, 0777) - }) - - Context("with no arguments", func() { - It("should generate a test file named after the package", func() { - session := startGinkgo(pkgPath, "generate") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_bar_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_bar_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("FooBar", func() {`)) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`)) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`)) - - session = startGinkgo(pkgPath, "generate") - Eventually(session).Should(gexec.Exit(1)) - output = session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_bar_test.go already exists")) - }) - }) - - Context("with an argument of the form: foo", func() { - It("should generate a test file named after the argument", func() { - session := startGinkgo(pkgPath, "generate", "baz_buzz") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("baz_buzz_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`)) - }) - }) - - Context("with an argument of the form: foo.go", func() { - It("should generate a test file named after the argument", func() { - session := startGinkgo(pkgPath, "generate", "baz_buzz.go") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("baz_buzz_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`)) - - }) - }) - - Context("with an argument of the form: foo_test", func() { - It("should generate a test file named after the argument", func() { - session := startGinkgo(pkgPath, "generate", "baz_buzz_test") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("baz_buzz_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`)) - }) - }) - - Context("with an argument of the form: foo-test", func() { - It("should generate a test file named after the argument", func() { - session := startGinkgo(pkgPath, "generate", "baz-buzz-test") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("baz_buzz_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`)) - }) - }) - - Context("with an argument of the form: foo_test.go", func() { - It("should generate a test file named after the argument", func() { - session := startGinkgo(pkgPath, "generate", "baz_buzz_test.go") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("baz_buzz_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`)) - }) - }) - - Context("with multiple arguments", func() { - It("should generate a test file named after the argument", func() { - session := startGinkgo(pkgPath, "generate", "baz", "buzz") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("baz_test.go")) - Ω(output).Should(ContainSubstring("buzz_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("Baz", func() {`)) - - content, err = ioutil.ReadFile(filepath.Join(pkgPath, "buzz_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring(`var _ = Describe("Buzz", func() {`)) - }) - }) - - Context("with nodot", func() { - It("should not import ginkgo or gomega", func() { - session := startGinkgo(pkgPath, "generate", "--nodot") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_bar_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_bar_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).ShouldNot(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`)) - Ω(content).ShouldNot(ContainSubstring("\t" + `. "github.com/onsi/gomega"`)) - }) - }) - - Context("with agouti", func() { - It("should generate an agouti test file", func() { - session := startGinkgo(pkgPath, "generate", "--agouti") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("foo_bar_test.go")) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_bar_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package foo_bar_test")) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`)) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`)) - Ω(content).Should(ContainSubstring("\t" + `. "github.com/sclevine/agouti/matchers"`)) - Ω(content).Should(ContainSubstring("\t" + `"github.com/sclevine/agouti"`)) - Ω(content).Should(ContainSubstring("page, err = agoutiDriver.NewPage()")) - }) - }) - }) - - Describe("ginkgo bootstrap/generate", func() { - var pkgPath string - BeforeEach(func() { - pkgPath = tmpPath("some crazy-thing") - os.Mkdir(pkgPath, 0777) - }) - - Context("when the working directory is empty", func() { - It("generates correctly named bootstrap and generate files with a package name derived from the directory", func() { - session := startGinkgo(pkgPath, "bootstrap") - Eventually(session).Should(gexec.Exit(0)) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package some_crazy_thing_test")) - Ω(content).Should(ContainSubstring("SomeCrazyThing Suite")) - - session = startGinkgo(pkgPath, "generate") - Eventually(session).Should(gexec.Exit(0)) - - content, err = ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package some_crazy_thing_test")) - Ω(content).Should(ContainSubstring("SomeCrazyThing")) - }) - }) - - Context("when the working directory contains a file with a package name", func() { - BeforeEach(func() { - Ω(ioutil.WriteFile(filepath.Join(pkgPath, "foo.go"), []byte("package main\n\nfunc main() {}"), 0777)).Should(Succeed()) - }) - - It("generates correctly named bootstrap and generate files with the package name", func() { - session := startGinkgo(pkgPath, "bootstrap") - Eventually(session).Should(gexec.Exit(0)) - - content, err := ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_suite_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package main_test")) - Ω(content).Should(ContainSubstring("SomeCrazyThing Suite")) - - session = startGinkgo(pkgPath, "generate") - Eventually(session).Should(gexec.Exit(0)) - - content, err = ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_test.go")) - Ω(err).ShouldNot(HaveOccurred()) - Ω(content).Should(ContainSubstring("package main_test")) - Ω(content).Should(ContainSubstring("SomeCrazyThing")) - }) - }) - }) - - Describe("ginkgo blur", func() { - It("should unfocus tests", func() { - pathToTest := tmpPath("focused") - fixture := fixturePath("focused_fixture") - copyIn(fixture, pathToTest, false) - - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE)) - output := session.Out.Contents() - - Ω(string(output)).Should(ContainSubstring("8 Passed")) - Ω(string(output)).Should(ContainSubstring("5 Skipped")) - - session = startGinkgo(pathToTest, "blur") - Eventually(session).Should(gexec.Exit(0)) - output = session.Out.Contents() - Ω(string(output)).ShouldNot(ContainSubstring("expected 'package'")) - - session = startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output = session.Out.Contents() - Ω(string(output)).Should(ContainSubstring("13 Passed")) - Ω(string(output)).Should(ContainSubstring("0 Skipped")) - - Expect(sameFile(filepath.Join(pathToTest, "README.md"), filepath.Join(fixture, "README.md"))).To(BeTrue()) - }) - - It("should ignore the 'vendor' folder", func() { - pathToTest := tmpPath("focused_fixture_with_vendor") - copyIn(fixturePath("focused_fixture_with_vendor"), pathToTest, true) - - session := startGinkgo(pathToTest, "blur") - Eventually(session).Should(gexec.Exit(0)) - - session = startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - Expect(string(output)).To(ContainSubstring("13 Passed")) - Expect(string(output)).To(ContainSubstring("0 Skipped")) - - vendorPath := fixturePath("focused_fixture_with_vendor/vendor") - otherVendorPath := filepath.Join(pathToTest, "vendor") - - Expect(sameFolder(vendorPath, otherVendorPath)).To(BeTrue()) - }) - }) - - Describe("ginkgo version", func() { - It("should print out the version info", func() { - session := startGinkgo("", "version") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(MatchRegexp(`Ginkgo Version \d+\.\d+\.\d+`)) - }) - }) - - Describe("ginkgo help", func() { - It("should print out usage information", func() { - session := startGinkgo("", "help") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(MatchRegexp(`Ginkgo Version \d+\.\d+\.\d+`)) - Ω(output).Should(ContainSubstring("ginkgo watch")) - Ω(output).Should(ContainSubstring("-succinct")) - Ω(output).Should(ContainSubstring("-nodes")) - Ω(output).Should(ContainSubstring("ginkgo generate")) - Ω(output).Should(ContainSubstring("ginkgo help ")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go deleted file mode 100644 index 4aec1bc..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package integration_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Suite Command Specs", func() { - var pathToTest string - - BeforeEach(func() { - pathToTest = tmpPath("suite_command") - copyIn(fixturePath("suite_command_tests"), pathToTest, false) - }) - - It("Runs command after suite echoing out suite data, properly reporting suite name and passing status in successful command output", func() { - command := "-afterSuiteHook=echo THIS IS A (ginkgo-suite-passed) TEST OF THE (ginkgo-suite-name) SYSTEM, THIS IS ONLY A TEST" - expected := "THIS IS A [PASS] TEST OF THE suite_command SYSTEM, THIS IS ONLY A TEST" - session := startGinkgo(pathToTest, command) - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("1 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - Ω(output).Should(ContainSubstring("1 Pending")) - Ω(output).Should(ContainSubstring("0 Skipped")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - Ω(output).Should(ContainSubstring("Post-suite command succeeded:")) - Ω(output).Should(ContainSubstring(expected)) - }) - - It("Runs command after suite reporting that command failed", func() { - command := "-afterSuiteHook=exit 1" - session := startGinkgo(pathToTest, command) - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("1 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - Ω(output).Should(ContainSubstring("1 Pending")) - Ω(output).Should(ContainSubstring("0 Skipped")) - Ω(output).Should(ContainSubstring("Test Suite Passed")) - Ω(output).Should(ContainSubstring("Post-suite command failed:")) - }) - - It("Runs command after suite echoing out suite data, properly reporting suite name and failing status in successful command output", func() { - command := "-afterSuiteHook=echo THIS IS A (ginkgo-suite-passed) TEST OF THE (ginkgo-suite-name) SYSTEM, THIS IS ONLY A TEST" - expected := "THIS IS A [FAIL] TEST OF THE suite_command SYSTEM, THIS IS ONLY A TEST" - session := startGinkgo(pathToTest, "-failOnPending=true", command) - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("1 Passed")) - Ω(output).Should(ContainSubstring("0 Failed")) - Ω(output).Should(ContainSubstring("1 Pending")) - Ω(output).Should(ContainSubstring("0 Skipped")) - Ω(output).Should(ContainSubstring("Test Suite Failed")) - Ω(output).Should(ContainSubstring("Post-suite command succeeded:")) - Ω(output).Should(ContainSubstring(expected)) - }) - -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go deleted file mode 100644 index 33ff5b9..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go +++ /dev/null @@ -1,178 +0,0 @@ -package integration_test - -import ( - "strings" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("SuiteSetup", func() { - var pathToTest string - - Context("when the BeforeSuite and AfterSuite pass", func() { - BeforeEach(func() { - pathToTest = tmpPath("suite_setup") - copyIn(fixturePath("passing_suite_setup"), pathToTest, false) - }) - - It("should run the BeforeSuite once, then run all the tests", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(1)) - Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(1)) - }) - - It("should run the BeforeSuite once per parallel node, then run all the tests", func() { - session := startGinkgo(pathToTest, "--noColor", "--nodes=2") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(2)) - Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(2)) - }) - }) - - Context("when the BeforeSuite fails", func() { - BeforeEach(func() { - pathToTest = tmpPath("suite_setup") - copyIn(fixturePath("failing_before_suite"), pathToTest, false) - }) - - It("should run the BeforeSuite once, none of the tests, but it should run the AfterSuite", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(1)) - Ω(strings.Count(output, "Test Panicked")).Should(Equal(1)) - Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(1)) - Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS")) - }) - - It("should run the BeforeSuite once per parallel node, none of the tests, but it should run the AfterSuite for each node", func() { - session := startGinkgo(pathToTest, "--noColor", "--nodes=2") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(2)) - Ω(strings.Count(output, "Test Panicked")).Should(Equal(2)) - Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(2)) - Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS")) - }) - }) - - Context("when the AfterSuite fails", func() { - BeforeEach(func() { - pathToTest = tmpPath("suite_setup") - copyIn(fixturePath("failing_after_suite"), pathToTest, false) - }) - - It("should run the BeforeSuite once, none of the tests, but it should run the AfterSuite", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(1)) - Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(1)) - Ω(strings.Count(output, "Test Panicked")).Should(Equal(1)) - Ω(strings.Count(output, "A TEST")).Should(Equal(2)) - }) - - It("should run the BeforeSuite once per parallel node, none of the tests, but it should run the AfterSuite for each node", func() { - session := startGinkgo(pathToTest, "--noColor", "--nodes=2") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(2)) - Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(2)) - Ω(strings.Count(output, "Test Panicked")).Should(Equal(2)) - Ω(strings.Count(output, "A TEST")).Should(Equal(2)) - }) - }) - - Context("With passing synchronized before and after suites", func() { - BeforeEach(func() { - pathToTest = tmpPath("suite_setup") - copyIn(fixturePath("synchronized_setup_tests"), pathToTest, false) - }) - - Context("when run with one node", func() { - It("should do all the work on that one node", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("BEFORE_A_1\nBEFORE_B_1: DATA")) - Ω(output).Should(ContainSubstring("AFTER_A_1\nAFTER_B_1")) - }) - }) - - Context("when run across multiple nodes", func() { - It("should run the first BeforeSuite function (BEFORE_A) on node 1, the second (BEFORE_B) on all the nodes, the first AfterSuite (AFTER_A) on all the nodes, and then the second (AFTER_B) on Node 1 *after* everything else is finished", func() { - session := startGinkgo(pathToTest, "--noColor", "--nodes=3") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("BEFORE_A_1")) - Ω(output).Should(ContainSubstring("BEFORE_B_1: DATA")) - Ω(output).Should(ContainSubstring("BEFORE_B_2: DATA")) - Ω(output).Should(ContainSubstring("BEFORE_B_3: DATA")) - - Ω(output).ShouldNot(ContainSubstring("BEFORE_A_2")) - Ω(output).ShouldNot(ContainSubstring("BEFORE_A_3")) - - Ω(output).Should(ContainSubstring("AFTER_A_1")) - Ω(output).Should(ContainSubstring("AFTER_A_2")) - Ω(output).Should(ContainSubstring("AFTER_A_3")) - Ω(output).Should(ContainSubstring("AFTER_B_1")) - - Ω(output).ShouldNot(ContainSubstring("AFTER_B_2")) - Ω(output).ShouldNot(ContainSubstring("AFTER_B_3")) - }) - }) - - Context("when streaming across multiple nodes", func() { - It("should run the first BeforeSuite function (BEFORE_A) on node 1, the second (BEFORE_B) on all the nodes, the first AfterSuite (AFTER_A) on all the nodes, and then the second (AFTER_B) on Node 1 *after* everything else is finished", func() { - session := startGinkgo(pathToTest, "--noColor", "--nodes=3", "--stream") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("[1] BEFORE_A_1")) - Ω(output).Should(ContainSubstring("[1] BEFORE_B_1: DATA")) - Ω(output).Should(ContainSubstring("[2] BEFORE_B_2: DATA")) - Ω(output).Should(ContainSubstring("[3] BEFORE_B_3: DATA")) - - Ω(output).ShouldNot(ContainSubstring("BEFORE_A_2")) - Ω(output).ShouldNot(ContainSubstring("BEFORE_A_3")) - - Ω(output).Should(ContainSubstring("[1] AFTER_A_1")) - Ω(output).Should(ContainSubstring("[2] AFTER_A_2")) - Ω(output).Should(ContainSubstring("[3] AFTER_A_3")) - Ω(output).Should(ContainSubstring("[1] AFTER_B_1")) - - Ω(output).ShouldNot(ContainSubstring("AFTER_B_2")) - Ω(output).ShouldNot(ContainSubstring("AFTER_B_3")) - }) - }) - }) - - Context("With a failing synchronized before suite", func() { - BeforeEach(func() { - pathToTest = tmpPath("suite_setup") - copyIn(fixturePath("exiting_synchronized_setup_tests"), pathToTest, false) - }) - - It("should fail and let the user know that node 1 disappeared prematurely", func() { - session := startGinkgo(pathToTest, "--noColor", "--nodes=3") - Eventually(session).Should(gexec.Exit(1)) - output := string(session.Out.Contents()) - - Ω(output).Should(ContainSubstring("Node 1 disappeared before completing BeforeSuite")) - Ω(output).Should(ContainSubstring("Ginkgo timed out waiting for all parallel nodes to report back!")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/tags_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/tags_test.go deleted file mode 100644 index fc2ff5e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/tags_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package integration_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Tags", func() { - var pathToTest string - BeforeEach(func() { - pathToTest = tmpPath("tags") - copyIn(fixturePath("tags_tests"), pathToTest, false) - }) - - It("should honor the passed in -tags flag", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := string(session.Out.Contents()) - Ω(output).Should(ContainSubstring("Ran 1 of 1 Specs")) - - session = startGinkgo(pathToTest, "--noColor", "-tags=complex_tests") - Eventually(session).Should(gexec.Exit(0)) - output = string(session.Out.Contents()) - Ω(output).Should(ContainSubstring("Ran 3 of 3 Specs")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/test_description_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/test_description_test.go deleted file mode 100644 index 6739871..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/test_description_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package integration_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("TestDescription", func() { - var pathToTest string - - BeforeEach(func() { - pathToTest = tmpPath("test_description") - copyIn(fixturePath("test_description"), pathToTest, false) - }) - - It("should capture and emit information about the current test", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(1)) - - Ω(session).Should(gbytes.Say("TestDescription should pass:false")) - Ω(session).Should(gbytes.Say("TestDescription should fail:true")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go deleted file mode 100644 index 8238762..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go +++ /dev/null @@ -1,90 +0,0 @@ -package integration_test - -import ( - "regexp" - "runtime" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Verbose And Succinct Mode", func() { - var pathToTest string - var otherPathToTest string - - isWindows := (runtime.GOOS == "windows") - denoter := "•" - - if isWindows { - denoter = "+" - } - - Context("when running one package", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - }) - - It("should default to non-succinct mode", func() { - session := startGinkgo(pathToTest, "--noColor") - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - }) - }) - - Context("when running more than one package", func() { - BeforeEach(func() { - pathToTest = tmpPath("ginkgo") - copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false) - otherPathToTest = tmpPath("more_ginkgo") - copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false) - }) - - Context("with no flags set", func() { - It("should default to succinct mode", func() { - session := startGinkgo(pathToTest, "--noColor", pathToTest, otherPathToTest) - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(MatchRegexp(`\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS!`, regexp.QuoteMeta(denoter))) - Ω(output).Should(MatchRegexp(`\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS!`, regexp.QuoteMeta(denoter))) - }) - }) - - Context("with --succinct=false", func() { - It("should not be in succinct mode", func() { - session := startGinkgo(pathToTest, "--noColor", "--succinct=false", pathToTest, otherPathToTest) - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite")) - }) - }) - - Context("with -v", func() { - It("should not be in succinct mode, but should be verbose", func() { - session := startGinkgo(pathToTest, "--noColor", "-v", pathToTest, otherPathToTest) - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite")) - Ω(output).Should(ContainSubstring("should proxy strings")) - Ω(output).Should(ContainSubstring("should always pass")) - }) - - It("should emit output from Bys", func() { - session := startGinkgo(pathToTest, "--noColor", "-v", pathToTest) - Eventually(session).Should(gexec.Exit(0)) - output := session.Out.Contents() - - Ω(output).Should(ContainSubstring("emitting one By")) - Ω(output).Should(ContainSubstring("emitting another By")) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/watch_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/watch_test.go deleted file mode 100644 index 1d65702..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/integration/watch_test.go +++ /dev/null @@ -1,275 +0,0 @@ -package integration_test - -import ( - "io/ioutil" - "os" - "path/filepath" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/gexec" -) - -var _ = Describe("Watch", func() { - var rootPath string - var pathA string - var pathB string - var pathC string - var session *gexec.Session - - BeforeEach(func() { - rootPath = tmpPath("root") - pathA = filepath.Join(rootPath, "src", "github.com", "onsi", "A") - pathB = filepath.Join(rootPath, "src", "github.com", "onsi", "B") - pathC = filepath.Join(rootPath, "src", "github.com", "onsi", "C") - - err := os.MkdirAll(pathA, 0700) - Ω(err).ShouldNot(HaveOccurred()) - - err = os.MkdirAll(pathB, 0700) - Ω(err).ShouldNot(HaveOccurred()) - - err = os.MkdirAll(pathC, 0700) - Ω(err).ShouldNot(HaveOccurred()) - - copyIn(fixturePath(filepath.Join("watch_fixtures", "A")), pathA, false) - copyIn(fixturePath(filepath.Join("watch_fixtures", "B")), pathB, false) - copyIn(fixturePath(filepath.Join("watch_fixtures", "C")), pathC, false) - }) - - startGinkgoWithGopath := func(args ...string) *gexec.Session { - cmd := ginkgoCommand(rootPath, args...) - os.Setenv("GOPATH", rootPath+":"+os.Getenv("GOPATH")) - session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter) - Ω(err).ShouldNot(HaveOccurred()) - return session - } - - modifyFile := func(path string) { - time.Sleep(time.Second) - content, err := ioutil.ReadFile(path) - Ω(err).ShouldNot(HaveOccurred()) - content = append(content, []byte("//")...) - err = ioutil.WriteFile(path, content, 0666) - Ω(err).ShouldNot(HaveOccurred()) - } - - modifyCode := func(pkgToModify string) { - modifyFile(filepath.Join(rootPath, "src", "github.com", "onsi", pkgToModify, pkgToModify+".go")) - } - - modifyJSON := func(pkgToModify string) { - modifyFile(filepath.Join(rootPath, "src", "github.com", "onsi", pkgToModify, pkgToModify+".json")) - } - - modifyTest := func(pkgToModify string) { - modifyFile(filepath.Join(rootPath, "src", "github.com", "onsi", pkgToModify, pkgToModify+"_test.go")) - } - - AfterEach(func() { - if session != nil { - session.Kill().Wait() - } - }) - - It("should be set up correctly", func() { - session = startGinkgoWithGopath("-r") - Eventually(session).Should(gexec.Exit(0)) - Ω(session.Out.Contents()).Should(ContainSubstring("A Suite")) - Ω(session.Out.Contents()).Should(ContainSubstring("B Suite")) - Ω(session.Out.Contents()).Should(ContainSubstring("C Suite")) - Ω(session.Out.Contents()).Should(ContainSubstring("Ginkgo ran 3 suites")) - }) - - Context("when watching just one test suite", func() { - It("should immediately run, and should rerun when the test suite changes", func() { - session = startGinkgoWithGopath("watch", "-succinct", pathA) - Eventually(session).Should(gbytes.Say("A Suite")) - modifyCode("A") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("A Suite")) - session.Kill().Wait() - }) - }) - - Context("when watching several test suites", func() { - It("should not immediately run, but should rerun a test when its code changes", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r") - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite|C Suite")) - modifyCode("A") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite")) - session.Kill().Wait() - }) - }) - - Describe("watching dependencies", func() { - Context("with a depth of 2", func() { - It("should watch down to that depth", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2") - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`)) - Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`)) - - modifyCode("A") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite")) - - modifyCode("B") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("B Suite")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("C Suite")) - - modifyCode("C") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("C Suite")) - Eventually(session).Should(gbytes.Say("B Suite")) - Eventually(session).Should(gbytes.Say("A Suite")) - }) - }) - - Context("with a depth of 1", func() { - It("should watch down to that depth", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=1") - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Eventually(session).Should(gbytes.Say(`A \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`)) - - modifyCode("A") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite")) - - modifyCode("B") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("B Suite")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("C Suite")) - - modifyCode("C") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("C Suite")) - Eventually(session).Should(gbytes.Say("B Suite")) - Consistently(session).ShouldNot(gbytes.Say("A Suite")) - }) - }) - - Context("with a depth of 0", func() { - It("should not watch any dependencies", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=0") - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Eventually(session).Should(gbytes.Say(`A \[0 dependencies\]`)) - Eventually(session).Should(gbytes.Say(`B \[0 dependencies\]`)) - Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`)) - - modifyCode("A") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite")) - - modifyCode("B") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("B Suite")) - Consistently(session).ShouldNot(gbytes.Say("A Suite|C Suite")) - - modifyCode("C") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("C Suite")) - Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite")) - }) - }) - - It("should not trigger dependents when tests are changed", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2") - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`)) - Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`)) - - modifyTest("A") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("A Suite")) - Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite")) - - modifyTest("B") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("B Suite")) - Consistently(session).ShouldNot(gbytes.Say("A Suite|C Suite")) - - modifyTest("C") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("C Suite")) - Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite")) - }) - }) - - Describe("adjusting the watch regular expression", func() { - Describe("the default regular expression", func() { - It("should only trigger when go files are changed", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2") - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`)) - Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`)) - - modifyJSON("C") - Consistently(session).ShouldNot(gbytes.Say("Detected changes in")) - Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite|C Suite")) - }) - }) - - Describe("modifying the regular expression", func() { - It("should trigger if the regexp matches", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2", `-watchRegExp=\.json$`) - Eventually(session).Should(gbytes.Say("Identified 3 test suites")) - Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`)) - Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`)) - - modifyJSON("C") - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("C Suite")) - Eventually(session).Should(gbytes.Say("B Suite")) - Eventually(session).Should(gbytes.Say("A Suite")) - }) - }) - }) - - Describe("when new test suite is added", func() { - It("should start monitoring that test suite", func() { - session = startGinkgoWithGopath("watch", "-succinct", "-r") - - Eventually(session).Should(gbytes.Say("Watching 3 suites")) - - pathD := filepath.Join(rootPath, "src", "github.com", "onsi", "D") - - err := os.MkdirAll(pathD, 0700) - Ω(err).ShouldNot(HaveOccurred()) - - copyIn(fixturePath(filepath.Join("watch_fixtures", "D")), pathD, false) - - Eventually(session).Should(gbytes.Say("Detected 1 new suite")) - Eventually(session).Should(gbytes.Say(`D \[1 dependency\]`)) - Eventually(session).Should(gbytes.Say("D Suite")) - - modifyCode("D") - - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("D Suite")) - - modifyCode("C") - - Eventually(session).Should(gbytes.Say("Detected changes in")) - Eventually(session).Should(gbytes.Say("C Suite")) - Eventually(session).Should(gbytes.Say("D Suite")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go deleted file mode 100644 index f06abf3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package codelocation_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestCodelocation(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "CodeLocation Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go deleted file mode 100644 index cca75a4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go +++ /dev/null @@ -1,80 +0,0 @@ -package codelocation_test - -import ( - "runtime" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" -) - -var _ = Describe("CodeLocation", func() { - var ( - codeLocation types.CodeLocation - expectedFileName string - expectedLineNumber int - ) - - caller0 := func() { - codeLocation = codelocation.New(1) - } - - caller1 := func() { - _, expectedFileName, expectedLineNumber, _ = runtime.Caller(0) - expectedLineNumber += 2 - caller0() - } - - BeforeEach(func() { - caller1() - }) - - It("should use the passed in skip parameter to pick out the correct file & line number", func() { - Ω(codeLocation.FileName).Should(Equal(expectedFileName)) - Ω(codeLocation.LineNumber).Should(Equal(expectedLineNumber)) - }) - - Describe("stringer behavior", func() { - It("should stringify nicely", func() { - Ω(codeLocation.String()).Should(ContainSubstring("code_location_test.go:%d", expectedLineNumber)) - }) - }) - - //There's no better way than to test this private method as it - //goes out of its way to prune out ginkgo related code in the stack trace - Describe("PruneStack", func() { - It("should remove any references to ginkgo and pkg/testing and pkg/runtime", func() { - input := `/Skip/me -Skip: skip() -/Skip/me -Skip: skip() -/Users/whoever/gospace/src/github.com/onsi/ginkgo/whatever.go:10 (0x12314) -Something: Func() -/Users/whoever/gospace/src/github.com/onsi/ginkgo/whatever_else.go:10 (0x12314) -SomethingInternalToGinkgo: Func() -/usr/goroot/pkg/strings/oops.go:10 (0x12341) -Oops: BlowUp() -/Users/whoever/gospace/src/mycode/code.go:10 (0x12341) -MyCode: Func() -/Users/whoever/gospace/src/mycode/code_test.go:10 (0x12341) -MyCodeTest: Func() -/Users/whoever/gospace/src/mycode/code_suite_test.go:12 (0x37f08) -TestFoo: RunSpecs(t, "Foo Suite") -/usr/goroot/pkg/testing/testing.go:12 (0x37f08) -TestingT: Blah() -/usr/goroot/pkg/runtime/runtime.go:12 (0x37f08) -Something: Func() -` - prunedStack := codelocation.PruneStack(input, 1) - Ω(prunedStack).Should(Equal(`/usr/goroot/pkg/strings/oops.go:10 (0x12341) -Oops: BlowUp() -/Users/whoever/gospace/src/mycode/code.go:10 (0x12341) -MyCode: Func() -/Users/whoever/gospace/src/mycode/code_test.go:10 (0x12341) -MyCodeTest: Func() -/Users/whoever/gospace/src/mycode/code_suite_test.go:12 (0x37f08) -TestFoo: RunSpecs(t, "Foo Suite")`)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go deleted file mode 100644 index c6fc314..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package containernode_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestContainernode(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Containernode Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go deleted file mode 100644 index 11ac9b7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go +++ /dev/null @@ -1,213 +0,0 @@ -package containernode_test - -import ( - "math/rand" - - "github.com/onsi/ginkgo/internal/leafnodes" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "github.com/onsi/ginkgo/internal/codelocation" - . "github.com/onsi/ginkgo/internal/containernode" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("Container Node", func() { - var ( - codeLocation types.CodeLocation - container *ContainerNode - ) - - BeforeEach(func() { - codeLocation = codelocation.New(0) - container = New("description text", types.FlagTypeFocused, codeLocation) - }) - - Describe("creating a container node", func() { - It("can answer questions about itself", func() { - Ω(container.Text()).Should(Equal("description text")) - Ω(container.Flag()).Should(Equal(types.FlagTypeFocused)) - Ω(container.CodeLocation()).Should(Equal(codeLocation)) - }) - }) - - Describe("pushing setup nodes", func() { - It("can append setup nodes of various types and fetch them by type", func() { - befA := leafnodes.NewBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0) - befB := leafnodes.NewBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0) - aftA := leafnodes.NewAfterEachNode(func() {}, codelocation.New(0), 0, nil, 0) - aftB := leafnodes.NewAfterEachNode(func() {}, codelocation.New(0), 0, nil, 0) - jusBefA := leafnodes.NewJustBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0) - jusBefB := leafnodes.NewJustBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0) - - container.PushSetupNode(befA) - container.PushSetupNode(befB) - container.PushSetupNode(aftA) - container.PushSetupNode(aftB) - container.PushSetupNode(jusBefA) - container.PushSetupNode(jusBefB) - - subject := leafnodes.NewItNode("subject", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - container.PushSubjectNode(subject) - - Ω(container.SetupNodesOfType(types.SpecComponentTypeBeforeEach)).Should(Equal([]leafnodes.BasicNode{befA, befB})) - Ω(container.SetupNodesOfType(types.SpecComponentTypeAfterEach)).Should(Equal([]leafnodes.BasicNode{aftA, aftB})) - Ω(container.SetupNodesOfType(types.SpecComponentTypeJustBeforeEach)).Should(Equal([]leafnodes.BasicNode{jusBefA, jusBefB})) - Ω(container.SetupNodesOfType(types.SpecComponentTypeIt)).Should(BeEmpty()) //subjects are not setup nodes - }) - }) - - Context("With appended containers and subject nodes", func() { - var ( - itA, itB, innerItA, innerItB leafnodes.SubjectNode - innerContainer *ContainerNode - ) - - BeforeEach(func() { - itA = leafnodes.NewItNode("Banana", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - itB = leafnodes.NewItNode("Apple", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - - innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - innerItB = leafnodes.NewItNode("inner B", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - - innerContainer = New("Orange", types.FlagTypeNone, codelocation.New(0)) - - container.PushSubjectNode(itA) - container.PushContainerNode(innerContainer) - innerContainer.PushSubjectNode(innerItA) - innerContainer.PushSubjectNode(innerItB) - container.PushSubjectNode(itB) - }) - - Describe("Collating", func() { - It("should return a collated set of containers and subject nodes in the correct order", func() { - collated := container.Collate() - Ω(collated).Should(HaveLen(4)) - - Ω(collated[0]).Should(Equal(CollatedNodes{ - Containers: []*ContainerNode{container}, - Subject: itA, - })) - - Ω(collated[1]).Should(Equal(CollatedNodes{ - Containers: []*ContainerNode{container, innerContainer}, - Subject: innerItA, - })) - - Ω(collated[2]).Should(Equal(CollatedNodes{ - Containers: []*ContainerNode{container, innerContainer}, - Subject: innerItB, - })) - - Ω(collated[3]).Should(Equal(CollatedNodes{ - Containers: []*ContainerNode{container}, - Subject: itB, - })) - }) - }) - - Describe("Backpropagating Programmatic Focus", func() { - //This allows inner focused specs to override the focus of outer focussed - //specs and more closely maps to what a developer wants to happen - //when debugging a test suite - - Context("when a parent is focused *and* an inner subject is focused", func() { - BeforeEach(func() { - container = New("description text", types.FlagTypeFocused, codeLocation) - itA = leafnodes.NewItNode("A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - container.PushSubjectNode(itA) - - innerContainer = New("Orange", types.FlagTypeNone, codelocation.New(0)) - container.PushContainerNode(innerContainer) - innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeFocused, codelocation.New(0), 0, nil, 0) - innerContainer.PushSubjectNode(innerItA) - }) - - It("should unfocus the parent", func() { - container.BackPropagateProgrammaticFocus() - - Ω(container.Flag()).Should(Equal(types.FlagTypeNone)) - Ω(itA.Flag()).Should(Equal(types.FlagTypeNone)) - Ω(innerContainer.Flag()).Should(Equal(types.FlagTypeNone)) - Ω(innerItA.Flag()).Should(Equal(types.FlagTypeFocused)) - }) - }) - - Context("when a parent is focused *and* an inner container is focused", func() { - BeforeEach(func() { - container = New("description text", types.FlagTypeFocused, codeLocation) - itA = leafnodes.NewItNode("A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - container.PushSubjectNode(itA) - - innerContainer = New("Orange", types.FlagTypeFocused, codelocation.New(0)) - container.PushContainerNode(innerContainer) - innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - innerContainer.PushSubjectNode(innerItA) - }) - - It("should unfocus the parent", func() { - container.BackPropagateProgrammaticFocus() - - Ω(container.Flag()).Should(Equal(types.FlagTypeNone)) - Ω(itA.Flag()).Should(Equal(types.FlagTypeNone)) - Ω(innerContainer.Flag()).Should(Equal(types.FlagTypeFocused)) - Ω(innerItA.Flag()).Should(Equal(types.FlagTypeNone)) - }) - }) - - Context("when a parent is pending and a child is focused", func() { - BeforeEach(func() { - container = New("description text", types.FlagTypeFocused, codeLocation) - itA = leafnodes.NewItNode("A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0) - container.PushSubjectNode(itA) - - innerContainer = New("Orange", types.FlagTypePending, codelocation.New(0)) - container.PushContainerNode(innerContainer) - innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeFocused, codelocation.New(0), 0, nil, 0) - innerContainer.PushSubjectNode(innerItA) - }) - - It("should not do anything", func() { - container.BackPropagateProgrammaticFocus() - - Ω(container.Flag()).Should(Equal(types.FlagTypeFocused)) - Ω(itA.Flag()).Should(Equal(types.FlagTypeNone)) - Ω(innerContainer.Flag()).Should(Equal(types.FlagTypePending)) - Ω(innerItA.Flag()).Should(Equal(types.FlagTypeFocused)) - }) - }) - }) - - Describe("Shuffling", func() { - var unshuffledCollation []CollatedNodes - BeforeEach(func() { - unshuffledCollation = container.Collate() - - r := rand.New(rand.NewSource(17)) - container.Shuffle(r) - }) - - It("should sort, and then shuffle, the top level contents of the container", func() { - shuffledCollation := container.Collate() - Ω(shuffledCollation).Should(HaveLen(len(unshuffledCollation))) - Ω(shuffledCollation).ShouldNot(Equal(unshuffledCollation)) - - for _, entry := range unshuffledCollation { - Ω(shuffledCollation).Should(ContainElement(entry)) - } - - innerAIndex, innerBIndex := 0, 0 - for i, entry := range shuffledCollation { - if entry.Subject == innerItA { - innerAIndex = i - } else if entry.Subject == innerItB { - innerBIndex = i - } - } - - Ω(innerAIndex).Should(Equal(innerBIndex - 1)) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go deleted file mode 100644 index 8dce7be..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package failer_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFailer(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Failer Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go deleted file mode 100644 index 65210a4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package failer_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/failer" - . "github.com/onsi/gomega" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("Failer", func() { - var ( - failer *Failer - codeLocationA types.CodeLocation - codeLocationB types.CodeLocation - ) - - BeforeEach(func() { - codeLocationA = codelocation.New(0) - codeLocationB = codelocation.New(0) - failer = New() - }) - - Context("with no failures", func() { - It("should return success when drained", func() { - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - Ω(failure).Should(BeZero()) - Ω(state).Should(Equal(types.SpecStatePassed)) - }) - }) - - Describe("Skip", func() { - It("should handle failures", func() { - failer.Skip("something skipped", codeLocationA) - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "something skipped", - Location: codeLocationA, - ForwardedPanic: "", - ComponentType: types.SpecComponentTypeIt, - ComponentIndex: 3, - ComponentCodeLocation: codeLocationB, - })) - Ω(state).Should(Equal(types.SpecStateSkipped)) - }) - }) - - Describe("Fail", func() { - It("should handle failures", func() { - failer.Fail("something failed", codeLocationA) - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "something failed", - Location: codeLocationA, - ForwardedPanic: "", - ComponentType: types.SpecComponentTypeIt, - ComponentIndex: 3, - ComponentCodeLocation: codeLocationB, - })) - Ω(state).Should(Equal(types.SpecStateFailed)) - }) - }) - - Describe("Panic", func() { - It("should handle panics", func() { - failer.Panic(codeLocationA, "some forwarded panic") - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "Test Panicked", - Location: codeLocationA, - ForwardedPanic: "some forwarded panic", - ComponentType: types.SpecComponentTypeIt, - ComponentIndex: 3, - ComponentCodeLocation: codeLocationB, - })) - Ω(state).Should(Equal(types.SpecStatePanicked)) - }) - }) - - Describe("Timeout", func() { - It("should handle timeouts", func() { - failer.Timeout(codeLocationA) - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "Timed out", - Location: codeLocationA, - ForwardedPanic: "", - ComponentType: types.SpecComponentTypeIt, - ComponentIndex: 3, - ComponentCodeLocation: codeLocationB, - })) - Ω(state).Should(Equal(types.SpecStateTimedOut)) - }) - }) - - Context("when multiple failures are registered", func() { - BeforeEach(func() { - failer.Fail("something failed", codeLocationA) - failer.Fail("something else failed", codeLocationA) - }) - - It("should only report the first one when drained", func() { - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "something failed", - Location: codeLocationA, - ForwardedPanic: "", - ComponentType: types.SpecComponentTypeIt, - ComponentIndex: 3, - ComponentCodeLocation: codeLocationB, - })) - Ω(state).Should(Equal(types.SpecStateFailed)) - }) - - It("should report subsequent failures after being drained", func() { - failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - failer.Fail("yet another thing failed", codeLocationA) - - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "yet another thing failed", - Location: codeLocationA, - ForwardedPanic: "", - ComponentType: types.SpecComponentTypeIt, - ComponentIndex: 3, - ComponentCodeLocation: codeLocationB, - })) - Ω(state).Should(Equal(types.SpecStateFailed)) - }) - - It("should report sucess on subsequent drains if no errors occur", func() { - failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB) - Ω(failure).Should(BeZero()) - Ω(state).Should(Equal(types.SpecStatePassed)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go deleted file mode 100644 index 29fa0c6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/leafnodes" - . "github.com/onsi/gomega" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("It Nodes", func() { - It("should report the correct type, text, flag, and code location", func() { - codeLocation := codelocation.New(0) - it := NewItNode("my it node", func() {}, types.FlagTypeFocused, codeLocation, 0, nil, 3) - Ω(it.Type()).Should(Equal(types.SpecComponentTypeIt)) - Ω(it.Flag()).Should(Equal(types.FlagTypeFocused)) - Ω(it.Text()).Should(Equal("my it node")) - Ω(it.CodeLocation()).Should(Equal(codeLocation)) - Ω(it.Samples()).Should(Equal(1)) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go deleted file mode 100644 index a7ba9e0..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestLeafNode(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "LeafNode Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go deleted file mode 100644 index 1cd1333..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go +++ /dev/null @@ -1,155 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/leafnodes" - . "github.com/onsi/gomega" - - "time" - - "github.com/onsi/ginkgo/internal/codelocation" - Failer "github.com/onsi/ginkgo/internal/failer" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("Measure Nodes", func() { - It("should report the correct type, text, flag, and code location", func() { - codeLocation := codelocation.New(0) - measure := NewMeasureNode("my measure node", func(b Benchmarker) {}, types.FlagTypeFocused, codeLocation, 10, nil, 3) - Ω(measure.Type()).Should(Equal(types.SpecComponentTypeMeasure)) - Ω(measure.Flag()).Should(Equal(types.FlagTypeFocused)) - Ω(measure.Text()).Should(Equal("my measure node")) - Ω(measure.CodeLocation()).Should(Equal(codeLocation)) - Ω(measure.Samples()).Should(Equal(10)) - }) - - Describe("benchmarking", func() { - var measure *MeasureNode - - Describe("Value", func() { - BeforeEach(func() { - measure = NewMeasureNode("the measurement", func(b Benchmarker) { - b.RecordValue("foo", 7, "info!") - b.RecordValue("foo", 2) - b.RecordValue("foo", 3) - b.RecordValue("bar", 0.3) - b.RecordValue("bar", 0.1) - b.RecordValue("bar", 0.5) - b.RecordValue("bar", 0.7) - }, types.FlagTypeFocused, codelocation.New(0), 1, Failer.New(), 3) - Ω(measure.Run()).Should(Equal(types.SpecStatePassed)) - }) - - It("records passed in values and reports on them", func() { - report := measure.MeasurementsReport() - Ω(report).Should(HaveLen(2)) - Ω(report["foo"].Name).Should(Equal("foo")) - Ω(report["foo"].Info).Should(Equal("info!")) - Ω(report["foo"].Order).Should(Equal(0)) - Ω(report["foo"].SmallestLabel).Should(Equal("Smallest")) - Ω(report["foo"].LargestLabel).Should(Equal(" Largest")) - Ω(report["foo"].AverageLabel).Should(Equal(" Average")) - Ω(report["foo"].Units).Should(Equal("")) - Ω(report["foo"].Results).Should(Equal([]float64{7, 2, 3})) - Ω(report["foo"].Smallest).Should(BeNumerically("==", 2)) - Ω(report["foo"].Largest).Should(BeNumerically("==", 7)) - Ω(report["foo"].Average).Should(BeNumerically("==", 4)) - Ω(report["foo"].StdDeviation).Should(BeNumerically("~", 2.16, 0.01)) - - Ω(report["bar"].Name).Should(Equal("bar")) - Ω(report["bar"].Info).Should(BeNil()) - Ω(report["bar"].SmallestLabel).Should(Equal("Smallest")) - Ω(report["bar"].Order).Should(Equal(1)) - Ω(report["bar"].LargestLabel).Should(Equal(" Largest")) - Ω(report["bar"].AverageLabel).Should(Equal(" Average")) - Ω(report["bar"].Units).Should(Equal("")) - Ω(report["bar"].Results).Should(Equal([]float64{0.3, 0.1, 0.5, 0.7})) - Ω(report["bar"].Smallest).Should(BeNumerically("==", 0.1)) - Ω(report["bar"].Largest).Should(BeNumerically("==", 0.7)) - Ω(report["bar"].Average).Should(BeNumerically("==", 0.4)) - Ω(report["bar"].StdDeviation).Should(BeNumerically("~", 0.22, 0.01)) - }) - }) - - Describe("Value with precision", func() { - BeforeEach(func() { - measure = NewMeasureNode("the measurement", func(b Benchmarker) { - b.RecordValueWithPrecision("foo", 7, "ms", 7, "info!") - b.RecordValueWithPrecision("foo", 2, "ms", 6) - b.RecordValueWithPrecision("foo", 3, "ms", 5) - b.RecordValueWithPrecision("bar", 0.3, "ns", 4) - b.RecordValueWithPrecision("bar", 0.1, "ns", 3) - b.RecordValueWithPrecision("bar", 0.5, "ns", 2) - b.RecordValueWithPrecision("bar", 0.7, "ns", 1) - }, types.FlagTypeFocused, codelocation.New(0), 1, Failer.New(), 3) - Ω(measure.Run()).Should(Equal(types.SpecStatePassed)) - }) - - It("records passed in values and reports on them", func() { - report := measure.MeasurementsReport() - Ω(report).Should(HaveLen(2)) - Ω(report["foo"].Name).Should(Equal("foo")) - Ω(report["foo"].Info).Should(Equal("info!")) - Ω(report["foo"].Order).Should(Equal(0)) - Ω(report["foo"].SmallestLabel).Should(Equal("Smallest")) - Ω(report["foo"].LargestLabel).Should(Equal(" Largest")) - Ω(report["foo"].AverageLabel).Should(Equal(" Average")) - Ω(report["foo"].Units).Should(Equal("ms")) - Ω(report["foo"].Results).Should(Equal([]float64{7, 2, 3})) - Ω(report["foo"].Smallest).Should(BeNumerically("==", 2)) - Ω(report["foo"].Largest).Should(BeNumerically("==", 7)) - Ω(report["foo"].Average).Should(BeNumerically("==", 4)) - Ω(report["foo"].StdDeviation).Should(BeNumerically("~", 2.16, 0.01)) - - Ω(report["bar"].Name).Should(Equal("bar")) - Ω(report["bar"].Info).Should(BeNil()) - Ω(report["bar"].SmallestLabel).Should(Equal("Smallest")) - Ω(report["bar"].Order).Should(Equal(1)) - Ω(report["bar"].LargestLabel).Should(Equal(" Largest")) - Ω(report["bar"].AverageLabel).Should(Equal(" Average")) - Ω(report["bar"].Units).Should(Equal("ns")) - Ω(report["bar"].Results).Should(Equal([]float64{0.3, 0.1, 0.5, 0.7})) - Ω(report["bar"].Smallest).Should(BeNumerically("==", 0.1)) - Ω(report["bar"].Largest).Should(BeNumerically("==", 0.7)) - Ω(report["bar"].Average).Should(BeNumerically("==", 0.4)) - Ω(report["bar"].StdDeviation).Should(BeNumerically("~", 0.22, 0.01)) - }) - }) - - Describe("Time", func() { - BeforeEach(func() { - measure = NewMeasureNode("the measurement", func(b Benchmarker) { - b.Time("foo", func() { - time.Sleep(200 * time.Millisecond) - }, "info!") - b.Time("foo", func() { - time.Sleep(300 * time.Millisecond) - }) - b.Time("foo", func() { - time.Sleep(250 * time.Millisecond) - }) - }, types.FlagTypeFocused, codelocation.New(0), 1, Failer.New(), 3) - Ω(measure.Run()).Should(Equal(types.SpecStatePassed)) - }) - - It("records passed in values and reports on them", func() { - report := measure.MeasurementsReport() - Ω(report).Should(HaveLen(1)) - Ω(report["foo"].Name).Should(Equal("foo")) - Ω(report["foo"].Info).Should(Equal("info!")) - Ω(report["foo"].SmallestLabel).Should(Equal("Fastest Time")) - Ω(report["foo"].LargestLabel).Should(Equal("Slowest Time")) - Ω(report["foo"].AverageLabel).Should(Equal("Average Time")) - Ω(report["foo"].Units).Should(Equal("s")) - Ω(report["foo"].Results).Should(HaveLen(3)) - Ω(report["foo"].Results[0]).Should(BeNumerically("~", 0.2, 0.06)) - Ω(report["foo"].Results[1]).Should(BeNumerically("~", 0.3, 0.06)) - Ω(report["foo"].Results[2]).Should(BeNumerically("~", 0.25, 0.06)) - Ω(report["foo"].Smallest).Should(BeNumerically("~", 0.2, 0.06)) - Ω(report["foo"].Largest).Should(BeNumerically("~", 0.3, 0.06)) - Ω(report["foo"].Average).Should(BeNumerically("~", 0.25, 0.06)) - Ω(report["foo"].StdDeviation).Should(BeNumerically("~", 0.07, 0.04)) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go deleted file mode 100644 index 9810688..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go +++ /dev/null @@ -1,48 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" - - . "github.com/onsi/ginkgo/internal/leafnodes" - - "github.com/onsi/ginkgo/internal/codelocation" -) - -var _ = Describe("Setup Nodes", func() { - Describe("BeforeEachNodes", func() { - It("should report the correct type and code location", func() { - codeLocation := codelocation.New(0) - beforeEach := NewBeforeEachNode(func() {}, codeLocation, 0, nil, 3) - Ω(beforeEach.Type()).Should(Equal(types.SpecComponentTypeBeforeEach)) - Ω(beforeEach.CodeLocation()).Should(Equal(codeLocation)) - }) - }) - - Describe("AfterEachNodes", func() { - It("should report the correct type and code location", func() { - codeLocation := codelocation.New(0) - afterEach := NewAfterEachNode(func() {}, codeLocation, 0, nil, 3) - Ω(afterEach.Type()).Should(Equal(types.SpecComponentTypeAfterEach)) - Ω(afterEach.CodeLocation()).Should(Equal(codeLocation)) - }) - }) - - Describe("JustBeforeEachNodes", func() { - It("should report the correct type and code location", func() { - codeLocation := codelocation.New(0) - justBeforeEach := NewJustBeforeEachNode(func() {}, codeLocation, 0, nil, 3) - Ω(justBeforeEach.Type()).Should(Equal(types.SpecComponentTypeJustBeforeEach)) - Ω(justBeforeEach.CodeLocation()).Should(Equal(codeLocation)) - }) - }) - Describe("JustAfterEachNodes", func() { - It("should report the correct type and code location", func() { - codeLocation := codelocation.New(0) - justAfterEach := NewJustAfterEachNode(func() {}, codeLocation, 0, nil, 3) - Ω(justAfterEach.Type()).Should(Equal(types.SpecComponentTypeJustAfterEach)) - Ω(justAfterEach.CodeLocation()).Should(Equal(codeLocation)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go deleted file mode 100644 index 0897836..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go +++ /dev/null @@ -1,353 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/leafnodes" - . "github.com/onsi/gomega" - - "reflect" - "time" - - "github.com/onsi/ginkgo/internal/codelocation" - Failer "github.com/onsi/ginkgo/internal/failer" - "github.com/onsi/ginkgo/types" -) - -type runnable interface { - Run() (outcome types.SpecState, failure types.SpecFailure) - CodeLocation() types.CodeLocation -} - -func SynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable, componentType types.SpecComponentType, componentIndex int) { - var ( - outcome types.SpecState - failure types.SpecFailure - - failer *Failer.Failer - - componentCodeLocation types.CodeLocation - innerCodeLocation types.CodeLocation - - didRun bool - ) - - BeforeEach(func() { - failer = Failer.New() - componentCodeLocation = codelocation.New(0) - innerCodeLocation = codelocation.New(0) - - didRun = false - }) - - Describe("synchronous functions", func() { - Context("when the function passes", func() { - BeforeEach(func() { - outcome, failure = build(func() { - didRun = true - }, 0, failer, componentCodeLocation).Run() - }) - - It("should have a succesful outcome", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStatePassed)) - Ω(failure).Should(BeZero()) - }) - }) - - Context("when a failure occurs", func() { - BeforeEach(func() { - outcome, failure = build(func() { - didRun = true - failer.Fail("bam", innerCodeLocation) - panic("should not matter") - }, 0, failer, componentCodeLocation).Run() - }) - - It("should return the failure", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStateFailed)) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "bam", - Location: innerCodeLocation, - ForwardedPanic: "", - ComponentIndex: componentIndex, - ComponentType: componentType, - ComponentCodeLocation: componentCodeLocation, - })) - }) - }) - - Context("when a panic occurs", func() { - BeforeEach(func() { - outcome, failure = build(func() { - didRun = true - innerCodeLocation = codelocation.New(0) - panic("ack!") - }, 0, failer, componentCodeLocation).Run() - }) - - It("should return the panic", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStatePanicked)) - Ω(failure.ForwardedPanic).Should(Equal("ack!")) - }) - }) - - Context("when a panic occurs with a nil value", func() { - BeforeEach(func() { - outcome, failure = build(func() { - didRun = true - innerCodeLocation = codelocation.New(0) - panic(nil) - }, 0, failer, componentCodeLocation).Run() - }) - - It("should return the nil-valued panic", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStatePanicked)) - Ω(failure.ForwardedPanic).Should(Equal("")) - }) - }) - - }) -} - -func AsynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable, componentType types.SpecComponentType, componentIndex int) { - var ( - outcome types.SpecState - failure types.SpecFailure - - failer *Failer.Failer - - componentCodeLocation types.CodeLocation - innerCodeLocation types.CodeLocation - - didRun bool - ) - - BeforeEach(func() { - failer = Failer.New() - componentCodeLocation = codelocation.New(0) - innerCodeLocation = codelocation.New(0) - - didRun = false - }) - - Describe("asynchronous functions", func() { - var timeoutDuration time.Duration - - BeforeEach(func() { - timeoutDuration = time.Duration(1 * float64(time.Second)) - }) - - Context("when running", func() { - It("should run the function as a goroutine, and block until it's done", func() { - proveAsync := make(chan bool) - - build(func(done Done) { - didRun = true - proveAsync <- true - close(done) - }, timeoutDuration, failer, componentCodeLocation).Run() - - Eventually(proveAsync).Should(Receive(Equal(true))) - }) - }) - - Context("when the function passes", func() { - BeforeEach(func() { - outcome, failure = build(func(done Done) { - didRun = true - close(done) - }, timeoutDuration, failer, componentCodeLocation).Run() - }) - - It("should have a succesful outcome", func() { - Ω(didRun).Should(BeTrue()) - Ω(outcome).Should(Equal(types.SpecStatePassed)) - Ω(failure).Should(BeZero()) - }) - }) - - Context("when the function fails", func() { - BeforeEach(func() { - outcome, failure = build(func(done Done) { - didRun = true - failer.Fail("bam", innerCodeLocation) - time.Sleep(20 * time.Millisecond) - defer close(done) - panic("doesn't matter") - }, 10*time.Millisecond, failer, componentCodeLocation).Run() - }) - - It("should return the failure", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStateFailed)) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "bam", - Location: innerCodeLocation, - ForwardedPanic: "", - ComponentIndex: componentIndex, - ComponentType: componentType, - ComponentCodeLocation: componentCodeLocation, - })) - }) - }) - - Context("when the function doesn't close the done channel in time", func() { - var guard chan struct{} - - BeforeEach(func() { - guard = make(chan struct{}) - outcome, failure = build(func(done Done) { - didRun = true - close(guard) - }, 10*time.Millisecond, failer, componentCodeLocation).Run() - }) - - It("should return a timeout", func() { - <-guard - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStateTimedOut)) - Ω(failure).Should(Equal(types.SpecFailure{ - Message: "Timed out", - Location: componentCodeLocation, - ForwardedPanic: "", - ComponentIndex: componentIndex, - ComponentType: componentType, - ComponentCodeLocation: componentCodeLocation, - })) - }) - }) - - Context("when the function panics", func() { - BeforeEach(func() { - outcome, failure = build(func(done Done) { - didRun = true - innerCodeLocation = codelocation.New(0) - panic("ack!") - }, 100*time.Millisecond, failer, componentCodeLocation).Run() - }) - - It("should return the panic", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStatePanicked)) - Ω(failure.ForwardedPanic).Should(Equal("ack!")) - }) - }) - - Context("when the function panics with a nil value", func() { - BeforeEach(func() { - outcome, failure = build(func(done Done) { - didRun = true - innerCodeLocation = codelocation.New(0) - panic(nil) - }, 100*time.Millisecond, failer, componentCodeLocation).Run() - }) - - It("should return the nil-valued panic", func() { - Ω(didRun).Should(BeTrue()) - - Ω(outcome).Should(Equal(types.SpecStatePanicked)) - Ω(failure.ForwardedPanic).Should(Equal("")) - }) - }) - }) -} - -func InvalidSharedRunnerBehaviors(build func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable, componentType types.SpecComponentType) { - var ( - failer *Failer.Failer - componentCodeLocation types.CodeLocation - ) - - BeforeEach(func() { - failer = Failer.New() - componentCodeLocation = codelocation.New(0) - }) - - Describe("invalid functions", func() { - Context("when passed something that's not a function", func() { - It("should panic", func() { - Ω(func() { - build("not a function", 0, failer, componentCodeLocation) - }).Should(Panic()) - }) - }) - - Context("when the function takes the wrong kind of argument", func() { - It("should panic", func() { - Ω(func() { - build(func(oops string) {}, 0, failer, componentCodeLocation) - }).Should(Panic()) - }) - }) - - Context("when the function takes more than one argument", func() { - It("should panic", func() { - Ω(func() { - build(func(done Done, oops string) {}, 0, failer, componentCodeLocation) - }).Should(Panic()) - }) - }) - }) -} - -var _ = Describe("Shared RunnableNode behavior", func() { - Describe("It Nodes", func() { - build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable { - return NewItNode("", body, types.FlagTypeFocused, componentCodeLocation, timeout, failer, 3) - } - - SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeIt, 3) - AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeIt, 3) - InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeIt) - }) - - Describe("Measure Nodes", func() { - build := func(body interface{}, _ time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable { - return NewMeasureNode("", func(Benchmarker) { - reflect.ValueOf(body).Call([]reflect.Value{}) - }, types.FlagTypeFocused, componentCodeLocation, 10, failer, 3) - } - - SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeMeasure, 3) - }) - - Describe("BeforeEach Nodes", func() { - build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable { - return NewBeforeEachNode(body, componentCodeLocation, timeout, failer, 3) - } - - SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeBeforeEach, 3) - AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeBeforeEach, 3) - InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeBeforeEach) - }) - - Describe("AfterEach Nodes", func() { - build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable { - return NewAfterEachNode(body, componentCodeLocation, timeout, failer, 3) - } - - SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeAfterEach, 3) - AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeAfterEach, 3) - InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeAfterEach) - }) - - Describe("JustBeforeEach Nodes", func() { - build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable { - return NewJustBeforeEachNode(body, componentCodeLocation, timeout, failer, 3) - } - - SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeJustBeforeEach, 3) - AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeJustBeforeEach, 3) - InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeJustBeforeEach) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go deleted file mode 100644 index 246b329..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go +++ /dev/null @@ -1,230 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - . "github.com/onsi/ginkgo/internal/leafnodes" - - "time" - - "github.com/onsi/ginkgo/internal/codelocation" - Failer "github.com/onsi/ginkgo/internal/failer" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("SuiteNodes", func() { - Describe("BeforeSuite nodes", func() { - var befSuite SuiteNode - var failer *Failer.Failer - var codeLocation types.CodeLocation - var innerCodeLocation types.CodeLocation - var outcome bool - - BeforeEach(func() { - failer = Failer.New() - codeLocation = codelocation.New(0) - innerCodeLocation = codelocation.New(0) - }) - - Context("when the body passes", func() { - BeforeEach(func() { - befSuite = NewBeforeSuiteNode(func() { - time.Sleep(10 * time.Millisecond) - }, codeLocation, 0, failer) - outcome = befSuite.Run(0, 0, "") - }) - - It("should return true when run and report as passed", func() { - Ω(outcome).Should(BeTrue()) - Ω(befSuite.Passed()).Should(BeTrue()) - }) - - It("should have the correct summary", func() { - summary := befSuite.Summary() - Ω(summary.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite)) - Ω(summary.CodeLocation).Should(Equal(codeLocation)) - Ω(summary.State).Should(Equal(types.SpecStatePassed)) - Ω(summary.RunTime).Should(BeNumerically(">=", 10*time.Millisecond)) - Ω(summary.Failure).Should(BeZero()) - }) - }) - - Context("when the body fails", func() { - BeforeEach(func() { - befSuite = NewBeforeSuiteNode(func() { - failer.Fail("oops", innerCodeLocation) - }, codeLocation, 0, failer) - outcome = befSuite.Run(0, 0, "") - }) - - It("should return false when run and report as failed", func() { - Ω(outcome).Should(BeFalse()) - Ω(befSuite.Passed()).Should(BeFalse()) - }) - - It("should have the correct summary", func() { - summary := befSuite.Summary() - Ω(summary.State).Should(Equal(types.SpecStateFailed)) - Ω(summary.Failure.Message).Should(Equal("oops")) - Ω(summary.Failure.Location).Should(Equal(innerCodeLocation)) - Ω(summary.Failure.ForwardedPanic).Should(BeEmpty()) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - - Context("when the body times out", func() { - BeforeEach(func() { - befSuite = NewBeforeSuiteNode(func(done Done) { - }, codeLocation, time.Millisecond, failer) - outcome = befSuite.Run(0, 0, "") - }) - - It("should return false when run and report as failed", func() { - Ω(outcome).Should(BeFalse()) - Ω(befSuite.Passed()).Should(BeFalse()) - }) - - It("should have the correct summary", func() { - summary := befSuite.Summary() - Ω(summary.State).Should(Equal(types.SpecStateTimedOut)) - Ω(summary.Failure.ForwardedPanic).Should(BeEmpty()) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - - Context("when the body panics", func() { - BeforeEach(func() { - befSuite = NewBeforeSuiteNode(func() { - panic("bam") - }, codeLocation, 0, failer) - outcome = befSuite.Run(0, 0, "") - }) - - It("should return false when run and report as failed", func() { - Ω(outcome).Should(BeFalse()) - Ω(befSuite.Passed()).Should(BeFalse()) - }) - - It("should have the correct summary", func() { - summary := befSuite.Summary() - Ω(summary.State).Should(Equal(types.SpecStatePanicked)) - Ω(summary.Failure.ForwardedPanic).Should(Equal("bam")) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - }) - - Describe("AfterSuite nodes", func() { - var aftSuite SuiteNode - var failer *Failer.Failer - var codeLocation types.CodeLocation - var innerCodeLocation types.CodeLocation - var outcome bool - - BeforeEach(func() { - failer = Failer.New() - codeLocation = codelocation.New(0) - innerCodeLocation = codelocation.New(0) - }) - - Context("when the body passes", func() { - BeforeEach(func() { - aftSuite = NewAfterSuiteNode(func() { - time.Sleep(10 * time.Millisecond) - }, codeLocation, 0, failer) - outcome = aftSuite.Run(0, 0, "") - }) - - It("should return true when run and report as passed", func() { - Ω(outcome).Should(BeTrue()) - Ω(aftSuite.Passed()).Should(BeTrue()) - }) - - It("should have the correct summary", func() { - summary := aftSuite.Summary() - Ω(summary.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite)) - Ω(summary.CodeLocation).Should(Equal(codeLocation)) - Ω(summary.State).Should(Equal(types.SpecStatePassed)) - Ω(summary.RunTime).Should(BeNumerically(">=", 10*time.Millisecond)) - Ω(summary.Failure).Should(BeZero()) - }) - }) - - Context("when the body fails", func() { - BeforeEach(func() { - aftSuite = NewAfterSuiteNode(func() { - failer.Fail("oops", innerCodeLocation) - }, codeLocation, 0, failer) - outcome = aftSuite.Run(0, 0, "") - }) - - It("should return false when run and report as failed", func() { - Ω(outcome).Should(BeFalse()) - Ω(aftSuite.Passed()).Should(BeFalse()) - }) - - It("should have the correct summary", func() { - summary := aftSuite.Summary() - Ω(summary.State).Should(Equal(types.SpecStateFailed)) - Ω(summary.Failure.Message).Should(Equal("oops")) - Ω(summary.Failure.Location).Should(Equal(innerCodeLocation)) - Ω(summary.Failure.ForwardedPanic).Should(BeEmpty()) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - - Context("when the body times out", func() { - BeforeEach(func() { - aftSuite = NewAfterSuiteNode(func(done Done) { - }, codeLocation, time.Millisecond, failer) - outcome = aftSuite.Run(0, 0, "") - }) - - It("should return false when run and report as failed", func() { - Ω(outcome).Should(BeFalse()) - Ω(aftSuite.Passed()).Should(BeFalse()) - }) - - It("should have the correct summary", func() { - summary := aftSuite.Summary() - Ω(summary.State).Should(Equal(types.SpecStateTimedOut)) - Ω(summary.Failure.ForwardedPanic).Should(BeEmpty()) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - - Context("when the body panics", func() { - BeforeEach(func() { - aftSuite = NewAfterSuiteNode(func() { - panic("bam") - }, codeLocation, 0, failer) - outcome = aftSuite.Run(0, 0, "") - }) - - It("should return false when run and report as failed", func() { - Ω(outcome).Should(BeFalse()) - Ω(aftSuite.Passed()).Should(BeFalse()) - }) - - It("should have the correct summary", func() { - summary := aftSuite.Summary() - Ω(summary.State).Should(Equal(types.SpecStatePanicked)) - Ω(summary.Failure.ForwardedPanic).Should(Equal("bam")) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go deleted file mode 100644 index edbdf6a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go +++ /dev/null @@ -1,199 +0,0 @@ -package leafnodes_test - -import ( - "sync" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" - - "net/http" - - "github.com/onsi/gomega/ghttp" - - "time" - - "github.com/onsi/ginkgo/internal/codelocation" - Failer "github.com/onsi/ginkgo/internal/failer" -) - -var _ = Describe("SynchronizedAfterSuiteNode", func() { - var failer *Failer.Failer - var node SuiteNode - var codeLocation types.CodeLocation - var innerCodeLocation types.CodeLocation - var outcome bool - var server *ghttp.Server - var things []string - var lock *sync.Mutex - - BeforeEach(func() { - things = []string{} - server = ghttp.NewServer() - codeLocation = codelocation.New(0) - innerCodeLocation = codelocation.New(0) - failer = Failer.New() - lock = &sync.Mutex{} - }) - - AfterEach(func() { - server.Close() - }) - - newNode := func(bodyA interface{}, bodyB interface{}) SuiteNode { - return NewSynchronizedAfterSuiteNode(bodyA, bodyB, codeLocation, time.Millisecond, failer) - } - - ranThing := func(thing string) { - lock.Lock() - defer lock.Unlock() - things = append(things, thing) - } - - thingsThatRan := func() []string { - lock.Lock() - defer lock.Unlock() - return things - } - - Context("when not running in parallel", func() { - Context("when all is well", func() { - BeforeEach(func() { - node = newNode(func() { - ranThing("A") - }, func() { - ranThing("B") - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should run A, then B", func() { - Ω(thingsThatRan()).Should(Equal([]string{"A", "B"})) - }) - - It("should report success", func() { - Ω(outcome).Should(BeTrue()) - Ω(node.Passed()).Should(BeTrue()) - Ω(node.Summary().State).Should(Equal(types.SpecStatePassed)) - }) - }) - - Context("when A fails", func() { - BeforeEach(func() { - node = newNode(func() { - ranThing("A") - failer.Fail("bam", innerCodeLocation) - }, func() { - ranThing("B") - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should still run B", func() { - Ω(thingsThatRan()).Should(Equal([]string{"A", "B"})) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - Ω(node.Summary().State).Should(Equal(types.SpecStateFailed)) - }) - }) - - Context("when B fails", func() { - BeforeEach(func() { - node = newNode(func() { - ranThing("A") - }, func() { - ranThing("B") - failer.Fail("bam", innerCodeLocation) - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should run all the things", func() { - Ω(thingsThatRan()).Should(Equal([]string{"A", "B"})) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - Ω(node.Summary().State).Should(Equal(types.SpecStateFailed)) - }) - }) - }) - - Context("when running in parallel", func() { - Context("as the first node", func() { - BeforeEach(func() { - server.AppendHandlers(ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/RemoteAfterSuiteData"), - func(writer http.ResponseWriter, request *http.Request) { - ranThing("Request1") - }, - ghttp.RespondWithJSONEncoded(200, types.RemoteAfterSuiteData{CanRun: false}), - ), ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/RemoteAfterSuiteData"), - func(writer http.ResponseWriter, request *http.Request) { - ranThing("Request2") - }, - ghttp.RespondWithJSONEncoded(200, types.RemoteAfterSuiteData{CanRun: false}), - ), ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/RemoteAfterSuiteData"), - func(writer http.ResponseWriter, request *http.Request) { - ranThing("Request3") - }, - ghttp.RespondWithJSONEncoded(200, types.RemoteAfterSuiteData{CanRun: true}), - )) - - node = newNode(func() { - ranThing("A") - }, func() { - ranThing("B") - }) - - outcome = node.Run(1, 3, server.URL()) - }) - - It("should run A and, when the server says its time, run B", func() { - Ω(thingsThatRan()).Should(Equal([]string{"A", "Request1", "Request2", "Request3", "B"})) - }) - - It("should report success", func() { - Ω(outcome).Should(BeTrue()) - Ω(node.Passed()).Should(BeTrue()) - Ω(node.Summary().State).Should(Equal(types.SpecStatePassed)) - }) - }) - - Context("as any other node", func() { - BeforeEach(func() { - node = newNode(func() { - ranThing("A") - }, func() { - ranThing("B") - }) - - outcome = node.Run(2, 3, server.URL()) - }) - - It("should run A, and not run B", func() { - Ω(thingsThatRan()).Should(Equal([]string{"A"})) - }) - - It("should not talk to the server", func() { - Ω(server.ReceivedRequests()).Should(BeEmpty()) - }) - - It("should report success", func() { - Ω(outcome).Should(BeTrue()) - Ω(node.Passed()).Should(BeTrue()) - Ω(node.Summary().State).Should(Equal(types.SpecStatePassed)) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go deleted file mode 100644 index 46c3e27..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go +++ /dev/null @@ -1,446 +0,0 @@ -package leafnodes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/leafnodes" - . "github.com/onsi/gomega" - - "net/http" - - "github.com/onsi/gomega/ghttp" - - "time" - - "github.com/onsi/ginkgo/internal/codelocation" - Failer "github.com/onsi/ginkgo/internal/failer" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("SynchronizedBeforeSuiteNode", func() { - var failer *Failer.Failer - var node SuiteNode - var codeLocation types.CodeLocation - var innerCodeLocation types.CodeLocation - var outcome bool - var server *ghttp.Server - - BeforeEach(func() { - server = ghttp.NewServer() - codeLocation = codelocation.New(0) - innerCodeLocation = codelocation.New(0) - failer = Failer.New() - }) - - AfterEach(func() { - server.Close() - }) - - newNode := func(bodyA interface{}, bodyB interface{}) SuiteNode { - return NewSynchronizedBeforeSuiteNode(bodyA, bodyB, codeLocation, time.Millisecond, failer) - } - - Describe("when not running in parallel", func() { - Context("when all is well", func() { - var data []byte - BeforeEach(func() { - data = nil - - node = newNode(func() []byte { - return []byte("my data") - }, func(d []byte) { - data = d - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should run A, then B passing the output from A to B", func() { - Ω(data).Should(Equal([]byte("my data"))) - }) - - It("should report success", func() { - Ω(outcome).Should(BeTrue()) - Ω(node.Passed()).Should(BeTrue()) - Ω(node.Summary().State).Should(Equal(types.SpecStatePassed)) - }) - }) - - Context("when A fails", func() { - var ranB bool - BeforeEach(func() { - ranB = false - node = newNode(func() []byte { - failer.Fail("boom", innerCodeLocation) - return nil - }, func([]byte) { - ranB = true - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should not run B", func() { - Ω(ranB).Should(BeFalse()) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - Ω(node.Summary().State).Should(Equal(types.SpecStateFailed)) - }) - }) - - Context("when B fails", func() { - BeforeEach(func() { - node = newNode(func() []byte { - return nil - }, func([]byte) { - failer.Fail("boom", innerCodeLocation) - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - Ω(node.Summary().State).Should(Equal(types.SpecStateFailed)) - }) - }) - - Context("when A times out", func() { - var ranB bool - BeforeEach(func() { - ranB = false - node = newNode(func(Done) []byte { - time.Sleep(time.Second) - return nil - }, func([]byte) { - ranB = true - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should not run B", func() { - Ω(ranB).Should(BeFalse()) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - Ω(node.Summary().State).Should(Equal(types.SpecStateTimedOut)) - }) - }) - - Context("when B times out", func() { - BeforeEach(func() { - node = newNode(func() []byte { - return nil - }, func([]byte, Done) { - time.Sleep(time.Second) - }) - - outcome = node.Run(1, 1, server.URL()) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - Ω(node.Summary().State).Should(Equal(types.SpecStateTimedOut)) - }) - }) - }) - - Describe("when running in parallel", func() { - var ranB bool - var parallelNode, parallelTotal int - BeforeEach(func() { - ranB = false - parallelNode, parallelTotal = 1, 3 - }) - - Context("as the first node, it runs A", func() { - var expectedState types.RemoteBeforeSuiteData - - BeforeEach(func() { - parallelNode, parallelTotal = 1, 3 - }) - - JustBeforeEach(func() { - server.AppendHandlers(ghttp.CombineHandlers( - ghttp.VerifyRequest("POST", "/BeforeSuiteState"), - ghttp.VerifyJSONRepresenting(expectedState), - )) - - outcome = node.Run(parallelNode, parallelTotal, server.URL()) - }) - - Context("when A succeeds", func() { - BeforeEach(func() { - expectedState = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStatePassed} - - node = newNode(func() []byte { - return []byte("my data") - }, func([]byte) { - ranB = true - }) - }) - - It("should post about A succeeding", func() { - Ω(server.ReceivedRequests()).Should(HaveLen(1)) - }) - - It("should run B", func() { - Ω(ranB).Should(BeTrue()) - }) - - It("should report success", func() { - Ω(outcome).Should(BeTrue()) - }) - }) - - Context("when A fails", func() { - BeforeEach(func() { - expectedState = types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStateFailed} - - node = newNode(func() []byte { - panic("BAM") - }, func([]byte) { - ranB = true - }) - }) - - It("should post about A failing", func() { - Ω(server.ReceivedRequests()).Should(HaveLen(1)) - }) - - It("should not run B", func() { - Ω(ranB).Should(BeFalse()) - }) - - It("should report failure", func() { - Ω(outcome).Should(BeFalse()) - }) - }) - }) - - Context("as the Nth node", func() { - var statusCode int - var response interface{} - var ranA bool - var bData []byte - - BeforeEach(func() { - ranA = false - bData = nil - - statusCode = http.StatusOK - - server.AppendHandlers(ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/BeforeSuiteState"), - ghttp.RespondWith(http.StatusOK, string((types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}).ToJSON())), - ), ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/BeforeSuiteState"), - ghttp.RespondWith(http.StatusOK, string((types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}).ToJSON())), - ), ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/BeforeSuiteState"), - ghttp.RespondWithJSONEncodedPtr(&statusCode, &response), - )) - - node = newNode(func() []byte { - ranA = true - return nil - }, func(data []byte) { - bData = data - }) - - parallelNode, parallelTotal = 2, 3 - }) - - Context("when A on node1 succeeds", func() { - BeforeEach(func() { - response = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStatePassed} - outcome = node.Run(parallelNode, parallelTotal, server.URL()) - }) - - It("should not run A", func() { - Ω(ranA).Should(BeFalse()) - }) - - It("should poll for A", func() { - Ω(server.ReceivedRequests()).Should(HaveLen(3)) - }) - - It("should run B when the polling succeeds", func() { - Ω(bData).Should(Equal([]byte("my data"))) - }) - - It("should succeed", func() { - Ω(outcome).Should(BeTrue()) - Ω(node.Passed()).Should(BeTrue()) - }) - }) - - Context("when A on node1 fails", func() { - BeforeEach(func() { - response = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStateFailed} - outcome = node.Run(parallelNode, parallelTotal, server.URL()) - }) - - It("should not run A", func() { - Ω(ranA).Should(BeFalse()) - }) - - It("should poll for A", func() { - Ω(server.ReceivedRequests()).Should(HaveLen(3)) - }) - - It("should not run B", func() { - Ω(bData).Should(BeNil()) - }) - - It("should fail", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - - summary := node.Summary() - Ω(summary.State).Should(Equal(types.SpecStateFailed)) - Ω(summary.Failure.Message).Should(Equal("BeforeSuite on Node 1 failed")) - Ω(summary.Failure.Location).Should(Equal(codeLocation)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite)) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - - Context("when node1 disappears", func() { - BeforeEach(func() { - response = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStateDisappeared} - outcome = node.Run(parallelNode, parallelTotal, server.URL()) - }) - - It("should not run A", func() { - Ω(ranA).Should(BeFalse()) - }) - - It("should poll for A", func() { - Ω(server.ReceivedRequests()).Should(HaveLen(3)) - }) - - It("should not run B", func() { - Ω(bData).Should(BeNil()) - }) - - It("should fail", func() { - Ω(outcome).Should(BeFalse()) - Ω(node.Passed()).Should(BeFalse()) - - summary := node.Summary() - Ω(summary.State).Should(Equal(types.SpecStateFailed)) - Ω(summary.Failure.Message).Should(Equal("Node 1 disappeared before completing BeforeSuite")) - Ω(summary.Failure.Location).Should(Equal(codeLocation)) - Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite)) - Ω(summary.Failure.ComponentIndex).Should(Equal(0)) - Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation)) - }) - }) - }) - }) - - Describe("construction", func() { - Describe("the first function", func() { - Context("when the first function returns a byte array", func() { - Context("and takes nothing", func() { - It("should be fine", func() { - Ω(func() { - newNode(func() []byte { return nil }, func([]byte) {}) - }).ShouldNot(Panic()) - }) - }) - - Context("and takes a done function", func() { - It("should be fine", func() { - Ω(func() { - newNode(func(Done) []byte { return nil }, func([]byte) {}) - }).ShouldNot(Panic()) - }) - }) - - Context("and takes more than one thing", func() { - It("should panic", func() { - Ω(func() { - newNode(func(Done, Done) []byte { return nil }, func([]byte) {}) - }).Should(Panic()) - }) - }) - - Context("and takes something else", func() { - It("should panic", func() { - Ω(func() { - newNode(func(bool) []byte { return nil }, func([]byte) {}) - }).Should(Panic()) - }) - }) - }) - - Context("when the first function does not return a byte array", func() { - It("should panic", func() { - Ω(func() { - newNode(func() {}, func([]byte) {}) - }).Should(Panic()) - - Ω(func() { - newNode(func() []int { return nil }, func([]byte) {}) - }).Should(Panic()) - }) - }) - }) - - Describe("the second function", func() { - Context("when the second function takes a byte array", func() { - It("should be fine", func() { - Ω(func() { - newNode(func() []byte { return nil }, func([]byte) {}) - }).ShouldNot(Panic()) - }) - }) - - Context("when it also takes a done channel", func() { - It("should be fine", func() { - Ω(func() { - newNode(func() []byte { return nil }, func([]byte, Done) {}) - }).ShouldNot(Panic()) - }) - }) - - Context("if it takes anything else", func() { - It("should panic", func() { - Ω(func() { - newNode(func() []byte { return nil }, func([]byte, chan bool) {}) - }).Should(Panic()) - - Ω(func() { - newNode(func() []byte { return nil }, func(string) {}) - }).Should(Panic()) - }) - }) - - Context("if it takes nothing at all", func() { - It("should panic", func() { - Ω(func() { - newNode(func() []byte { return nil }, func() {}) - }).Should(Panic()) - }) - }) - - Context("if it returns something", func() { - It("should panic", func() { - Ω(func() { - newNode(func() []byte { return nil }, func([]byte) []byte { return nil }) - }).Should(Panic()) - }) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go deleted file mode 100644 index aedf939..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go +++ /dev/null @@ -1,315 +0,0 @@ -package remote_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "time" - - "github.com/onsi/ginkgo/config" - . "github.com/onsi/ginkgo/internal/remote" - st "github.com/onsi/ginkgo/reporters/stenographer" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("Aggregator", func() { - var ( - aggregator *Aggregator - reporterConfig config.DefaultReporterConfigType - stenographer *st.FakeStenographer - result chan bool - - ginkgoConfig1 config.GinkgoConfigType - ginkgoConfig2 config.GinkgoConfigType - - suiteSummary1 *types.SuiteSummary - suiteSummary2 *types.SuiteSummary - - beforeSummary *types.SetupSummary - afterSummary *types.SetupSummary - specSummary *types.SpecSummary - - suiteDescription string - ) - - BeforeEach(func() { - reporterConfig = config.DefaultReporterConfigType{ - NoColor: false, - SlowSpecThreshold: 0.1, - NoisyPendings: true, - Succinct: false, - Verbose: true, - } - stenographer = st.NewFakeStenographer() - result = make(chan bool, 1) - aggregator = NewAggregator(2, result, reporterConfig, stenographer) - - // - // now set up some fixture data - // - - ginkgoConfig1 = config.GinkgoConfigType{ - RandomSeed: 1138, - RandomizeAllSpecs: true, - ParallelNode: 1, - ParallelTotal: 2, - } - - ginkgoConfig2 = config.GinkgoConfigType{ - RandomSeed: 1138, - RandomizeAllSpecs: true, - ParallelNode: 2, - ParallelTotal: 2, - } - - suiteDescription = "My Parallel Suite" - - suiteSummary1 = &types.SuiteSummary{ - SuiteDescription: suiteDescription, - - NumberOfSpecsBeforeParallelization: 30, - NumberOfTotalSpecs: 17, - NumberOfSpecsThatWillBeRun: 15, - NumberOfPendingSpecs: 1, - NumberOfSkippedSpecs: 1, - } - - suiteSummary2 = &types.SuiteSummary{ - SuiteDescription: suiteDescription, - - NumberOfSpecsBeforeParallelization: 30, - NumberOfTotalSpecs: 13, - NumberOfSpecsThatWillBeRun: 8, - NumberOfPendingSpecs: 2, - NumberOfSkippedSpecs: 3, - } - - beforeSummary = &types.SetupSummary{ - State: types.SpecStatePassed, - CapturedOutput: "BeforeSuiteOutput", - } - - afterSummary = &types.SetupSummary{ - State: types.SpecStatePassed, - CapturedOutput: "AfterSuiteOutput", - } - - specSummary = &types.SpecSummary{ - State: types.SpecStatePassed, - CapturedOutput: "SpecOutput", - } - }) - - call := func(method string, args ...interface{}) st.FakeStenographerCall { - return st.NewFakeStenographerCall(method, args...) - } - - beginSuite := func() { - stenographer.Reset() - aggregator.SpecSuiteWillBegin(ginkgoConfig2, suiteSummary2) - aggregator.SpecSuiteWillBegin(ginkgoConfig1, suiteSummary1) - Eventually(func() interface{} { - return len(stenographer.Calls()) - }).Should(BeNumerically(">=", 3)) - } - - Describe("Announcing the beginning of the suite", func() { - Context("When one of the parallel-suites starts", func() { - BeforeEach(func() { - aggregator.SpecSuiteWillBegin(ginkgoConfig2, suiteSummary2) - }) - - It("should be silent", func() { - Consistently(func() interface{} { return stenographer.Calls() }).Should(BeEmpty()) - }) - }) - - Context("once all of the parallel-suites have started", func() { - BeforeEach(func() { - aggregator.SpecSuiteWillBegin(ginkgoConfig2, suiteSummary2) - aggregator.SpecSuiteWillBegin(ginkgoConfig1, suiteSummary1) - Eventually(func() interface{} { - return stenographer.Calls() - }).Should(HaveLen(3)) - }) - - It("should announce the beginning of the suite", func() { - Ω(stenographer.Calls()).Should(HaveLen(3)) - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuite", suiteDescription, ginkgoConfig1.RandomSeed, true, false))) - Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceTotalNumberOfSpecs", 30, false))) - Ω(stenographer.Calls()[2]).Should(Equal(call("AnnounceAggregatedParallelRun", 2, false))) - }) - }) - }) - - Describe("Announcing specs and before suites", func() { - Context("when the parallel-suites have not all started", func() { - BeforeEach(func() { - aggregator.BeforeSuiteDidRun(beforeSummary) - aggregator.AfterSuiteDidRun(afterSummary) - aggregator.SpecDidComplete(specSummary) - }) - - It("should not announce any specs", func() { - Consistently(func() interface{} { return stenographer.Calls() }).Should(BeEmpty()) - }) - - Context("when the parallel-suites subsequently start", func() { - BeforeEach(func() { - beginSuite() - }) - - It("should announce the specs, the before suites and the after suites", func() { - Eventually(func() interface{} { - return stenographer.Calls() - }).Should(ContainElement(call("AnnounceSuccesfulSpec", specSummary))) - - Ω(stenographer.Calls()).Should(ContainElement(call("AnnounceCapturedOutput", beforeSummary.CapturedOutput))) - Ω(stenographer.Calls()).Should(ContainElement(call("AnnounceCapturedOutput", afterSummary.CapturedOutput))) - }) - }) - }) - - Context("When the parallel-suites have all started", func() { - BeforeEach(func() { - beginSuite() - stenographer.Reset() - }) - - Context("When a spec completes", func() { - BeforeEach(func() { - aggregator.BeforeSuiteDidRun(beforeSummary) - aggregator.SpecDidComplete(specSummary) - aggregator.AfterSuiteDidRun(afterSummary) - Eventually(func() interface{} { - return stenographer.Calls() - }).Should(HaveLen(5)) - }) - - It("should announce the captured output of the BeforeSuite", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceCapturedOutput", beforeSummary.CapturedOutput))) - }) - - It("should announce that the spec will run (when in verbose mode)", func() { - Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceSpecWillRun", specSummary))) - }) - - It("should announce the captured stdout of the spec", func() { - Ω(stenographer.Calls()[2]).Should(Equal(call("AnnounceCapturedOutput", specSummary.CapturedOutput))) - }) - - It("should announce completion", func() { - Ω(stenographer.Calls()[3]).Should(Equal(call("AnnounceSuccesfulSpec", specSummary))) - }) - - It("should announce the captured output of the AfterSuite", func() { - Ω(stenographer.Calls()[4]).Should(Equal(call("AnnounceCapturedOutput", afterSummary.CapturedOutput))) - }) - }) - }) - }) - - Describe("Announcing the end of the suite", func() { - BeforeEach(func() { - beginSuite() - stenographer.Reset() - }) - - Context("When one of the parallel-suites ends", func() { - BeforeEach(func() { - aggregator.SpecSuiteDidEnd(suiteSummary2) - }) - - It("should be silent", func() { - Consistently(func() interface{} { return stenographer.Calls() }).Should(BeEmpty()) - }) - - It("should not notify the channel", func() { - Ω(result).Should(BeEmpty()) - }) - }) - - Context("once all of the parallel-suites end", func() { - BeforeEach(func() { - time.Sleep(200 * time.Millisecond) - - suiteSummary1.SuiteSucceeded = true - suiteSummary1.NumberOfPassedSpecs = 15 - suiteSummary1.NumberOfFailedSpecs = 0 - suiteSummary1.NumberOfFlakedSpecs = 3 - suiteSummary2.SuiteSucceeded = false - suiteSummary2.NumberOfPassedSpecs = 5 - suiteSummary2.NumberOfFailedSpecs = 3 - suiteSummary2.NumberOfFlakedSpecs = 4 - - aggregator.SpecSuiteDidEnd(suiteSummary2) - aggregator.SpecSuiteDidEnd(suiteSummary1) - Eventually(func() interface{} { - return stenographer.Calls() - }).Should(HaveLen(2)) - }) - - It("should announce the end of the suite", func() { - compositeSummary := stenographer.Calls()[1].Args[0].(*types.SuiteSummary) - - Ω(compositeSummary.SuiteSucceeded).Should(BeFalse()) - Ω(compositeSummary.NumberOfSpecsThatWillBeRun).Should(Equal(23)) - Ω(compositeSummary.NumberOfTotalSpecs).Should(Equal(30)) - Ω(compositeSummary.NumberOfPassedSpecs).Should(Equal(20)) - Ω(compositeSummary.NumberOfFailedSpecs).Should(Equal(3)) - Ω(compositeSummary.NumberOfPendingSpecs).Should(Equal(3)) - Ω(compositeSummary.NumberOfSkippedSpecs).Should(Equal(4)) - Ω(compositeSummary.NumberOfFlakedSpecs).Should(Equal(7)) - Ω(compositeSummary.RunTime.Seconds()).Should(BeNumerically(">", 0.2)) - }) - }) - - Context("when all the parallel-suites pass", func() { - BeforeEach(func() { - suiteSummary1.SuiteSucceeded = true - suiteSummary2.SuiteSucceeded = true - - aggregator.SpecSuiteDidEnd(suiteSummary2) - aggregator.SpecSuiteDidEnd(suiteSummary1) - Eventually(func() interface{} { - return stenographer.Calls() - }).Should(HaveLen(2)) - }) - - It("should report success", func() { - compositeSummary := stenographer.Calls()[1].Args[0].(*types.SuiteSummary) - - Ω(compositeSummary.SuiteSucceeded).Should(BeTrue()) - }) - - It("should notify the channel that it succeded", func(done Done) { - Ω(<-result).Should(BeTrue()) - close(done) - }) - }) - - Context("when one of the parallel-suites fails", func() { - BeforeEach(func() { - suiteSummary1.SuiteSucceeded = true - suiteSummary2.SuiteSucceeded = false - - aggregator.SpecSuiteDidEnd(suiteSummary2) - aggregator.SpecSuiteDidEnd(suiteSummary1) - Eventually(func() interface{} { - return stenographer.Calls() - }).Should(HaveLen(2)) - }) - - It("should report failure", func() { - compositeSummary := stenographer.Calls()[1].Args[0].(*types.SuiteSummary) - - Ω(compositeSummary.SuiteSucceeded).Should(BeFalse()) - }) - - It("should notify the channel that it failed", func(done Done) { - Ω(<-result).Should(BeFalse()) - close(done) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go deleted file mode 100644 index ef54862..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go +++ /dev/null @@ -1,22 +0,0 @@ -package remote_test - -import "os" - -type fakeOutputInterceptor struct { - DidStartInterceptingOutput bool - DidStopInterceptingOutput bool - InterceptedOutput string -} - -func (interceptor *fakeOutputInterceptor) StartInterceptingOutput() error { - interceptor.DidStartInterceptingOutput = true - return nil -} - -func (interceptor *fakeOutputInterceptor) StopInterceptingAndReturnOutput() (string, error) { - interceptor.DidStopInterceptingOutput = true - return interceptor.InterceptedOutput, nil -} - -func (interceptor *fakeOutputInterceptor) StreamTo(*os.File) { -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go deleted file mode 100644 index 3543c59..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package remote_test - -import ( - "io" - "io/ioutil" - "net/http" -) - -type post struct { - url string - bodyType string - bodyContent []byte -} - -type fakePoster struct { - posts []post -} - -func newFakePoster() *fakePoster { - return &fakePoster{ - posts: make([]post, 0), - } -} - -func (poster *fakePoster) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) { - bodyContent, _ := ioutil.ReadAll(body) - poster.posts = append(poster.posts, post{ - url: url, - bodyType: bodyType, - bodyContent: bodyContent, - }) - return nil, nil -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go deleted file mode 100644 index 0d7e476..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go +++ /dev/null @@ -1,181 +0,0 @@ -package remote_test - -import ( - "encoding/json" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/config" - . "github.com/onsi/ginkgo/internal/remote" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" -) - -var _ = Describe("ForwardingReporter", func() { - var ( - reporter *ForwardingReporter - interceptor *fakeOutputInterceptor - poster *fakePoster - suiteSummary *types.SuiteSummary - specSummary *types.SpecSummary - setupSummary *types.SetupSummary - serverHost string - ) - - BeforeEach(func() { - serverHost = "http://127.0.0.1:7788" - - poster = newFakePoster() - - interceptor = &fakeOutputInterceptor{ - InterceptedOutput: "The intercepted output!", - } - - reporter = NewForwardingReporter(config.DefaultReporterConfigType{}, serverHost, poster, interceptor, nil, "") - - suiteSummary = &types.SuiteSummary{ - SuiteDescription: "My Test Suite", - } - - setupSummary = &types.SetupSummary{ - State: types.SpecStatePassed, - } - - specSummary = &types.SpecSummary{ - ComponentTexts: []string{"My", "Spec"}, - State: types.SpecStatePassed, - } - }) - - Context("When a suite begins", func() { - BeforeEach(func() { - reporter.SpecSuiteWillBegin(config.GinkgoConfig, suiteSummary) - }) - - It("should start intercepting output", func() { - Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue()) - }) - - It("should POST the SuiteSummary and Ginkgo Config to the Ginkgo server", func() { - Ω(poster.posts).Should(HaveLen(1)) - Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/SpecSuiteWillBegin")) - Ω(poster.posts[0].bodyType).Should(Equal("application/json")) - - var sentData struct { - SentConfig config.GinkgoConfigType `json:"config"` - SentSuiteSummary *types.SuiteSummary `json:"suite-summary"` - } - - err := json.Unmarshal(poster.posts[0].bodyContent, &sentData) - Ω(err).ShouldNot(HaveOccurred()) - - Ω(sentData.SentConfig).Should(Equal(config.GinkgoConfig)) - Ω(sentData.SentSuiteSummary).Should(Equal(suiteSummary)) - }) - }) - - Context("when a BeforeSuite completes", func() { - BeforeEach(func() { - reporter.BeforeSuiteDidRun(setupSummary) - }) - - It("should stop, then start intercepting output", func() { - Ω(interceptor.DidStopInterceptingOutput).Should(BeTrue()) - Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue()) - }) - - It("should POST the SetupSummary to the Ginkgo server", func() { - Ω(poster.posts).Should(HaveLen(1)) - Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/BeforeSuiteDidRun")) - Ω(poster.posts[0].bodyType).Should(Equal("application/json")) - - var summary *types.SetupSummary - err := json.Unmarshal(poster.posts[0].bodyContent, &summary) - Ω(err).ShouldNot(HaveOccurred()) - setupSummary.CapturedOutput = interceptor.InterceptedOutput - Ω(summary).Should(Equal(setupSummary)) - }) - }) - - Context("when an AfterSuite completes", func() { - BeforeEach(func() { - reporter.AfterSuiteDidRun(setupSummary) - }) - - It("should stop, then start intercepting output", func() { - Ω(interceptor.DidStopInterceptingOutput).Should(BeTrue()) - Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue()) - }) - - It("should POST the SetupSummary to the Ginkgo server", func() { - Ω(poster.posts).Should(HaveLen(1)) - Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/AfterSuiteDidRun")) - Ω(poster.posts[0].bodyType).Should(Equal("application/json")) - - var summary *types.SetupSummary - err := json.Unmarshal(poster.posts[0].bodyContent, &summary) - Ω(err).ShouldNot(HaveOccurred()) - setupSummary.CapturedOutput = interceptor.InterceptedOutput - Ω(summary).Should(Equal(setupSummary)) - }) - }) - - Context("When a spec will run", func() { - BeforeEach(func() { - reporter.SpecWillRun(specSummary) - }) - - It("should POST the SpecSummary to the Ginkgo server", func() { - Ω(poster.posts).Should(HaveLen(1)) - Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/SpecWillRun")) - Ω(poster.posts[0].bodyType).Should(Equal("application/json")) - - var summary *types.SpecSummary - err := json.Unmarshal(poster.posts[0].bodyContent, &summary) - Ω(err).ShouldNot(HaveOccurred()) - Ω(summary).Should(Equal(specSummary)) - }) - - Context("When a spec completes", func() { - BeforeEach(func() { - specSummary.State = types.SpecStatePanicked - reporter.SpecDidComplete(specSummary) - }) - - It("should POST the SpecSummary to the Ginkgo server and include any intercepted output", func() { - Ω(poster.posts).Should(HaveLen(2)) - Ω(poster.posts[1].url).Should(Equal("http://127.0.0.1:7788/SpecDidComplete")) - Ω(poster.posts[1].bodyType).Should(Equal("application/json")) - - var summary *types.SpecSummary - err := json.Unmarshal(poster.posts[1].bodyContent, &summary) - Ω(err).ShouldNot(HaveOccurred()) - specSummary.CapturedOutput = interceptor.InterceptedOutput - Ω(summary).Should(Equal(specSummary)) - }) - - It("should stop, then start intercepting output", func() { - Ω(interceptor.DidStopInterceptingOutput).Should(BeTrue()) - Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue()) - }) - }) - }) - - Context("When a suite ends", func() { - BeforeEach(func() { - reporter.SpecSuiteDidEnd(suiteSummary) - }) - - It("should POST the SuiteSummary to the Ginkgo server", func() { - Ω(poster.posts).Should(HaveLen(1)) - Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/SpecSuiteDidEnd")) - Ω(poster.posts[0].bodyType).Should(Equal("application/json")) - - var summary *types.SuiteSummary - - err := json.Unmarshal(poster.posts[0].bodyContent, &summary) - Ω(err).ShouldNot(HaveOccurred()) - - Ω(summary).Should(Equal(suiteSummary)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go deleted file mode 100644 index e6b4e9f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package remote_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestRemote(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Remote Spec Forwarding Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go deleted file mode 100644 index 36bd003..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go +++ /dev/null @@ -1,269 +0,0 @@ -package remote_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/remote" - . "github.com/onsi/gomega" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/reporters" - "github.com/onsi/ginkgo/types" - - "bytes" - "encoding/json" - "net/http" -) - -var _ = Describe("Server", func() { - var ( - server *Server - ) - - BeforeEach(func() { - var err error - server, err = NewServer(3) - Ω(err).ShouldNot(HaveOccurred()) - - server.Start() - }) - - AfterEach(func() { - server.Close() - }) - - Describe("Streaming endpoints", func() { - var ( - reporterA, reporterB *reporters.FakeReporter - forwardingReporter *ForwardingReporter - - suiteSummary *types.SuiteSummary - setupSummary *types.SetupSummary - specSummary *types.SpecSummary - ) - - BeforeEach(func() { - reporterA = reporters.NewFakeReporter() - reporterB = reporters.NewFakeReporter() - - server.RegisterReporters(reporterA, reporterB) - - forwardingReporter = NewForwardingReporter(config.DefaultReporterConfigType{}, server.Address(), &http.Client{}, &fakeOutputInterceptor{}, nil, "") - - suiteSummary = &types.SuiteSummary{ - SuiteDescription: "My Test Suite", - } - - setupSummary = &types.SetupSummary{ - State: types.SpecStatePassed, - } - - specSummary = &types.SpecSummary{ - ComponentTexts: []string{"My", "Spec"}, - State: types.SpecStatePassed, - } - }) - - It("should make its address available", func() { - Ω(server.Address()).Should(MatchRegexp(`http://127.0.0.1:\d{2,}`)) - }) - - Describe("/SpecSuiteWillBegin", func() { - It("should decode and forward the Ginkgo config and suite summary", func(done Done) { - forwardingReporter.SpecSuiteWillBegin(config.GinkgoConfig, suiteSummary) - Ω(reporterA.Config).Should(Equal(config.GinkgoConfig)) - Ω(reporterB.Config).Should(Equal(config.GinkgoConfig)) - Ω(reporterA.BeginSummary).Should(Equal(suiteSummary)) - Ω(reporterB.BeginSummary).Should(Equal(suiteSummary)) - close(done) - }) - }) - - Describe("/BeforeSuiteDidRun", func() { - It("should decode and forward the setup summary", func() { - forwardingReporter.BeforeSuiteDidRun(setupSummary) - Ω(reporterA.BeforeSuiteSummary).Should(Equal(setupSummary)) - Ω(reporterB.BeforeSuiteSummary).Should(Equal(setupSummary)) - }) - }) - - Describe("/AfterSuiteDidRun", func() { - It("should decode and forward the setup summary", func() { - forwardingReporter.AfterSuiteDidRun(setupSummary) - Ω(reporterA.AfterSuiteSummary).Should(Equal(setupSummary)) - Ω(reporterB.AfterSuiteSummary).Should(Equal(setupSummary)) - }) - }) - - Describe("/SpecWillRun", func() { - It("should decode and forward the spec summary", func(done Done) { - forwardingReporter.SpecWillRun(specSummary) - Ω(reporterA.SpecWillRunSummaries[0]).Should(Equal(specSummary)) - Ω(reporterB.SpecWillRunSummaries[0]).Should(Equal(specSummary)) - close(done) - }) - }) - - Describe("/SpecDidComplete", func() { - It("should decode and forward the spec summary", func(done Done) { - forwardingReporter.SpecDidComplete(specSummary) - Ω(reporterA.SpecSummaries[0]).Should(Equal(specSummary)) - Ω(reporterB.SpecSummaries[0]).Should(Equal(specSummary)) - close(done) - }) - }) - - Describe("/SpecSuiteDidEnd", func() { - It("should decode and forward the suite summary", func(done Done) { - forwardingReporter.SpecSuiteDidEnd(suiteSummary) - Ω(reporterA.EndSummary).Should(Equal(suiteSummary)) - Ω(reporterB.EndSummary).Should(Equal(suiteSummary)) - close(done) - }) - }) - }) - - Describe("Synchronization endpoints", func() { - Describe("GETting and POSTing BeforeSuiteState", func() { - getBeforeSuite := func() types.RemoteBeforeSuiteData { - resp, err := http.Get(server.Address() + "/BeforeSuiteState") - Ω(err).ShouldNot(HaveOccurred()) - Ω(resp.StatusCode).Should(Equal(http.StatusOK)) - - r := types.RemoteBeforeSuiteData{} - decoder := json.NewDecoder(resp.Body) - err = decoder.Decode(&r) - Ω(err).ShouldNot(HaveOccurred()) - - return r - } - - postBeforeSuite := func(r types.RemoteBeforeSuiteData) { - resp, err := http.Post(server.Address()+"/BeforeSuiteState", "application/json", bytes.NewReader(r.ToJSON())) - Ω(err).ShouldNot(HaveOccurred()) - Ω(resp.StatusCode).Should(Equal(http.StatusOK)) - } - - Context("when the first node's Alive has not been registered yet", func() { - It("should return pending", func() { - state := getBeforeSuite() - Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending})) - - state = getBeforeSuite() - Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending})) - }) - }) - - Context("when the first node is Alive but has not responded yet", func() { - BeforeEach(func() { - server.RegisterAlive(1, func() bool { - return true - }) - }) - - It("should return pending", func() { - state := getBeforeSuite() - Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending})) - - state = getBeforeSuite() - Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending})) - }) - }) - - Context("when the first node has responded", func() { - var state types.RemoteBeforeSuiteData - BeforeEach(func() { - server.RegisterAlive(1, func() bool { - return false - }) - - state = types.RemoteBeforeSuiteData{ - Data: []byte("my data"), - State: types.RemoteBeforeSuiteStatePassed, - } - postBeforeSuite(state) - }) - - It("should return the passed in state", func() { - returnedState := getBeforeSuite() - Ω(returnedState).Should(Equal(state)) - }) - }) - - Context("when the first node is no longer Alive and has not responded yet", func() { - BeforeEach(func() { - server.RegisterAlive(1, func() bool { - return false - }) - }) - - It("should return disappeared", func() { - state := getBeforeSuite() - Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStateDisappeared})) - - state = getBeforeSuite() - Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStateDisappeared})) - }) - }) - }) - - Describe("GETting RemoteAfterSuiteData", func() { - getRemoteAfterSuiteData := func() bool { - resp, err := http.Get(server.Address() + "/RemoteAfterSuiteData") - Ω(err).ShouldNot(HaveOccurred()) - Ω(resp.StatusCode).Should(Equal(http.StatusOK)) - - a := types.RemoteAfterSuiteData{} - decoder := json.NewDecoder(resp.Body) - err = decoder.Decode(&a) - Ω(err).ShouldNot(HaveOccurred()) - - return a.CanRun - } - - Context("when there are unregistered nodes", func() { - BeforeEach(func() { - server.RegisterAlive(2, func() bool { - return false - }) - }) - - It("should return false", func() { - Ω(getRemoteAfterSuiteData()).Should(BeFalse()) - }) - }) - - Context("when all none-node-1 nodes are still running", func() { - BeforeEach(func() { - server.RegisterAlive(2, func() bool { - return true - }) - - server.RegisterAlive(3, func() bool { - return false - }) - }) - - It("should return false", func() { - Ω(getRemoteAfterSuiteData()).Should(BeFalse()) - }) - }) - - Context("when all none-1 nodes are done", func() { - BeforeEach(func() { - server.RegisterAlive(2, func() bool { - return false - }) - - server.RegisterAlive(3, func() bool { - return false - }) - }) - - It("should return true", func() { - Ω(getRemoteAfterSuiteData()).Should(BeTrue()) - }) - - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go deleted file mode 100644 index 8681a72..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package spec_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestSpec(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Spec Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go deleted file mode 100644 index b4a2c9c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go +++ /dev/null @@ -1,739 +0,0 @@ -package spec_test - -import ( - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" - - . "github.com/onsi/ginkgo/internal/spec" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/containernode" - Failer "github.com/onsi/ginkgo/internal/failer" - "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/types" -) - -var noneFlag = types.FlagTypeNone -var focusedFlag = types.FlagTypeFocused -var pendingFlag = types.FlagTypePending - -var _ = Describe("Spec", func() { - var ( - failer *Failer.Failer - codeLocation types.CodeLocation - nodesThatRan []string - spec *Spec - buffer *gbytes.Buffer - ) - - newBody := func(text string, fail bool) func() { - return func() { - nodesThatRan = append(nodesThatRan, text) - if fail { - failer.Fail(text, codeLocation) - } - } - } - - newIt := func(text string, flag types.FlagType, fail bool) *leafnodes.ItNode { - return leafnodes.NewItNode(text, newBody(text, fail), flag, codeLocation, 0, failer, 0) - } - - newItWithBody := func(text string, body interface{}) *leafnodes.ItNode { - return leafnodes.NewItNode(text, body, noneFlag, codeLocation, 0, failer, 0) - } - - newMeasure := func(text string, flag types.FlagType, fail bool, samples int) *leafnodes.MeasureNode { - return leafnodes.NewMeasureNode(text, func(Benchmarker) { - nodesThatRan = append(nodesThatRan, text) - if fail { - failer.Fail(text, codeLocation) - } - }, flag, codeLocation, samples, failer, 0) - } - - newBef := func(text string, fail bool) leafnodes.BasicNode { - return leafnodes.NewBeforeEachNode(newBody(text, fail), codeLocation, 0, failer, 0) - } - - newAft := func(text string, fail bool) leafnodes.BasicNode { - return leafnodes.NewAfterEachNode(newBody(text, fail), codeLocation, 0, failer, 0) - } - - newJusBef := func(text string, fail bool) leafnodes.BasicNode { - return leafnodes.NewJustBeforeEachNode(newBody(text, fail), codeLocation, 0, failer, 0) - } - - newJusAft := func(text string, fail bool) leafnodes.BasicNode { - return leafnodes.NewJustAfterEachNode(newBody(text, fail), codeLocation, 0, failer, 0) - } - - newContainer := func(text string, flag types.FlagType, setupNodes ...leafnodes.BasicNode) *containernode.ContainerNode { - c := containernode.New(text, flag, codeLocation) - for _, node := range setupNodes { - c.PushSetupNode(node) - } - return c - } - - containers := func(containers ...*containernode.ContainerNode) []*containernode.ContainerNode { - return containers - } - - BeforeEach(func() { - buffer = gbytes.NewBuffer() - failer = Failer.New() - codeLocation = codelocation.New(0) - nodesThatRan = []string{} - }) - - Describe("marking specs focused and pending", func() { - It("should satisfy various caes", func() { - cases := []struct { - ContainerFlags []types.FlagType - SubjectFlag types.FlagType - Pending bool - Focused bool - }{ - {[]types.FlagType{}, noneFlag, false, false}, - {[]types.FlagType{}, focusedFlag, false, true}, - {[]types.FlagType{}, pendingFlag, true, false}, - {[]types.FlagType{noneFlag}, noneFlag, false, false}, - {[]types.FlagType{focusedFlag}, noneFlag, false, true}, - {[]types.FlagType{pendingFlag}, noneFlag, true, false}, - {[]types.FlagType{noneFlag}, focusedFlag, false, true}, - {[]types.FlagType{focusedFlag}, focusedFlag, false, true}, - {[]types.FlagType{pendingFlag}, focusedFlag, true, true}, - {[]types.FlagType{noneFlag}, pendingFlag, true, false}, - {[]types.FlagType{focusedFlag}, pendingFlag, true, true}, - {[]types.FlagType{pendingFlag}, pendingFlag, true, false}, - {[]types.FlagType{focusedFlag, noneFlag}, noneFlag, false, true}, - {[]types.FlagType{noneFlag, focusedFlag}, noneFlag, false, true}, - {[]types.FlagType{pendingFlag, noneFlag}, noneFlag, true, false}, - {[]types.FlagType{noneFlag, pendingFlag}, noneFlag, true, false}, - {[]types.FlagType{focusedFlag, pendingFlag}, noneFlag, true, true}, - } - - for i, c := range cases { - subject := newIt("it node", c.SubjectFlag, false) - containers := []*containernode.ContainerNode{} - for _, flag := range c.ContainerFlags { - containers = append(containers, newContainer("container", flag)) - } - - spec := New(subject, containers, false) - Ω(spec.Pending()).Should(Equal(c.Pending), "Case %d: %#v", i, c) - Ω(spec.Focused()).Should(Equal(c.Focused), "Case %d: %#v", i, c) - - if c.Pending { - Ω(spec.Summary("").State).Should(Equal(types.SpecStatePending)) - } - } - }) - }) - - Describe("Skip", func() { - It("should be skipped", func() { - spec := New(newIt("it node", noneFlag, false), containers(newContainer("container", noneFlag)), false) - Ω(spec.Skipped()).Should(BeFalse()) - spec.Skip() - Ω(spec.Skipped()).Should(BeTrue()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStateSkipped)) - }) - }) - - Describe("IsMeasurement", func() { - It("should be true if the subject is a measurement node", func() { - spec := New(newIt("it node", noneFlag, false), containers(newContainer("container", noneFlag)), false) - Ω(spec.IsMeasurement()).Should(BeFalse()) - Ω(spec.Summary("").IsMeasurement).Should(BeFalse()) - Ω(spec.Summary("").NumberOfSamples).Should(Equal(1)) - - spec = New(newMeasure("measure node", noneFlag, false, 10), containers(newContainer("container", noneFlag)), false) - Ω(spec.IsMeasurement()).Should(BeTrue()) - Ω(spec.Summary("").IsMeasurement).Should(BeTrue()) - Ω(spec.Summary("").NumberOfSamples).Should(Equal(10)) - }) - }) - - Describe("Passed", func() { - It("should pass when the subject passed", func() { - spec := New(newIt("it node", noneFlag, false), containers(), false) - spec.Run(buffer) - - Ω(spec.Passed()).Should(BeTrue()) - Ω(spec.Failed()).Should(BeFalse()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStatePassed)) - Ω(spec.Summary("").Failure).Should(BeZero()) - }) - }) - - Describe("Flaked", func() { - It("should work if Run is called twice and gets different results", func() { - i := 0 - spec := New(newItWithBody("flaky it", func() { - i++ - if i == 1 { - failer.Fail("oops", codeLocation) - } - }), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(spec.Flaked()).Should(BeFalse()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStateFailed)) - Ω(spec.Summary("").Failure.Message).Should(Equal("oops")) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeTrue()) - Ω(spec.Failed()).Should(BeFalse()) - Ω(spec.Flaked()).Should(BeTrue()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStatePassed)) - }) - }) - - Describe("Failed", func() { - It("should be failed if the failure was panic", func() { - spec := New(newItWithBody("panicky it", func() { - panic("bam") - }), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStatePanicked)) - Ω(spec.Summary("").Failure.Message).Should(Equal("Test Panicked")) - Ω(spec.Summary("").Failure.ForwardedPanic).Should(Equal("bam")) - }) - - It("should be failed if the failure was a timeout", func() { - spec := New(newItWithBody("sleepy it", func(done Done) {}), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStateTimedOut)) - Ω(spec.Summary("").Failure.Message).Should(Equal("Timed out")) - }) - - It("should be failed if the failure was... a failure", func() { - spec := New(newItWithBody("failing it", func() { - failer.Fail("bam", codeLocation) - }), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(spec.Summary("").State).Should(Equal(types.SpecStateFailed)) - Ω(spec.Summary("").Failure.Message).Should(Equal("bam")) - }) - }) - - Describe("Concatenated string", func() { - It("should concatenate the texts of the containers and the subject", func() { - spec := New( - newIt("it node", noneFlag, false), - containers( - newContainer("outer container", noneFlag), - newContainer("inner container", noneFlag), - ), - false, - ) - - Ω(spec.ConcatenatedString()).Should(Equal("outer container inner container it node")) - }) - }) - - Describe("running it specs", func() { - Context("with just an it", func() { - Context("that succeeds", func() { - It("should run the it and report on its success", func() { - spec := New(newIt("it node", noneFlag, false), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeTrue()) - Ω(spec.Failed()).Should(BeFalse()) - Ω(nodesThatRan).Should(Equal([]string{"it node"})) - }) - }) - - Context("that fails", func() { - It("should run the it and report on its success", func() { - spec := New(newIt("it node", noneFlag, true), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(spec.Summary("").Failure.Message).Should(Equal("it node")) - Ω(nodesThatRan).Should(Equal([]string{"it node"})) - }) - }) - }) - - Context("with a full set of setup nodes", func() { - var failingNodes map[string]bool - - BeforeEach(func() { - failingNodes = map[string]bool{} - }) - - JustBeforeEach(func() { - spec = New( - newIt("it node", noneFlag, failingNodes["it node"]), - containers( - newContainer("outer container", noneFlag, - newBef("outer bef A", failingNodes["outer bef A"]), - newBef("outer bef B", failingNodes["outer bef B"]), - newJusBef("outer jusbef A", failingNodes["outer jusbef A"]), - newJusBef("outer jusbef B", failingNodes["outer jusbef B"]), - newJusAft("outer jusaft A", failingNodes["outer jusaft A"]), - newJusAft("outer jusaft B", failingNodes["outer jusaft B"]), - newAft("outer aft A", failingNodes["outer aft A"]), - newAft("outer aft B", failingNodes["outer aft B"]), - ), - newContainer("inner container", noneFlag, - newBef("inner bef A", failingNodes["inner bef A"]), - newBef("inner bef B", failingNodes["inner bef B"]), - newJusBef("inner jusbef A", failingNodes["inner jusbef A"]), - newJusBef("inner jusbef B", failingNodes["inner jusbef B"]), - newJusAft("inner jusaft A", failingNodes["inner jusaft A"]), - newJusAft("inner jusaft B", failingNodes["inner jusaft B"]), - newAft("inner aft A", failingNodes["inner aft A"]), - newAft("inner aft B", failingNodes["inner aft B"]), - ), - ), - false, - ) - spec.Run(buffer) - }) - - Context("that all pass", func() { - It("should walk through the nodes in the correct order", func() { - Ω(spec.Passed()).Should(BeTrue()) - Ω(spec.Failed()).Should(BeFalse()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner bef B", - "outer jusbef A", - "outer jusbef B", - "inner jusbef A", - "inner jusbef B", - "it node", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - }) - }) - - Context("when the subject fails", func() { - BeforeEach(func() { - failingNodes["it node"] = true - }) - - It("should run the afters", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner bef B", - "outer jusbef A", - "outer jusbef B", - "inner jusbef A", - "inner jusbef B", - "it node", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("it node")) - }) - }) - - Context("when an inner before fails", func() { - BeforeEach(func() { - failingNodes["inner bef A"] = true - }) - - It("should not run any other befores, but it should run the subsequent afters", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("inner bef A")) - }) - }) - - Context("when an outer before fails", func() { - BeforeEach(func() { - failingNodes["outer bef B"] = true - }) - - It("should not run any other befores, but it should run the subsequent afters", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "outer jusaft A", - "outer jusaft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("outer bef B")) - }) - }) - - Context("when an after fails", func() { - BeforeEach(func() { - failingNodes["inner aft B"] = true - }) - - It("should run all other afters, but mark the test as failed", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner bef B", - "outer jusbef A", - "outer jusbef B", - "inner jusbef A", - "inner jusbef B", - "it node", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("inner aft B")) - }) - }) - - Context("when a just before each fails", func() { - BeforeEach(func() { - failingNodes["outer jusbef B"] = true - }) - - It("should run the afters, but not the subject", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner bef B", - "outer jusbef A", - "outer jusbef B", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("outer jusbef B")) - }) - }) - - Context("when a just after each fails", func() { - BeforeEach(func() { - failingNodes["outer jusaft A"] = true - }) - - It("should run all other afters, but mark the test as failed", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner bef B", - "outer jusbef A", - "outer jusbef B", - "inner jusbef A", - "inner jusbef B", - "it node", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("outer jusaft A")) - }) - }) - - Context("when an after fails after an earlier node has failed", func() { - BeforeEach(func() { - failingNodes["it node"] = true - failingNodes["inner aft B"] = true - }) - - It("should record the earlier failure", func() { - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "outer bef A", - "outer bef B", - "inner bef A", - "inner bef B", - "outer jusbef A", - "outer jusbef B", - "inner jusbef A", - "inner jusbef B", - "it node", - "inner jusaft A", - "inner jusaft B", - "outer jusaft A", - "outer jusaft B", - "inner aft A", - "inner aft B", - "outer aft A", - "outer aft B", - })) - Ω(spec.Summary("").Failure.Message).Should(Equal("it node")) - }) - }) - }) - }) - - Describe("running measurement specs", func() { - Context("when the measurement succeeds", func() { - It("should run N samples", func() { - spec = New( - newMeasure("measure node", noneFlag, false, 3), - containers( - newContainer("container", noneFlag, - newBef("bef A", false), - newJusBef("jusbef A", false), - newJusAft("jusaft A", false), - newAft("aft A", false), - ), - ), - false, - ) - spec.Run(buffer) - - Ω(spec.Passed()).Should(BeTrue()) - Ω(spec.Failed()).Should(BeFalse()) - Ω(nodesThatRan).Should(Equal([]string{ - "bef A", - "jusbef A", - "measure node", - "jusaft A", - "aft A", - "bef A", - "jusbef A", - "measure node", - "jusaft A", - "aft A", - "bef A", - "jusbef A", - "measure node", - "jusaft A", - "aft A", - })) - }) - }) - - Context("when the measurement fails", func() { - It("should bail after the failure occurs", func() { - spec = New( - newMeasure("measure node", noneFlag, true, 3), - containers( - newContainer("container", noneFlag, - newBef("bef A", false), - newJusBef("jusbef A", false), - newJusAft("jusaft A", false), - newAft("aft A", false), - ), - ), - false, - ) - spec.Run(buffer) - - Ω(spec.Passed()).Should(BeFalse()) - Ω(spec.Failed()).Should(BeTrue()) - Ω(nodesThatRan).Should(Equal([]string{ - "bef A", - "jusbef A", - "measure node", - "jusaft A", - "aft A", - })) - }) - }) - }) - - Describe("Summary", func() { - var ( - subjectCodeLocation types.CodeLocation - outerContainerCodeLocation types.CodeLocation - innerContainerCodeLocation types.CodeLocation - summary *types.SpecSummary - ) - - BeforeEach(func() { - subjectCodeLocation = codelocation.New(0) - outerContainerCodeLocation = codelocation.New(0) - innerContainerCodeLocation = codelocation.New(0) - - spec = New( - leafnodes.NewItNode("it node", func() { - time.Sleep(10 * time.Millisecond) - }, noneFlag, subjectCodeLocation, 0, failer, 0), - containers( - containernode.New("outer container", noneFlag, outerContainerCodeLocation), - containernode.New("inner container", noneFlag, innerContainerCodeLocation), - ), - false, - ) - - spec.Run(buffer) - Ω(spec.Passed()).Should(BeTrue()) - summary = spec.Summary("suite id") - }) - - It("should have the suite id", func() { - Ω(summary.SuiteID).Should(Equal("suite id")) - }) - - It("should have the component texts and code locations", func() { - Ω(summary.ComponentTexts).Should(Equal([]string{"outer container", "inner container", "it node"})) - Ω(summary.ComponentCodeLocations).Should(Equal([]types.CodeLocation{outerContainerCodeLocation, innerContainerCodeLocation, subjectCodeLocation})) - }) - - It("should have a runtime", func() { - Ω(summary.RunTime).Should(BeNumerically(">=", 10*time.Millisecond)) - }) - - It("should have a runtime which remains consistent after spec run", func() { - totalRunTime := summary.RunTime - Ω(totalRunTime).Should(BeNumerically(">=", 10*time.Millisecond)) - - Consistently(func() time.Duration { return spec.Summary("suite id").RunTime }).Should(Equal(totalRunTime)) - }) - - It("should not be a measurement, or have a measurement summary", func() { - Ω(summary.IsMeasurement).Should(BeFalse()) - Ω(summary.Measurements).Should(BeEmpty()) - }) - }) - - Describe("Summaries for measurements", func() { - var summary *types.SpecSummary - - BeforeEach(func() { - spec = New(leafnodes.NewMeasureNode("measure node", func(b Benchmarker) { - b.RecordValue("a value", 7, "some info") - b.RecordValueWithPrecision("another value", 8, "ns", 5, "more info") - }, noneFlag, codeLocation, 4, failer, 0), containers(), false) - spec.Run(buffer) - Ω(spec.Passed()).Should(BeTrue()) - summary = spec.Summary("suite id") - }) - - It("should include the number of samples", func() { - Ω(summary.NumberOfSamples).Should(Equal(4)) - }) - - It("should be a measurement", func() { - Ω(summary.IsMeasurement).Should(BeTrue()) - }) - - It("should have the measurements report", func() { - Ω(summary.Measurements).Should(HaveKey("a value")) - report := summary.Measurements["a value"] - Ω(report.Name).Should(Equal("a value")) - Ω(report.Info).Should(Equal("some info")) - Ω(report.Results).Should(Equal([]float64{7, 7, 7, 7})) - - Ω(summary.Measurements).Should(HaveKey("another value")) - report = summary.Measurements["another value"] - Ω(report.Name).Should(Equal("another value")) - Ω(report.Info).Should(Equal("more info")) - Ω(report.Results).Should(Equal([]float64{8, 8, 8, 8})) - Ω(report.Units).Should(Equal("ns")) - Ω(report.Precision).Should(Equal(5)) - }) - }) - - Describe("When told to emit progress", func() { - It("should emit progress to the writer as it runs Befores, JustBefores, Afters, and Its", func() { - spec = New( - newIt("it node", noneFlag, false), - containers( - newContainer("outer container", noneFlag, - newBef("outer bef A", false), - newJusBef("outer jusbef A", false), - newJusAft("outer jusaft A", false), - newAft("outer aft A", false), - ), - newContainer("inner container", noneFlag, - newBef("inner bef A", false), - newJusBef("inner jusbef A", false), - newJusAft("inner jusaft A", false), - newAft("inner aft A", false), - ), - ), - true, - ) - spec.Run(buffer) - - Ω(buffer).Should(gbytes.Say(`\[BeforeEach\] outer container`)) - Ω(buffer).Should(gbytes.Say(`\[BeforeEach\] inner container`)) - Ω(buffer).Should(gbytes.Say(`\[JustBeforeEach\] outer container`)) - Ω(buffer).Should(gbytes.Say(`\[JustBeforeEach\] inner container`)) - Ω(buffer).Should(gbytes.Say(`\[It\] it node`)) - Ω(buffer).Should(gbytes.Say(`\[JustAfterEach\] inner container`)) - Ω(buffer).Should(gbytes.Say(`\[JustAfterEach\] outer container`)) - Ω(buffer).Should(gbytes.Say(`\[AfterEach\] inner container`)) - Ω(buffer).Should(gbytes.Say(`\[AfterEach\] outer container`)) - }) - - It("should emit progress to the writer as it runs Befores, JustBefores, JustAfters, Afters, and Measures", func() { - spec = New( - newMeasure("measure node", noneFlag, false, 2), - containers(), - true, - ) - spec.Run(buffer) - - Ω(buffer).Should(gbytes.Say(`\[Measure\] measure node`)) - Ω(buffer).Should(gbytes.Say(`\[Measure\] measure node`)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go deleted file mode 100644 index 066fbbb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package spec_test - -import ( - "math/rand" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/spec" - . "github.com/onsi/gomega" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/containernode" - "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("Specs", func() { - var specs *Specs - - newSpec := func(text string, flag types.FlagType) *Spec { - subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0) - return New(subject, []*containernode.ContainerNode{}, false) - } - - newMeasureSpec := func(text string, flag types.FlagType) *Spec { - subject := leafnodes.NewMeasureNode(text, func(Benchmarker) {}, flag, codelocation.New(0), 0, nil, 0) - return New(subject, []*containernode.ContainerNode{}, false) - } - - newSpecs := func(args ...interface{}) *Specs { - specs := []*Spec{} - for index := 0; index < len(args)-1; index += 2 { - specs = append(specs, newSpec(args[index].(string), args[index+1].(types.FlagType))) - } - return NewSpecs(specs) - } - - specTexts := func(specs *Specs) []string { - texts := []string{} - for _, spec := range specs.Specs() { - texts = append(texts, spec.ConcatenatedString()) - } - return texts - } - - willRunTexts := func(specs *Specs) []string { - texts := []string{} - for _, spec := range specs.Specs() { - if !(spec.Skipped() || spec.Pending()) { - texts = append(texts, spec.ConcatenatedString()) - } - } - return texts - } - - skippedTexts := func(specs *Specs) []string { - texts := []string{} - for _, spec := range specs.Specs() { - if spec.Skipped() { - texts = append(texts, spec.ConcatenatedString()) - } - } - return texts - } - - pendingTexts := func(specs *Specs) []string { - texts := []string{} - for _, spec := range specs.Specs() { - if spec.Pending() { - texts = append(texts, spec.ConcatenatedString()) - } - } - return texts - } - - Describe("Shuffling specs", func() { - It("should shuffle the specs using the passed in randomizer", func() { - specs17 := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag) - specs17.Shuffle(rand.New(rand.NewSource(17))) - texts17 := specTexts(specs17) - - specs17Again := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag) - specs17Again.Shuffle(rand.New(rand.NewSource(17))) - texts17Again := specTexts(specs17Again) - - specs15 := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag) - specs15.Shuffle(rand.New(rand.NewSource(15))) - texts15 := specTexts(specs15) - - specsUnshuffled := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag) - textsUnshuffled := specTexts(specsUnshuffled) - - Ω(textsUnshuffled).Should(Equal([]string{"C", "A", "B"})) - - Ω(texts17).Should(Equal(texts17Again)) - Ω(texts17).ShouldNot(Equal(texts15)) - Ω(texts17).ShouldNot(Equal(textsUnshuffled)) - Ω(texts15).ShouldNot(Equal(textsUnshuffled)) - - Ω(texts17).Should(HaveLen(3)) - Ω(texts17).Should(ContainElement("A")) - Ω(texts17).Should(ContainElement("B")) - Ω(texts17).Should(ContainElement("C")) - - Ω(texts15).Should(HaveLen(3)) - Ω(texts15).Should(ContainElement("A")) - Ω(texts15).Should(ContainElement("B")) - Ω(texts15).Should(ContainElement("C")) - }) - }) - - Describe("with no programmatic focus", func() { - BeforeEach(func() { - specs = newSpecs("A1", noneFlag, "A2", noneFlag, "B1", noneFlag, "B2", pendingFlag) - specs.ApplyFocus("", "", "") - }) - - It("should not report as having programmatic specs", func() { - Ω(specs.HasProgrammaticFocus()).Should(BeFalse()) - }) - }) - - Describe("Applying focus/skip", func() { - var description, focusString, skipString string - - BeforeEach(func() { - description, focusString, skipString = "", "", "" - }) - - JustBeforeEach(func() { - specs = newSpecs("A1", focusedFlag, "A2", noneFlag, "B1", focusedFlag, "B2", pendingFlag) - specs.ApplyFocus(description, focusString, skipString) - }) - - Context("with neither a focus string nor a skip string", func() { - It("should apply the programmatic focus", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"A1", "B1"})) - Ω(skippedTexts(specs)).Should(Equal([]string{"A2", "B2"})) - Ω(pendingTexts(specs)).Should(BeEmpty()) - }) - - It("should report as having programmatic specs", func() { - Ω(specs.HasProgrammaticFocus()).Should(BeTrue()) - }) - }) - - Context("with a focus regexp", func() { - BeforeEach(func() { - focusString = "A" - }) - - It("should override the programmatic focus", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"A1", "A2"})) - Ω(skippedTexts(specs)).Should(Equal([]string{"B1", "B2"})) - Ω(pendingTexts(specs)).Should(BeEmpty()) - }) - - It("should not report as having programmatic specs", func() { - Ω(specs.HasProgrammaticFocus()).Should(BeFalse()) - }) - }) - - Context("with a focus regexp", func() { - BeforeEach(func() { - focusString = "B" - }) - - It("should not override any pendings", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"B1"})) - Ω(skippedTexts(specs)).Should(Equal([]string{"A1", "A2"})) - Ω(pendingTexts(specs)).Should(Equal([]string{"B2"})) - }) - }) - - Context("with a description", func() { - BeforeEach(func() { - description = "C" - focusString = "C" - }) - - It("should include the description in the focus determination", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"A1", "A2", "B1"})) - Ω(skippedTexts(specs)).Should(BeEmpty()) - Ω(pendingTexts(specs)).Should(Equal([]string{"B2"})) - }) - }) - - Context("with a description", func() { - BeforeEach(func() { - description = "C" - skipString = "C" - }) - - It("should include the description in the focus determination", func() { - Ω(willRunTexts(specs)).Should(BeEmpty()) - Ω(skippedTexts(specs)).Should(Equal([]string{"A1", "A2", "B1", "B2"})) - Ω(pendingTexts(specs)).Should(BeEmpty()) - }) - }) - - Context("with a skip regexp", func() { - BeforeEach(func() { - skipString = "A" - }) - - It("should override the programmatic focus", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"B1"})) - Ω(skippedTexts(specs)).Should(Equal([]string{"A1", "A2"})) - Ω(pendingTexts(specs)).Should(Equal([]string{"B2"})) - }) - - It("should not report as having programmatic specs", func() { - Ω(specs.HasProgrammaticFocus()).Should(BeFalse()) - }) - }) - - Context("with both a focus and a skip regexp", func() { - BeforeEach(func() { - focusString = "1" - skipString = "B" - }) - - It("should AND the two", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"A1"})) - Ω(skippedTexts(specs)).Should(Equal([]string{"A2", "B1", "B2"})) - Ω(pendingTexts(specs)).Should(BeEmpty()) - }) - - It("should not report as having programmatic specs", func() { - Ω(specs.HasProgrammaticFocus()).Should(BeFalse()) - }) - }) - }) - - Describe("With a focused spec within a pending context and a pending spec within a focused context", func() { - BeforeEach(func() { - pendingInFocused := New( - leafnodes.NewItNode("PendingInFocused", func() {}, pendingFlag, codelocation.New(0), 0, nil, 0), - []*containernode.ContainerNode{ - containernode.New("", focusedFlag, codelocation.New(0)), - }, false) - - focusedInPending := New( - leafnodes.NewItNode("FocusedInPending", func() {}, focusedFlag, codelocation.New(0), 0, nil, 0), - []*containernode.ContainerNode{ - containernode.New("", pendingFlag, codelocation.New(0)), - }, false) - - specs = NewSpecs([]*Spec{ - newSpec("A", noneFlag), - newSpec("B", noneFlag), - pendingInFocused, - focusedInPending, - }) - specs.ApplyFocus("", "", "") - }) - - It("should not have a programmatic focus and should run all tests", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"A", "B"})) - Ω(skippedTexts(specs)).Should(BeEmpty()) - Ω(pendingTexts(specs)).Should(ConsistOf(ContainSubstring("PendingInFocused"), ContainSubstring("FocusedInPending"))) - }) - }) - - Describe("skipping measurements", func() { - BeforeEach(func() { - specs = NewSpecs([]*Spec{ - newSpec("A", noneFlag), - newSpec("B", noneFlag), - newSpec("C", pendingFlag), - newMeasureSpec("measurementA", noneFlag), - newMeasureSpec("measurementB", pendingFlag), - }) - }) - - It("should skip measurements", func() { - Ω(willRunTexts(specs)).Should(Equal([]string{"A", "B", "measurementA"})) - Ω(skippedTexts(specs)).Should(BeEmpty()) - Ω(pendingTexts(specs)).Should(Equal([]string{"C", "measurementB"})) - - specs.SkipMeasurements() - - Ω(willRunTexts(specs)).Should(Equal([]string{"A", "B"})) - Ω(skippedTexts(specs)).Should(Equal([]string{"measurementA", "measurementB"})) - Ω(pendingTexts(specs)).Should(Equal([]string{"C"})) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go deleted file mode 100644 index 65da983..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go +++ /dev/null @@ -1,149 +0,0 @@ -package spec_iterator_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/spec_iterator" - . "github.com/onsi/gomega" -) - -var _ = Describe("ParallelizedIndexRange", func() { - var startIndex, count int - - It("should return the correct index range for 4 tests on 2 nodes", func() { - startIndex, count = ParallelizedIndexRange(4, 2, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(4, 2, 2) - Ω(startIndex).Should(Equal(2)) - Ω(count).Should(Equal(2)) - }) - - It("should return the correct index range for 5 tests on 2 nodes", func() { - startIndex, count = ParallelizedIndexRange(5, 2, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(3)) - - startIndex, count = ParallelizedIndexRange(5, 2, 2) - Ω(startIndex).Should(Equal(3)) - Ω(count).Should(Equal(2)) - }) - - It("should return the correct index range for 5 tests on 3 nodes", func() { - startIndex, count = ParallelizedIndexRange(5, 3, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(5, 3, 2) - Ω(startIndex).Should(Equal(2)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(5, 3, 3) - Ω(startIndex).Should(Equal(4)) - Ω(count).Should(Equal(1)) - }) - - It("should return the correct index range for 5 tests on 4 nodes", func() { - startIndex, count = ParallelizedIndexRange(5, 4, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(5, 4, 2) - Ω(startIndex).Should(Equal(2)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 4, 3) - Ω(startIndex).Should(Equal(3)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 4, 4) - Ω(startIndex).Should(Equal(4)) - Ω(count).Should(Equal(1)) - }) - - It("should return the correct index range for 5 tests on 5 nodes", func() { - startIndex, count = ParallelizedIndexRange(5, 5, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 5, 2) - Ω(startIndex).Should(Equal(1)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 5, 3) - Ω(startIndex).Should(Equal(2)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 5, 4) - Ω(startIndex).Should(Equal(3)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 5, 5) - Ω(startIndex).Should(Equal(4)) - Ω(count).Should(Equal(1)) - }) - - It("should return the correct index range for 5 tests on 6 nodes", func() { - startIndex, count = ParallelizedIndexRange(5, 6, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 6, 2) - Ω(startIndex).Should(Equal(1)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 6, 3) - Ω(startIndex).Should(Equal(2)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 6, 4) - Ω(startIndex).Should(Equal(3)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 6, 5) - Ω(startIndex).Should(Equal(4)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(5, 6, 6) - Ω(count).Should(Equal(0)) - }) - - It("should return the correct index range for 5 tests on 7 nodes", func() { - startIndex, count = ParallelizedIndexRange(5, 7, 6) - Ω(count).Should(Equal(0)) - - startIndex, count = ParallelizedIndexRange(5, 7, 7) - Ω(count).Should(Equal(0)) - }) - - It("should return the correct index range for 11 tests on 7 nodes", func() { - startIndex, count = ParallelizedIndexRange(11, 7, 1) - Ω(startIndex).Should(Equal(0)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(11, 7, 2) - Ω(startIndex).Should(Equal(2)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(11, 7, 3) - Ω(startIndex).Should(Equal(4)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(11, 7, 4) - Ω(startIndex).Should(Equal(6)) - Ω(count).Should(Equal(2)) - - startIndex, count = ParallelizedIndexRange(11, 7, 5) - Ω(startIndex).Should(Equal(8)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(11, 7, 6) - Ω(startIndex).Should(Equal(9)) - Ω(count).Should(Equal(1)) - - startIndex, count = ParallelizedIndexRange(11, 7, 7) - Ω(startIndex).Should(Equal(10)) - Ω(count).Should(Equal(1)) - }) - -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go deleted file mode 100644 index c5a762f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package spec_iterator_test - -import ( - "net/http" - - . "github.com/onsi/ginkgo/internal/spec_iterator" - "github.com/onsi/gomega/ghttp" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/containernode" - "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/internal/spec" - "github.com/onsi/ginkgo/types" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("ParallelSpecIterator", func() { - var specs []*spec.Spec - var iterator *ParallelIterator - var server *ghttp.Server - - newSpec := func(text string, flag types.FlagType) *spec.Spec { - subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0) - return spec.New(subject, []*containernode.ContainerNode{}, false) - } - - BeforeEach(func() { - specs = []*spec.Spec{ - newSpec("A", types.FlagTypePending), - newSpec("B", types.FlagTypeNone), - newSpec("C", types.FlagTypeNone), - newSpec("D", types.FlagTypeNone), - } - specs[3].Skip() - - server = ghttp.NewServer() - - iterator = NewParallelIterator(specs, "http://"+server.Addr()) - }) - - AfterEach(func() { - server.Close() - }) - - It("should report the total number of specs", func() { - Ω(iterator.NumberOfSpecsPriorToIteration()).Should(Equal(4)) - }) - - It("should not report the number to be processed", func() { - n, known := iterator.NumberOfSpecsToProcessIfKnown() - Ω(n).Should(Equal(-1)) - Ω(known).Should(BeFalse()) - }) - - It("should not report the number that will be run", func() { - n, known := iterator.NumberOfSpecsThatWillBeRunIfKnown() - Ω(n).Should(Equal(-1)) - Ω(known).Should(BeFalse()) - }) - - Describe("iterating", func() { - Describe("when the server returns well-formed responses", func() { - BeforeEach(func() { - server.AppendHandlers( - ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 0}), - ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 1}), - ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 3}), - ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 4}), - ) - }) - - It("should return the specs in question", func() { - Ω(iterator.Next()).Should(Equal(specs[0])) - Ω(iterator.Next()).Should(Equal(specs[1])) - Ω(iterator.Next()).Should(Equal(specs[3])) - spec, err := iterator.Next() - Ω(spec).Should(BeNil()) - Ω(err).Should(MatchError(ErrClosed)) - }) - }) - - Describe("when the server 404s", func() { - BeforeEach(func() { - server.AppendHandlers( - ghttp.RespondWith(http.StatusNotFound, ""), - ) - }) - - It("should return an error", func() { - spec, err := iterator.Next() - Ω(spec).Should(BeNil()) - Ω(err).Should(MatchError("unexpected status code 404")) - }) - }) - - Describe("when the server returns gibberish", func() { - BeforeEach(func() { - server.AppendHandlers( - ghttp.RespondWith(http.StatusOK, "ß"), - ) - }) - - It("should error", func() { - spec, err := iterator.Next() - Ω(spec).Should(BeNil()) - Ω(err).ShouldNot(BeNil()) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go deleted file mode 100644 index dde4a34..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package spec_iterator_test - -import ( - . "github.com/onsi/ginkgo/internal/spec_iterator" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/containernode" - "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/internal/spec" - "github.com/onsi/ginkgo/types" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("SerialSpecIterator", func() { - var specs []*spec.Spec - var iterator *SerialIterator - - newSpec := func(text string, flag types.FlagType) *spec.Spec { - subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0) - return spec.New(subject, []*containernode.ContainerNode{}, false) - } - - BeforeEach(func() { - specs = []*spec.Spec{ - newSpec("A", types.FlagTypePending), - newSpec("B", types.FlagTypeNone), - newSpec("C", types.FlagTypeNone), - newSpec("D", types.FlagTypeNone), - } - specs[3].Skip() - - iterator = NewSerialIterator(specs) - }) - - It("should report the total number of specs", func() { - Ω(iterator.NumberOfSpecsPriorToIteration()).Should(Equal(4)) - }) - - It("should report the number to be processed", func() { - n, known := iterator.NumberOfSpecsToProcessIfKnown() - Ω(n).Should(Equal(4)) - Ω(known).Should(BeTrue()) - }) - - It("should report the number that will be run", func() { - n, known := iterator.NumberOfSpecsThatWillBeRunIfKnown() - Ω(n).Should(Equal(2)) - Ω(known).Should(BeTrue()) - }) - - Describe("iterating", func() { - It("should return the specs in order", func() { - Ω(iterator.Next()).Should(Equal(specs[0])) - Ω(iterator.Next()).Should(Equal(specs[1])) - Ω(iterator.Next()).Should(Equal(specs[2])) - Ω(iterator.Next()).Should(Equal(specs[3])) - spec, err := iterator.Next() - Ω(spec).Should(BeNil()) - Ω(err).Should(MatchError(ErrClosed)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go deleted file mode 100644 index c3786e0..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go +++ /dev/null @@ -1,62 +0,0 @@ -package spec_iterator_test - -import ( - . "github.com/onsi/ginkgo/internal/spec_iterator" - - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/containernode" - "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/internal/spec" - "github.com/onsi/ginkgo/types" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("ShardedParallelSpecIterator", func() { - var specs []*spec.Spec - var iterator *ShardedParallelIterator - - newSpec := func(text string, flag types.FlagType) *spec.Spec { - subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0) - return spec.New(subject, []*containernode.ContainerNode{}, false) - } - - BeforeEach(func() { - specs = []*spec.Spec{ - newSpec("A", types.FlagTypePending), - newSpec("B", types.FlagTypeNone), - newSpec("C", types.FlagTypeNone), - newSpec("D", types.FlagTypeNone), - } - specs[3].Skip() - - iterator = NewShardedParallelIterator(specs, 2, 1) - }) - - It("should report the total number of specs", func() { - Ω(iterator.NumberOfSpecsPriorToIteration()).Should(Equal(4)) - }) - - It("should report the number to be processed", func() { - n, known := iterator.NumberOfSpecsToProcessIfKnown() - Ω(n).Should(Equal(2)) - Ω(known).Should(BeTrue()) - }) - - It("should report the number that will be run", func() { - n, known := iterator.NumberOfSpecsThatWillBeRunIfKnown() - Ω(n).Should(Equal(1)) - Ω(known).Should(BeTrue()) - }) - - Describe("iterating", func() { - It("should return the specs in order", func() { - Ω(iterator.Next()).Should(Equal(specs[0])) - Ω(iterator.Next()).Should(Equal(specs[1])) - spec, err := iterator.Next() - Ω(spec).Should(BeNil()) - Ω(err).Should(MatchError(ErrClosed)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go deleted file mode 100644 index 5c08a77..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package spec_iterator_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestSpecIterator(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "SpecIterator Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go deleted file mode 100644 index c8388fb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package specrunner_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestSpecRunner(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Spec Runner Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go deleted file mode 100644 index a414379..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go +++ /dev/null @@ -1,785 +0,0 @@ -package specrunner_test - -import ( - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/internal/spec_iterator" - . "github.com/onsi/ginkgo/internal/specrunner" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/internal/containernode" - Failer "github.com/onsi/ginkgo/internal/failer" - "github.com/onsi/ginkgo/internal/leafnodes" - "github.com/onsi/ginkgo/internal/spec" - Writer "github.com/onsi/ginkgo/internal/writer" - "github.com/onsi/ginkgo/reporters" -) - -var noneFlag = types.FlagTypeNone -var pendingFlag = types.FlagTypePending - -var _ = Describe("Spec Runner", func() { - var ( - reporter1 *reporters.FakeReporter - reporter2 *reporters.FakeReporter - failer *Failer.Failer - writer *Writer.FakeGinkgoWriter - - thingsThatRan []string - - runner *SpecRunner - ) - - newBefSuite := func(text string, fail bool) leafnodes.SuiteNode { - return leafnodes.NewBeforeSuiteNode(func() { - writer.AddEvent(text) - thingsThatRan = append(thingsThatRan, text) - if fail { - failer.Fail(text, codelocation.New(0)) - } - }, codelocation.New(0), 0, failer) - } - - newAftSuite := func(text string, fail bool) leafnodes.SuiteNode { - return leafnodes.NewAfterSuiteNode(func() { - writer.AddEvent(text) - thingsThatRan = append(thingsThatRan, text) - if fail { - failer.Fail(text, codelocation.New(0)) - } - }, codelocation.New(0), 0, failer) - } - - newSpec := func(text string, flag types.FlagType, fail bool) *spec.Spec { - subject := leafnodes.NewItNode(text, func() { - writer.AddEvent(text) - thingsThatRan = append(thingsThatRan, text) - if fail { - failer.Fail(text, codelocation.New(0)) - } - }, flag, codelocation.New(0), 0, failer, 0) - - return spec.New(subject, []*containernode.ContainerNode{}, false) - } - - newFlakySpec := func(text string, flag types.FlagType, failures int) *spec.Spec { - runs := 0 - subject := leafnodes.NewItNode(text, func() { - writer.AddEvent(text) - thingsThatRan = append(thingsThatRan, text) - runs++ - if runs < failures { - failer.Fail(text, codelocation.New(0)) - } - }, flag, codelocation.New(0), 0, failer, 0) - - return spec.New(subject, []*containernode.ContainerNode{}, false) - } - - newSpecWithBody := func(text string, body interface{}) *spec.Spec { - subject := leafnodes.NewItNode(text, body, noneFlag, codelocation.New(0), 0, failer, 0) - - return spec.New(subject, []*containernode.ContainerNode{}, false) - } - - newRunner := func(config config.GinkgoConfigType, beforeSuiteNode leafnodes.SuiteNode, afterSuiteNode leafnodes.SuiteNode, specs ...*spec.Spec) *SpecRunner { - iterator := spec_iterator.NewSerialIterator(specs) - return New("description", beforeSuiteNode, iterator, afterSuiteNode, []reporters.Reporter{reporter1, reporter2}, writer, config) - } - - BeforeEach(func() { - reporter1 = reporters.NewFakeReporter() - reporter2 = reporters.NewFakeReporter() - writer = Writer.NewFake() - failer = Failer.New() - - thingsThatRan = []string{} - }) - - Describe("Running and Reporting", func() { - var specA, pendingSpec, anotherPendingSpec, failedSpec, specB, skippedSpec *spec.Spec - var willRunCalls, didCompleteCalls []string - var conf config.GinkgoConfigType - - JustBeforeEach(func() { - willRunCalls = []string{} - didCompleteCalls = []string{} - specA = newSpec("spec A", noneFlag, false) - pendingSpec = newSpec("pending spec", pendingFlag, false) - anotherPendingSpec = newSpec("another pending spec", pendingFlag, false) - failedSpec = newSpec("failed spec", noneFlag, true) - specB = newSpec("spec B", noneFlag, false) - skippedSpec = newSpec("skipped spec", noneFlag, false) - skippedSpec.Skip() - - reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) { - willRunCalls = append(willRunCalls, "Reporter1") - } - reporter2.SpecWillRunStub = func(specSummary *types.SpecSummary) { - willRunCalls = append(willRunCalls, "Reporter2") - } - - reporter1.SpecDidCompleteStub = func(specSummary *types.SpecSummary) { - didCompleteCalls = append(didCompleteCalls, "Reporter1") - } - reporter2.SpecDidCompleteStub = func(specSummary *types.SpecSummary) { - didCompleteCalls = append(didCompleteCalls, "Reporter2") - } - - runner = newRunner(conf, newBefSuite("BefSuite", false), newAftSuite("AftSuite", false), specA, pendingSpec, anotherPendingSpec, failedSpec, specB, skippedSpec) - runner.Run() - }) - - BeforeEach(func() { - conf = config.GinkgoConfigType{RandomSeed: 17} - }) - - It("should skip skipped/pending tests", func() { - Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "spec A", "failed spec", "spec B", "AftSuite"})) - }) - - It("should report to any attached reporters", func() { - Ω(reporter1.Config).Should(Equal(reporter2.Config)) - Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary)) - Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary)) - Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries)) - Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries)) - Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary)) - Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary)) - }) - - It("should report that a spec did end in reverse order", func() { - Ω(willRunCalls[0:4]).Should(Equal([]string{"Reporter1", "Reporter2", "Reporter1", "Reporter2"})) - Ω(didCompleteCalls[0:4]).Should(Equal([]string{"Reporter2", "Reporter1", "Reporter2", "Reporter1"})) - }) - - It("should report the passed in config", func() { - Ω(reporter1.Config.RandomSeed).Should(BeNumerically("==", 17)) - }) - - It("should report the beginning of the suite", func() { - Ω(reporter1.BeginSummary.SuiteDescription).Should(Equal("description")) - Ω(reporter1.BeginSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}")) - Ω(reporter1.BeginSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6)) - Ω(reporter1.BeginSummary.NumberOfTotalSpecs).Should(Equal(6)) - Ω(reporter1.BeginSummary.NumberOfSpecsThatWillBeRun).Should(Equal(3)) - Ω(reporter1.BeginSummary.NumberOfPendingSpecs).Should(Equal(-1)) - Ω(reporter1.BeginSummary.NumberOfSkippedSpecs).Should(Equal(-1)) - }) - - It("should report the end of the suite", func() { - Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description")) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}")) - Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(3)) - Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(2)) - Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(2)) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(1)) - }) - - Context("when told to perform a dry run", func() { - BeforeEach(func() { - conf.DryRun = true - }) - - It("should report to the reporters", func() { - Ω(reporter1.Config).Should(Equal(reporter2.Config)) - Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary)) - Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary)) - Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries)) - Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries)) - Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary)) - Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary)) - }) - - It("should not actually run anything", func() { - Ω(thingsThatRan).Should(BeEmpty()) - }) - - It("report before and after suites as passed", func() { - Ω(reporter1.BeforeSuiteSummary.State).Should(Equal(types.SpecStatePassed)) - Ω(reporter1.AfterSuiteSummary.State).Should(Equal(types.SpecStatePassed)) - }) - - It("should report specs as passed", func() { - summaries := reporter1.SpecSummaries - Ω(summaries).Should(HaveLen(6)) - Ω(summaries[0].ComponentTexts).Should(ContainElement("spec A")) - Ω(summaries[0].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[1].ComponentTexts).Should(ContainElement("pending spec")) - Ω(summaries[1].State).Should(Equal(types.SpecStatePending)) - Ω(summaries[2].ComponentTexts).Should(ContainElement("another pending spec")) - Ω(summaries[2].State).Should(Equal(types.SpecStatePending)) - Ω(summaries[3].ComponentTexts).Should(ContainElement("failed spec")) - Ω(summaries[3].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[4].ComponentTexts).Should(ContainElement("spec B")) - Ω(summaries[4].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[5].ComponentTexts).Should(ContainElement("skipped spec")) - Ω(summaries[5].State).Should(Equal(types.SpecStateSkipped)) - }) - - It("should report the end of the suite", func() { - Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description")) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue()) - Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}")) - Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(3)) - Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(2)) - Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(0)) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0)) - }) - - It("should not report a slow test", func() { - summaries := reporter1.SpecSummaries - for _, s := range summaries { - Expect(s.RunTime).To(BeZero()) - } - }) - }) - }) - - Describe("reporting on specs", func() { - var proceed chan bool - var ready chan bool - var finished chan bool - BeforeEach(func() { - ready = make(chan bool) - proceed = make(chan bool) - finished = make(chan bool) - skippedSpec := newSpec("SKIP", noneFlag, false) - skippedSpec.Skip() - - runner = newRunner( - config.GinkgoConfigType{}, - newBefSuite("BefSuite", false), - newAftSuite("AftSuite", false), - skippedSpec, - newSpec("PENDING", pendingFlag, false), - newSpecWithBody("RUN", func() { - close(ready) - <-proceed - }), - ) - go func() { - runner.Run() - close(finished) - }() - }) - - It("should report about pending/skipped specs", func() { - <-ready - Ω(reporter1.SpecWillRunSummaries).Should(HaveLen(3)) - - Ω(reporter1.SpecWillRunSummaries[0].ComponentTexts[0]).Should(Equal("SKIP")) - Ω(reporter1.SpecWillRunSummaries[1].ComponentTexts[0]).Should(Equal("PENDING")) - Ω(reporter1.SpecWillRunSummaries[2].ComponentTexts[0]).Should(Equal("RUN")) - - Ω(reporter1.SpecSummaries[0].ComponentTexts[0]).Should(Equal("SKIP")) - Ω(reporter1.SpecSummaries[1].ComponentTexts[0]).Should(Equal("PENDING")) - Ω(reporter1.SpecSummaries).Should(HaveLen(2)) - - close(proceed) - <-finished - - Ω(reporter1.SpecSummaries).Should(HaveLen(3)) - Ω(reporter1.SpecSummaries[2].ComponentTexts[0]).Should(Equal("RUN")) - }) - }) - - Describe("Running and Reporting when there's flakes", func() { - var specA, pendingSpec, flakySpec, failedSpec, specB, skippedSpec *spec.Spec - var willRunCalls, didCompleteCalls []string - var conf config.GinkgoConfigType - var failedSpecFlag = noneFlag - - JustBeforeEach(func() { - willRunCalls = []string{} - didCompleteCalls = []string{} - specA = newSpec("spec A", noneFlag, false) - pendingSpec = newSpec("pending spec", pendingFlag, false) - flakySpec = newFlakySpec("flaky spec", noneFlag, 3) - failedSpec = newSpec("failed spec", failedSpecFlag, true) - specB = newSpec("spec B", noneFlag, false) - skippedSpec = newSpec("skipped spec", noneFlag, false) - skippedSpec.Skip() - - reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) { - willRunCalls = append(willRunCalls, "Reporter1") - } - reporter2.SpecWillRunStub = func(specSummary *types.SpecSummary) { - willRunCalls = append(willRunCalls, "Reporter2") - } - - reporter1.SpecDidCompleteStub = func(specSummary *types.SpecSummary) { - didCompleteCalls = append(didCompleteCalls, "Reporter1") - } - reporter2.SpecDidCompleteStub = func(specSummary *types.SpecSummary) { - didCompleteCalls = append(didCompleteCalls, "Reporter2") - } - - runner = newRunner(conf, newBefSuite("BefSuite", false), newAftSuite("AftSuite", false), specA, pendingSpec, flakySpec, failedSpec, specB, skippedSpec) - runner.Run() - }) - - BeforeEach(func() { - failedSpecFlag = noneFlag - conf = config.GinkgoConfigType{ - RandomSeed: 17, - FlakeAttempts: 5, - } - }) - - It("should skip skipped/pending tests", func() { - Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "spec A", "flaky spec", "flaky spec", "flaky spec", "failed spec", "failed spec", "failed spec", "failed spec", "failed spec", "spec B", "AftSuite"})) - }) - - It("should report to any attached reporters", func() { - Ω(reporter1.Config).Should(Equal(reporter2.Config)) - Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary)) - Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary)) - Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries)) - Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries)) - Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary)) - Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary)) - }) - - It("should report that a spec did end in reverse order", func() { - Ω(willRunCalls[0:4]).Should(Equal([]string{"Reporter1", "Reporter2", "Reporter1", "Reporter2"})) - Ω(didCompleteCalls[0:4]).Should(Equal([]string{"Reporter2", "Reporter1", "Reporter2", "Reporter1"})) - }) - - It("should report the passed in config", func() { - Ω(reporter1.Config.RandomSeed).Should(BeNumerically("==", 17)) - }) - - It("should report the beginning of the suite", func() { - Ω(reporter1.BeginSummary.SuiteDescription).Should(Equal("description")) - Ω(reporter1.BeginSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}")) - Ω(reporter1.BeginSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6)) - Ω(reporter1.BeginSummary.NumberOfTotalSpecs).Should(Equal(6)) - Ω(reporter1.BeginSummary.NumberOfSpecsThatWillBeRun).Should(Equal(4)) - Ω(reporter1.BeginSummary.NumberOfPendingSpecs).Should(Equal(-1)) - Ω(reporter1.BeginSummary.NumberOfSkippedSpecs).Should(Equal(-1)) - }) - - It("should report the end of the suite", func() { - Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description")) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}")) - Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(4)) - Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(3)) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfFlakedSpecs).Should(Equal(1)) - }) - - Context("when nothing fails", func() { - BeforeEach(func() { - failedSpecFlag = pendingFlag - }) - - It("the suite should pass even with flakes", func() { - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue()) - Ω(reporter1.EndSummary.NumberOfFlakedSpecs).Should(Equal(1)) - }) - }) - - Context("when told to perform a dry run", func() { - BeforeEach(func() { - conf.DryRun = true - }) - - It("should report to the reporters", func() { - Ω(reporter1.Config).Should(Equal(reporter2.Config)) - Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary)) - Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary)) - Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries)) - Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries)) - Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary)) - Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary)) - }) - - It("should not actually run anything", func() { - Ω(thingsThatRan).Should(BeEmpty()) - }) - - It("report before and after suites as passed", func() { - Ω(reporter1.BeforeSuiteSummary.State).Should(Equal(types.SpecStatePassed)) - Ω(reporter1.AfterSuiteSummary.State).Should(Equal(types.SpecStatePassed)) - }) - - It("should report specs as passed", func() { - summaries := reporter1.SpecSummaries - Ω(summaries).Should(HaveLen(6)) - Ω(summaries[0].ComponentTexts).Should(ContainElement("spec A")) - Ω(summaries[0].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[1].ComponentTexts).Should(ContainElement("pending spec")) - Ω(summaries[1].State).Should(Equal(types.SpecStatePending)) - Ω(summaries[2].ComponentTexts).Should(ContainElement("flaky spec")) - Ω(summaries[2].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[3].ComponentTexts).Should(ContainElement("failed spec")) - Ω(summaries[3].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[4].ComponentTexts).Should(ContainElement("spec B")) - Ω(summaries[4].State).Should(Equal(types.SpecStatePassed)) - Ω(summaries[5].ComponentTexts).Should(ContainElement("skipped spec")) - Ω(summaries[5].State).Should(Equal(types.SpecStateSkipped)) - }) - - It("should report the end of the suite", func() { - Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description")) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue()) - Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}")) - Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6)) - Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(4)) - Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(0)) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0)) - }) - }) - }) - - Describe("Running BeforeSuite & AfterSuite", func() { - var success bool - var befSuite leafnodes.SuiteNode - var aftSuite leafnodes.SuiteNode - Context("with a nil BeforeSuite & AfterSuite", func() { - BeforeEach(func() { - runner = newRunner( - config.GinkgoConfigType{}, - nil, - nil, - newSpec("A", noneFlag, false), - newSpec("B", noneFlag, false), - ) - success = runner.Run() - }) - - It("should not report about the BeforeSuite", func() { - Ω(reporter1.BeforeSuiteSummary).Should(BeNil()) - }) - - It("should not report about the AfterSuite", func() { - Ω(reporter1.AfterSuiteSummary).Should(BeNil()) - }) - - It("should run the specs", func() { - Ω(thingsThatRan).Should(Equal([]string{"A", "B"})) - }) - }) - - Context("when the BeforeSuite & AfterSuite pass", func() { - BeforeEach(func() { - befSuite = newBefSuite("BefSuite", false) - aftSuite = newBefSuite("AftSuite", false) - runner = newRunner( - config.GinkgoConfigType{}, - befSuite, - aftSuite, - newSpec("A", noneFlag, false), - newSpec("B", noneFlag, false), - ) - success = runner.Run() - }) - - It("should run the BeforeSuite, the AfterSuite and the specs", func() { - Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "A", "B", "AftSuite"})) - }) - - It("should report about the BeforeSuite", func() { - Ω(reporter1.BeforeSuiteSummary).Should(Equal(befSuite.Summary())) - }) - - It("should report about the AfterSuite", func() { - Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary())) - }) - - It("should report success", func() { - Ω(success).Should(BeTrue()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue()) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0)) - }) - - It("should not dump the writer", func() { - Ω(writer.EventStream).ShouldNot(ContainElement("DUMP")) - }) - }) - - Context("when the BeforeSuite fails", func() { - BeforeEach(func() { - befSuite = newBefSuite("BefSuite", true) - aftSuite = newBefSuite("AftSuite", false) - - skipped := newSpec("Skipped", noneFlag, false) - skipped.Skip() - - runner = newRunner( - config.GinkgoConfigType{}, - befSuite, - aftSuite, - newSpec("A", noneFlag, false), - newSpec("B", noneFlag, false), - newSpec("Pending", pendingFlag, false), - skipped, - ) - success = runner.Run() - }) - - It("should not run the specs, but it should run the AfterSuite", func() { - Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "AftSuite"})) - }) - - It("should report about the BeforeSuite", func() { - Ω(reporter1.BeforeSuiteSummary).Should(Equal(befSuite.Summary())) - }) - - It("should report about the AfterSuite", func() { - Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary())) - }) - - It("should report failure", func() { - Ω(success).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(2)) - Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(2)) - }) - - It("should dump the writer", func() { - Ω(writer.EventStream).Should(ContainElement("DUMP")) - }) - }) - - Context("when some other test fails", func() { - BeforeEach(func() { - aftSuite = newBefSuite("AftSuite", false) - - runner = newRunner( - config.GinkgoConfigType{}, - nil, - aftSuite, - newSpec("A", noneFlag, true), - ) - success = runner.Run() - }) - - It("should still run the AfterSuite", func() { - Ω(thingsThatRan).Should(Equal([]string{"A", "AftSuite"})) - }) - - It("should report about the AfterSuite", func() { - Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary())) - }) - - It("should report failure", func() { - Ω(success).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(1)) - Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(1)) - }) - }) - - Context("when the AfterSuite fails", func() { - BeforeEach(func() { - befSuite = newBefSuite("BefSuite", false) - aftSuite = newBefSuite("AftSuite", true) - runner = newRunner( - config.GinkgoConfigType{}, - befSuite, - aftSuite, - newSpec("A", noneFlag, false), - newSpec("B", noneFlag, false), - ) - success = runner.Run() - }) - - It("should run everything", func() { - Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "A", "B", "AftSuite"})) - }) - - It("should report about the BeforeSuite", func() { - Ω(reporter1.BeforeSuiteSummary).Should(Equal(befSuite.Summary())) - }) - - It("should report about the AfterSuite", func() { - Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary())) - }) - - It("should report failure", func() { - Ω(success).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0)) - }) - - It("should dump the writer", func() { - Ω(writer.EventStream).Should(ContainElement("DUMP")) - }) - }) - }) - - Describe("When instructed to fail fast", func() { - BeforeEach(func() { - conf := config.GinkgoConfigType{ - FailFast: true, - } - runner = newRunner(conf, nil, newAftSuite("after-suite", false), newSpec("passing", noneFlag, false), newSpec("failing", noneFlag, true), newSpec("dont-see", noneFlag, true), newSpec("dont-see", noneFlag, true)) - }) - - It("should return false, report failure, and not run anything past the failing test", func() { - Ω(runner.Run()).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - Ω(thingsThatRan).Should(Equal([]string{"passing", "failing", "after-suite"})) - }) - - It("should announce the subsequent specs as skipped", func() { - runner.Run() - Ω(reporter1.SpecSummaries).Should(HaveLen(4)) - Ω(reporter1.SpecSummaries[2].State).Should(Equal(types.SpecStateSkipped)) - Ω(reporter1.SpecSummaries[3].State).Should(Equal(types.SpecStateSkipped)) - }) - - It("should mark all subsequent specs as skipped", func() { - runner.Run() - Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(2)) - }) - }) - - Describe("Marking failure and success", func() { - Context("when all tests pass", func() { - BeforeEach(func() { - runner = newRunner(config.GinkgoConfigType{}, nil, nil, newSpec("passing", noneFlag, false), newSpec("pending", pendingFlag, false)) - }) - - It("should return true and report success", func() { - Ω(runner.Run()).Should(BeTrue()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue()) - }) - }) - - Context("when a test fails", func() { - BeforeEach(func() { - runner = newRunner(config.GinkgoConfigType{}, nil, nil, newSpec("failing", noneFlag, true), newSpec("pending", pendingFlag, false)) - }) - - It("should return false and report failure", func() { - Ω(runner.Run()).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - }) - }) - - Context("when there is a pending test, but pendings count as failures", func() { - BeforeEach(func() { - runner = newRunner(config.GinkgoConfigType{FailOnPending: true}, nil, nil, newSpec("passing", noneFlag, false), newSpec("pending", pendingFlag, false)) - }) - - It("should return false and report failure", func() { - Ω(runner.Run()).Should(BeFalse()) - Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse()) - }) - }) - }) - - Describe("Managing the writer", func() { - BeforeEach(func() { - runner = newRunner( - config.GinkgoConfigType{}, - nil, - nil, - newSpec("A", noneFlag, false), - newSpec("B", noneFlag, true), - newSpec("C", noneFlag, false), - ) - reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) { - writer.AddEvent("R1.WillRun") - } - reporter2.SpecWillRunStub = func(specSummary *types.SpecSummary) { - writer.AddEvent("R2.WillRun") - } - reporter1.SpecDidCompleteStub = func(specSummary *types.SpecSummary) { - writer.AddEvent("R1.DidComplete") - } - reporter2.SpecDidCompleteStub = func(specSummary *types.SpecSummary) { - writer.AddEvent("R2.DidComplete") - } - runner.Run() - }) - - It("should truncate between tests, but only dump if a test fails", func() { - Ω(writer.EventStream).Should(Equal([]string{ - "TRUNCATE", - "R1.WillRun", - "R2.WillRun", - "A", - "R2.DidComplete", - "R1.DidComplete", - "TRUNCATE", - "R1.WillRun", - "R2.WillRun", - "B", - "BYTES", - "R2.DidComplete", - "DUMP", - "R1.DidComplete", - "TRUNCATE", - "R1.WillRun", - "R2.WillRun", - "C", - "R2.DidComplete", - "R1.DidComplete", - })) - }) - }) - - Describe("CurrentSpecSummary", func() { - It("should return the spec summary for the currently running spec", func() { - var summary *types.SpecSummary - runner = newRunner( - config.GinkgoConfigType{}, - nil, - nil, - newSpec("A", noneFlag, false), - newSpecWithBody("B", func() { - var ok bool - summary, ok = runner.CurrentSpecSummary() - Ω(ok).Should(BeTrue()) - }), - newSpec("C", noneFlag, false), - ) - runner.Run() - - Ω(summary.ComponentTexts).Should(Equal([]string{"B"})) - - summary, ok := runner.CurrentSpecSummary() - Ω(summary).Should(BeNil()) - Ω(ok).Should(BeFalse()) - }) - }) - - Describe("generating a suite id", func() { - It("should generate an id randomly", func() { - runnerA := newRunner(config.GinkgoConfigType{}, nil, nil) - runnerA.Run() - IDA := reporter1.BeginSummary.SuiteID - - runnerB := newRunner(config.GinkgoConfigType{}, nil, nil) - runnerB.Run() - IDB := reporter1.BeginSummary.SuiteID - - IDRegexp := "[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}" - Ω(IDA).Should(MatchRegexp(IDRegexp)) - Ω(IDB).Should(MatchRegexp(IDRegexp)) - - Ω(IDA).ShouldNot(Equal(IDB)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go deleted file mode 100644 index 06fe1d1..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package suite_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func Test(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Suite") -} - -var numBeforeSuiteRuns = 0 -var numAfterSuiteRuns = 0 - -var _ = BeforeSuite(func() { - numBeforeSuiteRuns++ -}) - -var _ = AfterSuite(func() { - numAfterSuiteRuns++ - Ω(numBeforeSuiteRuns).Should(Equal(1)) - Ω(numAfterSuiteRuns).Should(Equal(1)) -}) - -//Fakes -type fakeTestingT struct { - didFail bool -} - -func (fakeT *fakeTestingT) Fail() { - fakeT.didFail = true -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go deleted file mode 100644 index fd2d11d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go +++ /dev/null @@ -1,385 +0,0 @@ -package suite_test - -import ( - "bytes" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/suite" - . "github.com/onsi/gomega" - - "math/rand" - "time" - - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/internal/codelocation" - Failer "github.com/onsi/ginkgo/internal/failer" - Writer "github.com/onsi/ginkgo/internal/writer" - "github.com/onsi/ginkgo/reporters" - "github.com/onsi/ginkgo/types" -) - -var _ = Describe("Suite", func() { - var ( - specSuite *Suite - fakeT *fakeTestingT - fakeR *reporters.FakeReporter - writer *Writer.FakeGinkgoWriter - failer *Failer.Failer - ) - - BeforeEach(func() { - writer = Writer.NewFake() - fakeT = &fakeTestingT{} - fakeR = reporters.NewFakeReporter() - failer = Failer.New() - specSuite = New(failer) - }) - - Describe("running a suite", func() { - var ( - runOrder []string - randomizeAllSpecs bool - randomSeed int64 - focusString string - parallelNode int - parallelTotal int - runResult bool - hasProgrammaticFocus bool - ) - - var f = func(runText string) func() { - return func() { - runOrder = append(runOrder, runText) - } - } - - BeforeEach(func() { - randomizeAllSpecs = false - randomSeed = 11 - parallelNode = 1 - parallelTotal = 1 - focusString = "" - - runOrder = make([]string, 0) - specSuite.SetBeforeSuiteNode(f("BeforeSuite"), codelocation.New(0), 0) - specSuite.PushBeforeEachNode(f("top BE"), codelocation.New(0), 0) - specSuite.PushJustBeforeEachNode(f("top JBE"), codelocation.New(0), 0) - specSuite.PushAfterEachNode(f("top AE"), codelocation.New(0), 0) - - specSuite.PushContainerNode("container", func() { - specSuite.PushBeforeEachNode(f("BE"), codelocation.New(0), 0) - specSuite.PushJustBeforeEachNode(f("JBE"), codelocation.New(0), 0) - specSuite.PushAfterEachNode(f("AE"), codelocation.New(0), 0) - specSuite.PushItNode("it", f("IT"), types.FlagTypeNone, codelocation.New(0), 0) - - specSuite.PushContainerNode("inner container", func() { - specSuite.PushItNode("inner it", f("inner IT"), types.FlagTypeNone, codelocation.New(0), 0) - }, types.FlagTypeNone, codelocation.New(0)) - }, types.FlagTypeNone, codelocation.New(0)) - - specSuite.PushContainerNode("container 2", func() { - specSuite.PushBeforeEachNode(f("BE 2"), codelocation.New(0), 0) - specSuite.PushItNode("it 2", f("IT 2"), types.FlagTypeNone, codelocation.New(0), 0) - }, types.FlagTypeNone, codelocation.New(0)) - - specSuite.PushItNode("top level it", f("top IT"), types.FlagTypeNone, codelocation.New(0), 0) - - specSuite.SetAfterSuiteNode(f("AfterSuite"), codelocation.New(0), 0) - }) - - JustBeforeEach(func() { - runResult, hasProgrammaticFocus = specSuite.Run(fakeT, "suite description", []reporters.Reporter{fakeR}, writer, config.GinkgoConfigType{ - RandomSeed: randomSeed, - RandomizeAllSpecs: randomizeAllSpecs, - FocusString: focusString, - ParallelNode: parallelNode, - ParallelTotal: parallelTotal, - }) - }) - - It("provides the config and suite description to the reporter", func() { - Ω(fakeR.Config.RandomSeed).Should(Equal(int64(randomSeed))) - Ω(fakeR.Config.RandomizeAllSpecs).Should(Equal(randomizeAllSpecs)) - Ω(fakeR.BeginSummary.SuiteDescription).Should(Equal("suite description")) - }) - - It("reports that the BeforeSuite node ran", func() { - Ω(fakeR.BeforeSuiteSummary).ShouldNot(BeNil()) - }) - - It("reports that the AfterSuite node ran", func() { - Ω(fakeR.AfterSuiteSummary).ShouldNot(BeNil()) - }) - - It("provides information about the current test", func() { - description := CurrentGinkgoTestDescription() - Ω(description.ComponentTexts).Should(Equal([]string{"Suite", "running a suite", "provides information about the current test"})) - Ω(description.FullTestText).Should(Equal("Suite running a suite provides information about the current test")) - Ω(description.TestText).Should(Equal("provides information about the current test")) - Ω(description.IsMeasurement).Should(BeFalse()) - Ω(description.FileName).Should(ContainSubstring("suite_test.go")) - Ω(description.LineNumber).Should(BeNumerically(">", 50)) - Ω(description.LineNumber).Should(BeNumerically("<", 150)) - Ω(description.Failed).Should(BeFalse()) - Ω(description.Duration).Should(BeNumerically(">", 0)) - }) - - Measure("should run measurements", func(b Benchmarker) { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - - runtime := b.Time("sleeping", func() { - sleepTime := time.Duration(r.Float64() * 0.01 * float64(time.Second)) - time.Sleep(sleepTime) - }) - Ω(runtime.Seconds()).Should(BeNumerically("<=", 1)) - Ω(runtime.Seconds()).Should(BeNumerically(">=", 0)) - - randomValue := r.Float64() * 10.0 - b.RecordValue("random value", randomValue) - Ω(randomValue).Should(BeNumerically("<=", 10.0)) - Ω(randomValue).Should(BeNumerically(">=", 0.0)) - - b.RecordValueWithPrecision("specific value", 123.4567, "ms", 2) - b.RecordValueWithPrecision("specific value", 234.5678, "ms", 2) - }, 10) - - It("creates a node hierarchy, converts it to a spec collection, and runs it", func() { - Ω(runOrder).Should(Equal([]string{ - "BeforeSuite", - "top BE", "BE", "top JBE", "JBE", "IT", "AE", "top AE", - "top BE", "BE", "top JBE", "JBE", "inner IT", "AE", "top AE", - "top BE", "BE 2", "top JBE", "IT 2", "top AE", - "top BE", "top JBE", "top IT", "top AE", - "AfterSuite", - })) - }) - Context("when in an AfterEach block", func() { - AfterEach(func() { - description := CurrentGinkgoTestDescription() - Ω(description.IsMeasurement).Should(BeFalse()) - Ω(description.FileName).Should(ContainSubstring("suite_test.go")) - Ω(description.Failed).Should(BeFalse()) - Ω(description.Duration).Should(BeNumerically(">", 0)) - }) - - It("still provides information about the current test", func() { - Ω(true).To(BeTrue()) - }) - }) - - Context("when told to randomize all specs", func() { - BeforeEach(func() { - randomizeAllSpecs = true - }) - - It("does", func() { - Ω(runOrder).Should(Equal([]string{ - "BeforeSuite", - "top BE", "top JBE", "top IT", "top AE", - "top BE", "BE", "top JBE", "JBE", "inner IT", "AE", "top AE", - "top BE", "BE", "top JBE", "JBE", "IT", "AE", "top AE", - "top BE", "BE 2", "top JBE", "IT 2", "top AE", - "AfterSuite", - })) - }) - }) - - Context("when provided with a filter", func() { - BeforeEach(func() { - focusString = `inner|\d` - }) - - It("converts the filter to a regular expression and uses it to filter the running specs", func() { - Ω(runOrder).Should(Equal([]string{ - "BeforeSuite", - "top BE", "BE", "top JBE", "JBE", "inner IT", "AE", "top AE", - "top BE", "BE 2", "top JBE", "IT 2", "top AE", - "AfterSuite", - })) - }) - - It("should not report a programmatic focus", func() { - Ω(hasProgrammaticFocus).Should(BeFalse()) - }) - }) - - Context("with a programatically focused spec", func() { - BeforeEach(func() { - specSuite.PushItNode("focused it", f("focused it"), types.FlagTypeFocused, codelocation.New(0), 0) - - specSuite.PushContainerNode("focused container", func() { - specSuite.PushItNode("inner focused it", f("inner focused it"), types.FlagTypeFocused, codelocation.New(0), 0) - specSuite.PushItNode("inner unfocused it", f("inner unfocused it"), types.FlagTypeNone, codelocation.New(0), 0) - }, types.FlagTypeFocused, codelocation.New(0)) - - }) - - It("should only run the focused test, applying backpropagation to favor most deeply focused leaf nodes", func() { - Ω(runOrder).Should(Equal([]string{ - "BeforeSuite", - "top BE", "top JBE", "focused it", "top AE", - "top BE", "top JBE", "inner focused it", "top AE", - "AfterSuite", - })) - }) - - It("should report a programmatic focus", func() { - Ω(hasProgrammaticFocus).Should(BeTrue()) - }) - }) - - Context("when the specs pass", func() { - It("doesn't report a failure", func() { - Ω(fakeT.didFail).Should(BeFalse()) - }) - - It("should return true", func() { - Ω(runResult).Should(BeTrue()) - }) - }) - - Context("when a spec fails", func() { - var location types.CodeLocation - BeforeEach(func() { - specSuite.PushItNode("top level it", func() { - location = codelocation.New(0) - failer.Fail("oops!", location) - }, types.FlagTypeNone, codelocation.New(0), 0) - }) - - It("should return false", func() { - Ω(runResult).Should(BeFalse()) - }) - - It("reports a failure", func() { - Ω(fakeT.didFail).Should(BeTrue()) - }) - - It("generates the correct failure data", func() { - Ω(fakeR.SpecSummaries[0].Failure.Message).Should(Equal("oops!")) - Ω(fakeR.SpecSummaries[0].Failure.Location).Should(Equal(location)) - }) - }) - - Context("when runnable nodes are nested within other runnable nodes", func() { - Context("when an It is nested", func() { - BeforeEach(func() { - specSuite.PushItNode("top level it", func() { - specSuite.PushItNode("nested it", f("oops"), types.FlagTypeNone, codelocation.New(0), 0) - }, types.FlagTypeNone, codelocation.New(0), 0) - }) - - It("should fail", func() { - Ω(fakeT.didFail).Should(BeTrue()) - }) - }) - - Context("when a Measure is nested", func() { - BeforeEach(func() { - specSuite.PushItNode("top level it", func() { - specSuite.PushMeasureNode("nested measure", func(Benchmarker) {}, types.FlagTypeNone, codelocation.New(0), 10) - }, types.FlagTypeNone, codelocation.New(0), 0) - }) - - It("should fail", func() { - Ω(fakeT.didFail).Should(BeTrue()) - }) - }) - - Context("when a BeforeEach is nested", func() { - BeforeEach(func() { - specSuite.PushItNode("top level it", func() { - specSuite.PushBeforeEachNode(f("nested bef"), codelocation.New(0), 0) - }, types.FlagTypeNone, codelocation.New(0), 0) - }) - - It("should fail", func() { - Ω(fakeT.didFail).Should(BeTrue()) - }) - }) - - Context("when a JustBeforeEach is nested", func() { - BeforeEach(func() { - specSuite.PushItNode("top level it", func() { - specSuite.PushJustBeforeEachNode(f("nested jbef"), codelocation.New(0), 0) - }, types.FlagTypeNone, codelocation.New(0), 0) - }) - - It("should fail", func() { - Ω(fakeT.didFail).Should(BeTrue()) - }) - }) - - Context("when a AfterEach is nested", func() { - BeforeEach(func() { - specSuite.PushItNode("top level it", func() { - specSuite.PushAfterEachNode(f("nested aft"), codelocation.New(0), 0) - }, types.FlagTypeNone, codelocation.New(0), 0) - }) - - It("should fail", func() { - Ω(fakeT.didFail).Should(BeTrue()) - }) - }) - }) - }) - - Describe("BeforeSuite", func() { - Context("when setting BeforeSuite more than once", func() { - It("should panic", func() { - specSuite.SetBeforeSuiteNode(func() {}, codelocation.New(0), 0) - - Ω(func() { - specSuite.SetBeforeSuiteNode(func() {}, codelocation.New(0), 0) - }).Should(Panic()) - - }) - }) - }) - - Describe("AfterSuite", func() { - Context("when setting AfterSuite more than once", func() { - It("should panic", func() { - specSuite.SetAfterSuiteNode(func() {}, codelocation.New(0), 0) - - Ω(func() { - specSuite.SetAfterSuiteNode(func() {}, codelocation.New(0), 0) - }).Should(Panic()) - }) - }) - }) - - Describe("By", func() { - It("writes to the GinkgoWriter", func() { - originalGinkgoWriter := GinkgoWriter - buffer := &bytes.Buffer{} - - GinkgoWriter = buffer - By("Saying Hello GinkgoWriter") - GinkgoWriter = originalGinkgoWriter - - Ω(buffer.String()).Should(ContainSubstring("STEP")) - Ω(buffer.String()).Should(ContainSubstring(": Saying Hello GinkgoWriter\n")) - }) - - It("calls the passed-in callback if present", func() { - a := 0 - By("calling the callback", func() { - a = 1 - }) - Ω(a).Should(Equal(1)) - }) - - It("panics if there is more than one callback", func() { - Ω(func() { - By("registering more than one callback", func() {}, func() {}) - }).Should(Panic()) - }) - }) - - Describe("GinkgoRandomSeed", func() { - It("returns the current config's random seed", func() { - Ω(GinkgoRandomSeed()).Should(Equal(config.GinkgoConfig.RandomSeed)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go deleted file mode 100644 index e206577..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package writer_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestWriter(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Writer Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go deleted file mode 100644 index 3e1d17c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package writer_test - -import ( - "github.com/onsi/gomega/gbytes" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/internal/writer" - . "github.com/onsi/gomega" -) - -var _ = Describe("Writer", func() { - var writer *Writer - var out *gbytes.Buffer - - BeforeEach(func() { - out = gbytes.NewBuffer() - writer = New(out) - }) - - It("should stream directly to the outbuffer by default", func() { - writer.Write([]byte("foo")) - Ω(out).Should(gbytes.Say("foo")) - }) - - It("should not emit the header when asked to DumpOutWitHeader", func() { - writer.Write([]byte("foo")) - writer.DumpOutWithHeader("my header") - Ω(out).ShouldNot(gbytes.Say("my header")) - Ω(out).Should(gbytes.Say("foo")) - }) - - Context("when told not to stream", func() { - BeforeEach(func() { - writer.SetStream(false) - }) - - It("should only write to the buffer when told to DumpOut", func() { - writer.Write([]byte("foo")) - Ω(out).ShouldNot(gbytes.Say("foo")) - writer.DumpOut() - Ω(out).Should(gbytes.Say("foo")) - }) - - It("should truncate the internal buffer when told to truncate", func() { - writer.Write([]byte("foo")) - writer.Truncate() - writer.DumpOut() - Ω(out).ShouldNot(gbytes.Say("foo")) - - writer.Write([]byte("bar")) - writer.DumpOut() - Ω(out).Should(gbytes.Say("bar")) - }) - - Describe("emitting a header", func() { - Context("when the buffer has content", func() { - It("should emit the header followed by the content", func() { - writer.Write([]byte("foo")) - writer.DumpOutWithHeader("my header") - - Ω(out).Should(gbytes.Say("my header")) - Ω(out).Should(gbytes.Say("foo")) - }) - }) - - Context("when the buffer has no content", func() { - It("should not emit the header", func() { - writer.DumpOutWithHeader("my header") - - Ω(out).ShouldNot(gbytes.Say("my header")) - }) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go deleted file mode 100644 index 2dcf276..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go +++ /dev/null @@ -1,433 +0,0 @@ -package reporters_test - -import ( - "time" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/reporters" - st "github.com/onsi/ginkgo/reporters/stenographer" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" -) - -var _ = Describe("DefaultReporter", func() { - var ( - reporter *reporters.DefaultReporter - reporterConfig config.DefaultReporterConfigType - stenographer *st.FakeStenographer - - ginkgoConfig config.GinkgoConfigType - suite *types.SuiteSummary - spec *types.SpecSummary - ) - - BeforeEach(func() { - stenographer = st.NewFakeStenographer() - reporterConfig = config.DefaultReporterConfigType{ - NoColor: false, - SlowSpecThreshold: 0.1, - NoisyPendings: false, - NoisySkippings: false, - Verbose: true, - FullTrace: true, - } - - reporter = reporters.NewDefaultReporter(reporterConfig, stenographer) - }) - - call := func(method string, args ...interface{}) st.FakeStenographerCall { - return st.NewFakeStenographerCall(method, args...) - } - - Describe("SpecSuiteWillBegin", func() { - BeforeEach(func() { - suite = &types.SuiteSummary{ - SuiteDescription: "A Sweet Suite", - NumberOfTotalSpecs: 10, - NumberOfSpecsThatWillBeRun: 8, - } - - ginkgoConfig = config.GinkgoConfigType{ - RandomSeed: 1138, - RandomizeAllSpecs: true, - } - }) - - Context("when a serial (non-parallel) suite begins", func() { - BeforeEach(func() { - ginkgoConfig.ParallelTotal = 1 - - reporter.SpecSuiteWillBegin(ginkgoConfig, suite) - }) - - It("should announce the suite, then announce the number of specs", func() { - Ω(stenographer.Calls()).Should(HaveLen(2)) - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuite", "A Sweet Suite", ginkgoConfig.RandomSeed, true, false))) - Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceNumberOfSpecs", 8, 10, false))) - }) - }) - - Context("when a parallel suite begins", func() { - BeforeEach(func() { - ginkgoConfig.ParallelTotal = 2 - ginkgoConfig.ParallelNode = 1 - suite.NumberOfSpecsBeforeParallelization = 20 - - reporter.SpecSuiteWillBegin(ginkgoConfig, suite) - }) - - It("should announce the suite, announce that it's a parallel run, then announce the number of specs", func() { - Ω(stenographer.Calls()).Should(HaveLen(2)) - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuite", "A Sweet Suite", ginkgoConfig.RandomSeed, true, false))) - Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceParallelRun", 1, 2, false))) - }) - }) - }) - - Describe("BeforeSuiteDidRun", func() { - Context("when the BeforeSuite passes", func() { - It("should announce nothing", func() { - reporter.BeforeSuiteDidRun(&types.SetupSummary{ - State: types.SpecStatePassed, - }) - - Ω(stenographer.Calls()).Should(BeEmpty()) - }) - }) - - Context("when the BeforeSuite fails", func() { - It("should announce the failure", func() { - summary := &types.SetupSummary{ - State: types.SpecStateFailed, - } - reporter.BeforeSuiteDidRun(summary) - - Ω(stenographer.Calls()).Should(HaveLen(1)) - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceBeforeSuiteFailure", summary, false, true))) - }) - }) - }) - - Describe("AfterSuiteDidRun", func() { - Context("when the AfterSuite passes", func() { - It("should announce nothing", func() { - reporter.AfterSuiteDidRun(&types.SetupSummary{ - State: types.SpecStatePassed, - }) - - Ω(stenographer.Calls()).Should(BeEmpty()) - }) - }) - - Context("when the AfterSuite fails", func() { - It("should announce the failure", func() { - summary := &types.SetupSummary{ - State: types.SpecStateFailed, - } - reporter.AfterSuiteDidRun(summary) - - Ω(stenographer.Calls()).Should(HaveLen(1)) - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceAfterSuiteFailure", summary, false, true))) - }) - }) - }) - - Describe("SpecWillRun", func() { - Context("When running in verbose mode", func() { - Context("and the spec will run", func() { - BeforeEach(func() { - spec = &types.SpecSummary{} - reporter.SpecWillRun(spec) - }) - - It("should announce that the spec will run", func() { - Ω(stenographer.Calls()).Should(HaveLen(1)) - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecWillRun", spec))) - }) - }) - - Context("and the spec will not run", func() { - Context("because it is pending", func() { - BeforeEach(func() { - spec = &types.SpecSummary{ - State: types.SpecStatePending, - } - reporter.SpecWillRun(spec) - }) - - It("should announce nothing", func() { - Ω(stenographer.Calls()).Should(BeEmpty()) - }) - }) - - Context("because it is skipped", func() { - BeforeEach(func() { - spec = &types.SpecSummary{ - State: types.SpecStateSkipped, - } - reporter.SpecWillRun(spec) - }) - - It("should announce nothing", func() { - Ω(stenographer.Calls()).Should(BeEmpty()) - }) - }) - }) - }) - - Context("When running in verbose & succinct mode", func() { - BeforeEach(func() { - reporterConfig.Succinct = true - reporter = reporters.NewDefaultReporter(reporterConfig, stenographer) - spec = &types.SpecSummary{} - reporter.SpecWillRun(spec) - }) - - It("should announce nothing", func() { - Ω(stenographer.Calls()).Should(BeEmpty()) - }) - }) - - Context("When not running in verbose mode", func() { - BeforeEach(func() { - reporterConfig.Verbose = false - reporter = reporters.NewDefaultReporter(reporterConfig, stenographer) - spec = &types.SpecSummary{} - reporter.SpecWillRun(spec) - }) - - It("should announce nothing", func() { - Ω(stenographer.Calls()).Should(BeEmpty()) - }) - }) - }) - - Describe("SpecDidComplete", func() { - JustBeforeEach(func() { - reporter.SpecDidComplete(spec) - }) - - BeforeEach(func() { - spec = &types.SpecSummary{} - }) - - Context("When the spec passed", func() { - BeforeEach(func() { - spec.State = types.SpecStatePassed - }) - - Context("When the spec was a measurement", func() { - BeforeEach(func() { - spec.IsMeasurement = true - }) - - It("should announce the measurement", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulMeasurement", spec, false))) - }) - }) - - Context("When the spec is slow", func() { - BeforeEach(func() { - spec.RunTime = time.Second - }) - - It("should announce that it was slow", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSlowSpec", spec, false))) - }) - }) - - Context("Otherwise", func() { - It("should announce the succesful spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSpec", spec))) - }) - }) - }) - - Context("When the spec is pending", func() { - BeforeEach(func() { - spec.State = types.SpecStatePending - }) - - It("should announce the pending spec, succinctly", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnouncePendingSpec", spec, false))) - }) - }) - - Context("When the spec is skipped", func() { - BeforeEach(func() { - spec.State = types.SpecStateSkipped - }) - - It("should announce the skipped spec, succinctly", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSkippedSpec", spec, true, true))) - }) - }) - - Context("When the spec timed out", func() { - BeforeEach(func() { - spec.State = types.SpecStateTimedOut - }) - - It("should announce the timedout spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecTimedOut", spec, false, true))) - }) - }) - - Context("When the spec panicked", func() { - BeforeEach(func() { - spec.State = types.SpecStatePanicked - }) - - It("should announce the panicked spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecPanicked", spec, false, true))) - }) - }) - - Context("When the spec failed", func() { - BeforeEach(func() { - spec.State = types.SpecStateFailed - }) - - It("should announce the failed spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecFailed", spec, false, true))) - }) - }) - - Context("in noisy pendings mode", func() { - BeforeEach(func() { - reporterConfig.Succinct = false - reporterConfig.NoisyPendings = true - reporter = reporters.NewDefaultReporter(reporterConfig, stenographer) - }) - - Context("When the spec is pending", func() { - BeforeEach(func() { - spec.State = types.SpecStatePending - }) - - It("should announce the pending spec, noisily", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnouncePendingSpec", spec, true))) - }) - }) - }) - - Context("in noisy skippings mode", func() { - BeforeEach(func() { - reporterConfig.Succinct = false - reporterConfig.NoisySkippings = true - reporter = reporters.NewDefaultReporter(reporterConfig, stenographer) - }) - - Context("When the spec is skipped", func() { - BeforeEach(func() { - spec.State = types.SpecStateSkipped - }) - - It("should announce the skipped spec, noisily", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSkippedSpec", spec, false, true))) - }) - }) - }) - - Context("in succinct mode", func() { - BeforeEach(func() { - reporterConfig.Succinct = true - reporter = reporters.NewDefaultReporter(reporterConfig, stenographer) - }) - - Context("When the spec passed", func() { - BeforeEach(func() { - spec.State = types.SpecStatePassed - }) - - Context("When the spec was a measurement", func() { - BeforeEach(func() { - spec.IsMeasurement = true - }) - - It("should announce the measurement", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulMeasurement", spec, true))) - }) - }) - - Context("When the spec is slow", func() { - BeforeEach(func() { - spec.RunTime = time.Second - }) - - It("should announce that it was slow", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSlowSpec", spec, true))) - }) - }) - - Context("Otherwise", func() { - It("should announce the succesful spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSpec", spec))) - }) - }) - }) - - Context("When the spec is pending", func() { - BeforeEach(func() { - spec.State = types.SpecStatePending - }) - - It("should announce the pending spec, succinctly", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnouncePendingSpec", spec, false))) - }) - }) - - Context("When the spec is skipped", func() { - BeforeEach(func() { - spec.State = types.SpecStateSkipped - }) - - It("should announce the skipped spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSkippedSpec", spec, true, true))) - }) - }) - - Context("When the spec timed out", func() { - BeforeEach(func() { - spec.State = types.SpecStateTimedOut - }) - - It("should announce the timedout spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecTimedOut", spec, true, true))) - }) - }) - - Context("When the spec panicked", func() { - BeforeEach(func() { - spec.State = types.SpecStatePanicked - }) - - It("should announce the panicked spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecPanicked", spec, true, true))) - }) - }) - - Context("When the spec failed", func() { - BeforeEach(func() { - spec.State = types.SpecStateFailed - }) - - It("should announce the failed spec", func() { - Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecFailed", spec, true, true))) - }) - }) - }) - }) - - Describe("SpecSuiteDidEnd", func() { - BeforeEach(func() { - suite = &types.SuiteSummary{} - reporter.SpecSuiteDidEnd(suite) - }) - - It("should announce the spec run's completion", func() { - Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceSpecRunCompletion", suite, false))) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go deleted file mode 100644 index 9b75dc0..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go +++ /dev/null @@ -1,258 +0,0 @@ -package reporters_test - -import ( - "encoding/xml" - "io/ioutil" - "os" - "time" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/reporters" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" -) - -var _ = Describe("JUnit Reporter", func() { - var ( - outputFile string - reporter Reporter - ) - testSuiteTime := 12456999 * time.Microsecond - reportedSuiteTime := 12.456 - - readOutputFile := func() reporters.JUnitTestSuite { - bytes, err := ioutil.ReadFile(outputFile) - Ω(err).ShouldNot(HaveOccurred()) - var suite reporters.JUnitTestSuite - err = xml.Unmarshal(bytes, &suite) - Ω(err).ShouldNot(HaveOccurred()) - return suite - } - - BeforeEach(func() { - f, err := ioutil.TempFile("", "output") - Ω(err).ShouldNot(HaveOccurred()) - f.Close() - outputFile = f.Name() - - reporter = reporters.NewJUnitReporter(outputFile) - - reporter.SpecSuiteWillBegin(config.GinkgoConfigType{}, &types.SuiteSummary{ - SuiteDescription: "My test suite", - NumberOfSpecsThatWillBeRun: 1, - }) - }) - - AfterEach(func() { - os.RemoveAll(outputFile) - }) - - Describe("a passing test", func() { - BeforeEach(func() { - beforeSuite := &types.SetupSummary{ - State: types.SpecStatePassed, - } - reporter.BeforeSuiteDidRun(beforeSuite) - - afterSuite := &types.SetupSummary{ - State: types.SpecStatePassed, - } - reporter.AfterSuiteDidRun(afterSuite) - - spec := &types.SpecSummary{ - ComponentTexts: []string{"[Top Level]", "A", "B", "C"}, - State: types.SpecStatePassed, - RunTime: 5 * time.Second, - } - reporter.SpecWillRun(spec) - reporter.SpecDidComplete(spec) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 0, - RunTime: testSuiteTime, - }) - }) - - It("should record the test as passing", func() { - output := readOutputFile() - Ω(output.Name).Should(Equal("My test suite")) - Ω(output.Tests).Should(Equal(1)) - Ω(output.Failures).Should(Equal(0)) - Ω(output.Time).Should(Equal(reportedSuiteTime)) - Ω(output.Errors).Should(Equal(0)) - Ω(output.TestCases).Should(HaveLen(1)) - Ω(output.TestCases[0].Name).Should(Equal("A B C")) - Ω(output.TestCases[0].ClassName).Should(Equal("My test suite")) - Ω(output.TestCases[0].FailureMessage).Should(BeNil()) - Ω(output.TestCases[0].Skipped).Should(BeNil()) - Ω(output.TestCases[0].Time).Should(Equal(5.0)) - }) - }) - - Describe("when the BeforeSuite fails", func() { - var beforeSuite *types.SetupSummary - - BeforeEach(func() { - beforeSuite = &types.SetupSummary{ - State: types.SpecStateFailed, - RunTime: 3 * time.Second, - Failure: types.SpecFailure{ - Message: "failed to setup", - ComponentCodeLocation: codelocation.New(0), - Location: codelocation.New(2), - }, - } - reporter.BeforeSuiteDidRun(beforeSuite) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 1, - RunTime: testSuiteTime, - }) - }) - - It("should record the test as having failed", func() { - output := readOutputFile() - Ω(output.Name).Should(Equal("My test suite")) - Ω(output.Tests).Should(Equal(1)) - Ω(output.Failures).Should(Equal(1)) - Ω(output.Time).Should(Equal(reportedSuiteTime)) - Ω(output.Errors).Should(Equal(0)) - Ω(output.TestCases[0].Name).Should(Equal("BeforeSuite")) - Ω(output.TestCases[0].Time).Should(Equal(3.0)) - Ω(output.TestCases[0].ClassName).Should(Equal("My test suite")) - Ω(output.TestCases[0].FailureMessage.Type).Should(Equal("Failure")) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring("failed to setup")) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(beforeSuite.Failure.ComponentCodeLocation.String())) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(beforeSuite.Failure.Location.String())) - Ω(output.TestCases[0].Skipped).Should(BeNil()) - }) - }) - - Describe("when the AfterSuite fails", func() { - var afterSuite *types.SetupSummary - - BeforeEach(func() { - afterSuite = &types.SetupSummary{ - State: types.SpecStateFailed, - RunTime: 3 * time.Second, - Failure: types.SpecFailure{ - Message: "failed to setup", - ComponentCodeLocation: codelocation.New(0), - Location: codelocation.New(2), - }, - } - reporter.AfterSuiteDidRun(afterSuite) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 1, - RunTime: testSuiteTime, - }) - }) - - It("should record the test as having failed", func() { - output := readOutputFile() - Ω(output.Name).Should(Equal("My test suite")) - Ω(output.Tests).Should(Equal(1)) - Ω(output.Failures).Should(Equal(1)) - Ω(output.Time).Should(Equal(reportedSuiteTime)) - Ω(output.Errors).Should(Equal(0)) - Ω(output.TestCases[0].Name).Should(Equal("AfterSuite")) - Ω(output.TestCases[0].Time).Should(Equal(3.0)) - Ω(output.TestCases[0].ClassName).Should(Equal("My test suite")) - Ω(output.TestCases[0].FailureMessage.Type).Should(Equal("Failure")) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring("failed to setup")) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(afterSuite.Failure.ComponentCodeLocation.String())) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(afterSuite.Failure.Location.String())) - Ω(output.TestCases[0].Skipped).Should(BeNil()) - }) - }) - - specStateCases := []struct { - state types.SpecState - message string - }{ - {types.SpecStateFailed, "Failure"}, - {types.SpecStateTimedOut, "Timeout"}, - {types.SpecStatePanicked, "Panic"}, - } - - for _, specStateCase := range specStateCases { - specStateCase := specStateCase - Describe("a failing test", func() { - var spec *types.SpecSummary - BeforeEach(func() { - spec = &types.SpecSummary{ - ComponentTexts: []string{"[Top Level]", "A", "B", "C"}, - State: specStateCase.state, - RunTime: 5 * time.Second, - Failure: types.SpecFailure{ - ComponentCodeLocation: codelocation.New(0), - Location: codelocation.New(2), - Message: "I failed", - }, - } - reporter.SpecWillRun(spec) - reporter.SpecDidComplete(spec) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 1, - RunTime: testSuiteTime, - }) - }) - - It("should record test as failing", func() { - output := readOutputFile() - Ω(output.Name).Should(Equal("My test suite")) - Ω(output.Tests).Should(Equal(1)) - Ω(output.Failures).Should(Equal(1)) - Ω(output.Time).Should(Equal(reportedSuiteTime)) - Ω(output.Errors).Should(Equal(0)) - Ω(output.TestCases[0].Name).Should(Equal("A B C")) - Ω(output.TestCases[0].ClassName).Should(Equal("My test suite")) - Ω(output.TestCases[0].FailureMessage.Type).Should(Equal(specStateCase.message)) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring("I failed")) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(spec.Failure.ComponentCodeLocation.String())) - Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(spec.Failure.Location.String())) - Ω(output.TestCases[0].Skipped).Should(BeNil()) - }) - }) - } - - for _, specStateCase := range []types.SpecState{types.SpecStatePending, types.SpecStateSkipped} { - specStateCase := specStateCase - Describe("a skipped test", func() { - var spec *types.SpecSummary - BeforeEach(func() { - spec = &types.SpecSummary{ - ComponentTexts: []string{"[Top Level]", "A", "B", "C"}, - State: specStateCase, - RunTime: 5 * time.Second, - } - reporter.SpecWillRun(spec) - reporter.SpecDidComplete(spec) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 0, - RunTime: testSuiteTime, - }) - }) - - It("should record test as failing", func() { - output := readOutputFile() - Ω(output.Tests).Should(Equal(1)) - Ω(output.Failures).Should(Equal(0)) - Ω(output.Time).Should(Equal(reportedSuiteTime)) - Ω(output.Errors).Should(Equal(0)) - Ω(output.TestCases[0].Name).Should(Equal("A B C")) - Ω(output.TestCases[0].Skipped).ShouldNot(BeNil()) - }) - }) - } -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go deleted file mode 100644 index cec5a4d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package reporters_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestReporters(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Reporters Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md b/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md deleted file mode 100644 index 37de454..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Colorize Windows - -These packages are used for colorize on Windows and contributed by mattn.jp@gmail.com - - * go-colorable: - * go-isatty: diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go deleted file mode 100644 index b45d5db..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go +++ /dev/null @@ -1,214 +0,0 @@ -package reporters_test - -import ( - "bytes" - "fmt" - "time" - - . "github.com/onsi/ginkgo" - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/internal/codelocation" - "github.com/onsi/ginkgo/reporters" - "github.com/onsi/ginkgo/types" - . "github.com/onsi/gomega" -) - -var _ = Describe("TeamCity Reporter", func() { - var ( - buffer bytes.Buffer - reporter Reporter - ) - - BeforeEach(func() { - buffer.Truncate(0) - reporter = reporters.NewTeamCityReporter(&buffer) - reporter.SpecSuiteWillBegin(config.GinkgoConfigType{}, &types.SuiteSummary{ - SuiteDescription: "Foo's test suite", - NumberOfSpecsThatWillBeRun: 1, - }) - }) - - Describe("a passing test", func() { - BeforeEach(func() { - beforeSuite := &types.SetupSummary{ - State: types.SpecStatePassed, - } - reporter.BeforeSuiteDidRun(beforeSuite) - - afterSuite := &types.SetupSummary{ - State: types.SpecStatePassed, - } - reporter.AfterSuiteDidRun(afterSuite) - - spec := &types.SpecSummary{ - ComponentTexts: []string{"[Top Level]", "A", "B", "C"}, - State: types.SpecStatePassed, - RunTime: 5 * time.Second, - } - reporter.SpecWillRun(spec) - reporter.SpecDidComplete(spec) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 0, - RunTime: 10 * time.Second, - }) - }) - - It("should record the test as passing", func() { - actual := buffer.String() - expected := - "##teamcity[testSuiteStarted name='Foo|'s test suite']" + - "##teamcity[testStarted name='A B C']" + - "##teamcity[testFinished name='A B C' duration='5000']" + - "##teamcity[testSuiteFinished name='Foo|'s test suite']" - Ω(actual).Should(Equal(expected)) - }) - }) - - Describe("when the BeforeSuite fails", func() { - var beforeSuite *types.SetupSummary - - BeforeEach(func() { - beforeSuite = &types.SetupSummary{ - State: types.SpecStateFailed, - RunTime: 3 * time.Second, - Failure: types.SpecFailure{ - Message: "failed to setup\n", - ComponentCodeLocation: codelocation.New(0), - }, - } - reporter.BeforeSuiteDidRun(beforeSuite) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 1, - RunTime: 10 * time.Second, - }) - }) - - It("should record the test as having failed", func() { - actual := buffer.String() - expected := fmt.Sprintf( - "##teamcity[testSuiteStarted name='Foo|'s test suite']"+ - "##teamcity[testStarted name='BeforeSuite']"+ - "##teamcity[testFailed name='BeforeSuite' message='%s' details='failed to setup|n']"+ - "##teamcity[testFinished name='BeforeSuite' duration='3000']"+ - "##teamcity[testSuiteFinished name='Foo|'s test suite']", beforeSuite.Failure.ComponentCodeLocation.String(), - ) - Ω(actual).Should(Equal(expected)) - }) - }) - - Describe("when the AfterSuite fails", func() { - var afterSuite *types.SetupSummary - - BeforeEach(func() { - afterSuite = &types.SetupSummary{ - State: types.SpecStateFailed, - RunTime: 3 * time.Second, - Failure: types.SpecFailure{ - Message: "failed to setup\n", - ComponentCodeLocation: codelocation.New(0), - }, - } - reporter.AfterSuiteDidRun(afterSuite) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 1, - RunTime: 10 * time.Second, - }) - }) - - It("should record the test as having failed", func() { - actual := buffer.String() - expected := fmt.Sprintf( - "##teamcity[testSuiteStarted name='Foo|'s test suite']"+ - "##teamcity[testStarted name='AfterSuite']"+ - "##teamcity[testFailed name='AfterSuite' message='%s' details='failed to setup|n']"+ - "##teamcity[testFinished name='AfterSuite' duration='3000']"+ - "##teamcity[testSuiteFinished name='Foo|'s test suite']", afterSuite.Failure.ComponentCodeLocation.String(), - ) - Ω(actual).Should(Equal(expected)) - }) - }) - specStateCases := []struct { - state types.SpecState - message string - }{ - {types.SpecStateFailed, "Failure"}, - {types.SpecStateTimedOut, "Timeout"}, - {types.SpecStatePanicked, "Panic"}, - } - - for _, specStateCase := range specStateCases { - specStateCase := specStateCase - Describe("a failing test", func() { - var spec *types.SpecSummary - BeforeEach(func() { - spec = &types.SpecSummary{ - ComponentTexts: []string{"[Top Level]", "A", "B", "C"}, - State: specStateCase.state, - RunTime: 5 * time.Second, - Failure: types.SpecFailure{ - ComponentCodeLocation: codelocation.New(0), - Message: "I failed", - }, - } - reporter.SpecWillRun(spec) - reporter.SpecDidComplete(spec) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 1, - RunTime: 10 * time.Second, - }) - }) - - It("should record test as failing", func() { - actual := buffer.String() - expected := - fmt.Sprintf("##teamcity[testSuiteStarted name='Foo|'s test suite']"+ - "##teamcity[testStarted name='A B C']"+ - "##teamcity[testFailed name='A B C' message='%s' details='I failed']"+ - "##teamcity[testFinished name='A B C' duration='5000']"+ - "##teamcity[testSuiteFinished name='Foo|'s test suite']", spec.Failure.ComponentCodeLocation.String()) - Ω(actual).Should(Equal(expected)) - }) - }) - } - - for _, specStateCase := range []types.SpecState{types.SpecStatePending, types.SpecStateSkipped} { - specStateCase := specStateCase - Describe("a skipped test", func() { - var spec *types.SpecSummary - BeforeEach(func() { - spec = &types.SpecSummary{ - ComponentTexts: []string{"[Top Level]", "A", "B", "C"}, - State: specStateCase, - RunTime: 5 * time.Second, - } - reporter.SpecWillRun(spec) - reporter.SpecDidComplete(spec) - - reporter.SpecSuiteDidEnd(&types.SuiteSummary{ - NumberOfSpecsThatWillBeRun: 1, - NumberOfFailedSpecs: 0, - RunTime: 10 * time.Second, - }) - }) - - It("should record test as ignored", func() { - actual := buffer.String() - expected := - "##teamcity[testSuiteStarted name='Foo|'s test suite']" + - "##teamcity[testStarted name='A B C']" + - "##teamcity[testIgnored name='A B C']" + - "##teamcity[testFinished name='A B C' duration='5000']" + - "##teamcity[testSuiteFinished name='Foo|'s test suite']" - Ω(actual).Should(Equal(expected)) - }) - }) - } -}) diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_suite_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_suite_test.go deleted file mode 100644 index b026169..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package types_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestTypes(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Types Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_test.go b/src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_test.go deleted file mode 100644 index a0e161c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/ginkgo/types/types_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package types_test - -import ( - . "github.com/onsi/ginkgo/types" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var specStates = []SpecState{ - SpecStatePassed, - SpecStateTimedOut, - SpecStatePanicked, - SpecStateFailed, - SpecStatePending, - SpecStateSkipped, -} - -func verifySpecSummary(caller func(SpecSummary) bool, trueStates ...SpecState) { - summary := SpecSummary{} - trueStateLookup := map[SpecState]bool{} - for _, state := range trueStates { - trueStateLookup[state] = true - summary.State = state - Ω(caller(summary)).Should(BeTrue()) - } - - for _, state := range specStates { - if trueStateLookup[state] { - continue - } - summary.State = state - Ω(caller(summary)).Should(BeFalse()) - } -} - -var _ = Describe("Types", func() { - Describe("IsFailureState", func() { - It("knows when it is in a failure-like state", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.State.IsFailure() - }, SpecStateTimedOut, SpecStatePanicked, SpecStateFailed) - }) - }) - - Describe("SpecSummary", func() { - It("knows when it is in a failure-like state", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.HasFailureState() - }, SpecStateTimedOut, SpecStatePanicked, SpecStateFailed) - }) - - It("knows when it passed", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.Passed() - }, SpecStatePassed) - }) - - It("knows when it has failed", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.Failed() - }, SpecStateFailed) - }) - - It("knows when it has panicked", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.Panicked() - }, SpecStatePanicked) - }) - - It("knows when it has timed out", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.TimedOut() - }, SpecStateTimedOut) - }) - - It("knows when it is pending", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.Pending() - }, SpecStatePending) - }) - - It("knows when it is skipped", func() { - verifySpecSummary(func(summary SpecSummary) bool { - return summary.Skipped() - }, SpecStateSkipped) - }) - }) - - Describe("SpecMeasurement", func() { - It("knows how to format values when the precision is 0", func() { - Ω(SpecMeasurement{}.PrecisionFmt()).Should(Equal("%f")) - }) - - It("knows how to format the values when the precision is 3", func() { - Ω(SpecMeasurement{Precision: 3}.PrecisionFmt()).Should(Equal("%.3f")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/format/format_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/format/format_suite_test.go deleted file mode 100644 index 8e65a95..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/format/format_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package format_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestFormat(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Format Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/format/format_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/format/format_test.go deleted file mode 100644 index 804ddad..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/format/format_test.go +++ /dev/null @@ -1,642 +0,0 @@ -package format_test - -import ( - "fmt" - "strings" - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/format" - "github.com/onsi/gomega/types" -) - -//recursive struct - -type StringAlias string -type ByteAlias []byte -type IntAlias int - -type AStruct struct { - Exported string -} - -type SimpleStruct struct { - Name string - Enumeration int - Veritas bool - Data []byte - secret uint32 -} - -type ComplexStruct struct { - Strings []string - SimpleThings []*SimpleStruct - DataMaps map[int]ByteAlias -} - -type SecretiveStruct struct { - boolValue bool - intValue int - uintValue uint - uintptrValue uintptr - floatValue float32 - complexValue complex64 - chanValue chan bool - funcValue func() - pointerValue *int - sliceValue []string - byteSliceValue []byte - stringValue string - arrValue [3]int - byteArrValue [3]byte - mapValue map[string]int - structValue AStruct - interfaceValue interface{} -} - -type GoStringer struct { -} - -func (g GoStringer) GoString() string { - return "go-string" -} - -func (g GoStringer) String() string { - return "string" -} - -type Stringer struct { -} - -func (g Stringer) String() string { - return "string" -} - -type ctx struct { -} - -func (c *ctx) Deadline() (deadline time.Time, ok bool) { - return time.Time{}, false -} - -func (c *ctx) Done() <-chan struct{} { - return nil -} - -func (c *ctx) Err() error { - return nil -} - -func (c *ctx) Value(key interface{}) interface{} { - return nil -} - -var _ = Describe("Format", func() { - match := func(typeRepresentation string, valueRepresentation string, args ...interface{}) types.GomegaMatcher { - if len(args) > 0 { - valueRepresentation = fmt.Sprintf(valueRepresentation, args...) - } - return Equal(fmt.Sprintf("%s<%s>: %s", Indent, typeRepresentation, valueRepresentation)) - } - - matchRegexp := func(typeRepresentation string, valueRepresentation string, args ...interface{}) types.GomegaMatcher { - if len(args) > 0 { - valueRepresentation = fmt.Sprintf(valueRepresentation, args...) - } - return MatchRegexp(fmt.Sprintf("%s<%s>: %s", Indent, typeRepresentation, valueRepresentation)) - } - - hashMatchingRegexp := func(entries ...string) string { - entriesSwitch := "(" + strings.Join(entries, "|") + ")" - arr := make([]string, len(entries)) - for i := range arr { - arr[i] = entriesSwitch - } - return "{" + strings.Join(arr, ", ") + "}" - } - - Describe("Message", func() { - Context("with only an actual value", func() { - It("should print out an indented formatted representation of the value and the message", func() { - Expect(Message(3, "to be three.")).Should(Equal("Expected\n : 3\nto be three.")) - }) - }) - - Context("with an actual and an expected value", func() { - It("should print out an indented formatted representatino of both values, and the message", func() { - Expect(Message(3, "to equal", 4)).Should(Equal("Expected\n : 3\nto equal\n : 4")) - }) - }) - }) - - Describe("MessageWithDiff", func() { - It("shows the exact point where two long strings differ", func() { - stringWithB := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - stringWithZ := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - - Expect(MessageWithDiff(stringWithB, "to equal", stringWithZ)).Should(Equal(expectedLongStringFailureMessage)) - }) - - It("truncates the start of long strings that differ only at their end", func() { - stringWithB := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" - stringWithZ := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz" - - Expect(MessageWithDiff(stringWithB, "to equal", stringWithZ)).Should(Equal(expectedTruncatedStartStringFailureMessage)) - }) - - It("truncates the start of long strings that differ only in length", func() { - smallString := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - largeString := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - - Expect(MessageWithDiff(largeString, "to equal", smallString)).Should(Equal(expectedTruncatedStartSizeFailureMessage)) - Expect(MessageWithDiff(smallString, "to equal", largeString)).Should(Equal(expectedTruncatedStartSizeSwappedFailureMessage)) - }) - - It("truncates the end of long strings that differ only at their start", func() { - stringWithB := "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - stringWithZ := "zaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - - Expect(MessageWithDiff(stringWithB, "to equal", stringWithZ)).Should(Equal(expectedTruncatedEndStringFailureMessage)) - }) - - It("handles multi-byte sequences correctly", func() { - stringA := "• abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1" - stringB := "• abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" - - Expect(MessageWithDiff(stringA, "to equal", stringB)).Should(Equal(expectedTruncatedMultiByteFailureMessage)) - }) - - It("prints special characters", func() { - stringA := "\n" - stringB := "something_else" - - Expect(MessageWithDiff(stringA, "to equal", stringB)).Should(Equal(expectedSpecialCharacterFailureMessage)) - }) - - Context("With truncated diff disabled", func() { - BeforeEach(func() { - TruncatedDiff = false - }) - - AfterEach(func() { - TruncatedDiff = true - }) - - It("should show the full diff", func() { - stringWithB := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - stringWithZ := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - - Expect(MessageWithDiff(stringWithB, "to equal", stringWithZ)).Should(Equal(expectedFullFailureDiff)) - }) - }) - }) - - Describe("IndentString", func() { - It("should indent the string", func() { - Expect(IndentString("foo\n bar\nbaz", 2)).Should(Equal(" foo\n bar\n baz")) - }) - }) - - Describe("Object", func() { - Describe("formatting boolean values", func() { - It("should give the type and format values correctly", func() { - Expect(Object(true, 1)).Should(match("bool", "true")) - Expect(Object(false, 1)).Should(match("bool", "false")) - }) - }) - - Describe("formatting numbers", func() { - It("should give the type and format values correctly", func() { - Expect(Object(int(3), 1)).Should(match("int", "3")) - Expect(Object(int8(3), 1)).Should(match("int8", "3")) - Expect(Object(int16(3), 1)).Should(match("int16", "3")) - Expect(Object(int32(3), 1)).Should(match("int32", "3")) - Expect(Object(int64(3), 1)).Should(match("int64", "3")) - - Expect(Object(uint(3), 1)).Should(match("uint", "3")) - Expect(Object(uint8(3), 1)).Should(match("uint8", "3")) - Expect(Object(uint16(3), 1)).Should(match("uint16", "3")) - Expect(Object(uint32(3), 1)).Should(match("uint32", "3")) - Expect(Object(uint64(3), 1)).Should(match("uint64", "3")) - }) - - It("should handle uintptr differently", func() { - Expect(Object(uintptr(3), 1)).Should(match("uintptr", "0x3")) - }) - }) - - Describe("formatting channels", func() { - It("should give the type and format values correctly", func() { - c := make(chan<- bool, 3) - c <- true - c <- false - Expect(Object(c, 1)).Should(match("chan<- bool | len:2, cap:3", "%v", c)) - }) - }) - - Describe("formatting strings", func() { - It("should give the type and format values correctly", func() { - s := "a\nb\nc" - Expect(Object(s, 1)).Should(match("string", `a - b - c`)) - }) - }) - - Describe("formatting []byte slices", func() { - Context("when the slice is made of printable bytes", func() { - It("should present it as string", func() { - b := []byte("a b c") - Expect(Object(b, 1)).Should(matchRegexp(`\[\]uint8 \| len:5, cap:\d+`, `a b c`)) - }) - }) - Context("when the slice contains non-printable bytes", func() { - It("should present it as slice", func() { - b := []byte("a b c\n\x01\x02\x03\xff\x1bH") - Expect(Object(b, 1)).Should(matchRegexp(`\[\]uint8 \| len:12, cap:\d+`, `\[97, 32, 98, 32, 99, 10, 1, 2, 3, 255, 27, 72\]`)) - }) - }) - }) - - Describe("formatting functions", func() { - It("should give the type and format values correctly", func() { - f := func(a string, b []int) ([]byte, error) { - return []byte("abc"), nil - } - Expect(Object(f, 1)).Should(match("func(string, []int) ([]uint8, error)", "%v", f)) - }) - }) - - Describe("formatting pointers", func() { - It("should give the type and dereference the value to format it correctly", func() { - a := 3 - Expect(Object(&a, 1)).Should(match(fmt.Sprintf("*int | %p", &a), "3")) - }) - - Context("when there are pointers to pointers...", func() { - It("should recursively deference the pointer until it gets to a value", func() { - a := 3 - var b *int - var c **int - var d ***int - b = &a - c = &b - d = &c - - Expect(Object(d, 1)).Should(match(fmt.Sprintf("***int | %p", d), "3")) - }) - }) - - Context("when the pointer points to nil", func() { - It("should say nil and not explode", func() { - var a *AStruct - Expect(Object(a, 1)).Should(match("*format_test.AStruct | 0x0", "nil")) - }) - }) - }) - - Describe("formatting arrays", func() { - It("should give the type and format values correctly", func() { - w := [3]string{"Jed Bartlet", "Toby Ziegler", "CJ Cregg"} - Expect(Object(w, 1)).Should(match("[3]string", `["Jed Bartlet", "Toby Ziegler", "CJ Cregg"]`)) - }) - - Context("with byte arrays", func() { - It("should give the type and format values correctly", func() { - w := [3]byte{17, 28, 19} - Expect(Object(w, 1)).Should(match("[3]uint8", `[17, 28, 19]`)) - }) - }) - }) - - Describe("formatting slices", func() { - It("should include the length and capacity in the type information", func() { - s := make([]bool, 3, 4) - Expect(Object(s, 1)).Should(match("[]bool | len:3, cap:4", "[false, false, false]")) - }) - - Context("when the slice contains long entries", func() { - It("should format the entries with newlines", func() { - w := []string{"Josiah Edward Bartlet", "Toby Ziegler", "CJ Cregg"} - expected := `[ - "Josiah Edward Bartlet", - "Toby Ziegler", - "CJ Cregg", - ]` - Expect(Object(w, 1)).Should(match("[]string | len:3, cap:3", expected)) - }) - }) - }) - - Describe("formatting maps", func() { - It("should include the length in the type information", func() { - m := make(map[int]bool, 5) - m[3] = true - m[4] = false - Expect(Object(m, 1)).Should(matchRegexp(`map\[int\]bool \| len:2`, hashMatchingRegexp("3: true", "4: false"))) - }) - - Context("when the slice contains long entries", func() { - It("should format the entries with newlines", func() { - m := map[string][]byte{} - m["Josiah Edward Bartlet"] = []byte("Martin Sheen") - m["Toby Ziegler"] = []byte("Richard Schiff") - m["CJ Cregg"] = []byte("Allison Janney") - expected := `{ - ("Josiah Edward Bartlet": "Martin Sheen"|"Toby Ziegler": "Richard Schiff"|"CJ Cregg": "Allison Janney"), - ("Josiah Edward Bartlet": "Martin Sheen"|"Toby Ziegler": "Richard Schiff"|"CJ Cregg": "Allison Janney"), - ("Josiah Edward Bartlet": "Martin Sheen"|"Toby Ziegler": "Richard Schiff"|"CJ Cregg": "Allison Janney"), - }` - Expect(Object(m, 1)).Should(matchRegexp(`map\[string\]\[\]uint8 \| len:3`, expected)) - }) - }) - }) - - Describe("formatting structs", func() { - It("should include the struct name and the field names", func() { - s := SimpleStruct{ - Name: "Oswald", - Enumeration: 17, - Veritas: true, - Data: []byte("datum"), - secret: 1983, - } - - Expect(Object(s, 1)).Should(match("format_test.SimpleStruct", `{Name: "Oswald", Enumeration: 17, Veritas: true, Data: "datum", secret: 1983}`)) - }) - - Context("when the struct contains long entries", func() { - It("should format the entries with new lines", func() { - s := &SimpleStruct{ - Name: "Mithrandir Gandalf Greyhame", - Enumeration: 2021, - Veritas: true, - Data: []byte("wizard"), - secret: 3, - } - - Expect(Object(s, 1)).Should(match(fmt.Sprintf("*format_test.SimpleStruct | %p", s), `{ - Name: "Mithrandir Gandalf Greyhame", - Enumeration: 2021, - Veritas: true, - Data: "wizard", - secret: 3, - }`)) - }) - }) - }) - - Describe("formatting nil values", func() { - It("should print out nil", func() { - Expect(Object(nil, 1)).Should(match("nil", "nil")) - var typedNil *AStruct - Expect(Object(typedNil, 1)).Should(match("*format_test.AStruct | 0x0", "nil")) - var c chan<- bool - Expect(Object(c, 1)).Should(match("chan<- bool | len:0, cap:0", "nil")) - var s []string - Expect(Object(s, 1)).Should(match("[]string | len:0, cap:0", "nil")) - var m map[string]bool - Expect(Object(m, 1)).Should(match("map[string]bool | len:0", "nil")) - }) - }) - - Describe("formatting aliased types", func() { - It("should print out the correct alias type", func() { - Expect(Object(StringAlias("alias"), 1)).Should(match("format_test.StringAlias", `alias`)) - Expect(Object(ByteAlias("alias"), 1)).Should(matchRegexp(`format_test\.ByteAlias \| len:5, cap:\d+`, `alias`)) - Expect(Object(IntAlias(3), 1)).Should(match("format_test.IntAlias", "3")) - }) - }) - - Describe("handling nested things", func() { - It("should produce a correctly nested representation", func() { - s := ComplexStruct{ - Strings: []string{"lots", "of", "short", "strings"}, - SimpleThings: []*SimpleStruct{ - {"short", 7, true, []byte("succinct"), 17}, - {"something longer", 427, true, []byte("designed to wrap around nicely"), 30}, - }, - DataMaps: map[int]ByteAlias{ - 17: ByteAlias("some substantially longer chunks of data"), - 1138: ByteAlias("that should make things wrap"), - }, - } - expected := `{ - Strings: \["lots", "of", "short", "strings"\], - SimpleThings: \[ - {Name: "short", Enumeration: 7, Veritas: true, Data: "succinct", secret: 17}, - { - Name: "something longer", - Enumeration: 427, - Veritas: true, - Data: "designed to wrap around nicely", - secret: 30, - }, - \], - DataMaps: { - (17: "some substantially longer chunks of data"|1138: "that should make things wrap"), - (17: "some substantially longer chunks of data"|1138: "that should make things wrap"), - }, - }` - Expect(Object(s, 1)).Should(matchRegexp(`format_test\.ComplexStruct`, expected)) - }) - }) - - Describe("formatting times", func() { - It("should format time as RFC3339", func() { - t := time.Date(2016, 10, 31, 9, 57, 23, 12345, time.UTC) - Expect(Object(t, 1)).Should(match("time.Time", `2016-10-31T09:57:23.000012345Z`)) - }) - }) - }) - - Describe("Handling unexported fields in structs", func() { - It("should handle all the various types correctly", func() { - a := int(5) - s := SecretiveStruct{ - boolValue: true, - intValue: 3, - uintValue: 4, - uintptrValue: 5, - floatValue: 6.0, - complexValue: complex(5.0, 3.0), - chanValue: make(chan bool, 2), - funcValue: func() {}, - pointerValue: &a, - sliceValue: []string{"string", "slice"}, - byteSliceValue: []byte("bytes"), - stringValue: "a string", - arrValue: [3]int{11, 12, 13}, - byteArrValue: [3]byte{17, 20, 32}, - mapValue: map[string]int{"a key": 20, "b key": 30}, - structValue: AStruct{"exported"}, - interfaceValue: map[string]int{"a key": 17}, - } - - expected := fmt.Sprintf(`{ - boolValue: true, - intValue: 3, - uintValue: 4, - uintptrValue: 0x5, - floatValue: 6, - complexValue: \(5\+3i\), - chanValue: %p, - funcValue: %p, - pointerValue: 5, - sliceValue: \["string", "slice"\], - byteSliceValue: "bytes", - stringValue: "a string", - arrValue: \[11, 12, 13\], - byteArrValue: \[17, 20, 32\], - mapValue: %s, - structValue: {Exported: "exported"}, - interfaceValue: {"a key": 17}, - }`, s.chanValue, s.funcValue, hashMatchingRegexp(`"a key": 20`, `"b key": 30`)) - - Expect(Object(s, 1)).Should(matchRegexp(`format_test\.SecretiveStruct`, expected)) - }) - }) - - Describe("Handling interfaces", func() { - It("should unpack the interface", func() { - outerHash := map[string]interface{}{} - innerHash := map[string]int{} - - innerHash["inner"] = 3 - outerHash["integer"] = 2 - outerHash["map"] = innerHash - - expected := hashMatchingRegexp(`"integer": 2`, `"map": {"inner": 3}`) - Expect(Object(outerHash, 1)).Should(matchRegexp(`map\[string\]interface {} \| len:2`, expected)) - }) - }) - - Describe("Handling recursive things", func() { - It("should not go crazy...", func() { - m := map[string]interface{}{} - m["integer"] = 2 - m["map"] = m - Expect(Object(m, 1)).Should(ContainSubstring("...")) - }) - - It("really should not go crazy...", func() { - type complexKey struct { - Value map[interface{}]int - } - - complexObject := complexKey{} - complexObject.Value = make(map[interface{}]int) - - complexObject.Value[&complexObject] = 2 - Expect(Object(complexObject, 1)).Should(ContainSubstring("...")) - }) - }) - - Describe("When instructed to use the Stringer representation", func() { - BeforeEach(func() { - UseStringerRepresentation = true - }) - - AfterEach(func() { - UseStringerRepresentation = false - }) - - Context("when passed a GoStringer", func() { - It("should use what GoString() returns", func() { - Expect(Object(GoStringer{}, 1)).Should(ContainSubstring(": go-string")) - }) - }) - - Context("when passed a stringer", func() { - It("should use what String() returns", func() { - Expect(Object(Stringer{}, 1)).Should(ContainSubstring(": string")) - }) - }) - }) - - Describe("Printing a context.Context field", func() { - - type structWithContext struct { - Context Ctx - Value string - } - - context := ctx{} - objWithContext := structWithContext{Value: "some-value", Context: &context} - - It("Suppresses the content by default", func() { - Expect(Object(objWithContext, 1)).Should(ContainSubstring("")) - }) - - It("Doesn't supress the context if it's the object being printed", func() { - Expect(Object(context, 1)).ShouldNot(MatchRegexp("^.*$")) - }) - - Context("PrintContextObjects is set", func() { - BeforeEach(func() { - PrintContextObjects = true - }) - - AfterEach(func() { - PrintContextObjects = false - }) - - It("Prints the context", func() { - Expect(Object(objWithContext, 1)).ShouldNot(ContainSubstring("")) - }) - }) - }) -}) - -var expectedLongStringFailureMessage = strings.TrimSpace(` -Expected - : "...aaaaabaaaaa..." -to equal | - : "...aaaaazaaaaa..." -`) -var expectedTruncatedEndStringFailureMessage = strings.TrimSpace(` -Expected - : "baaaaa..." -to equal | - : "zaaaaa..." -`) -var expectedTruncatedStartStringFailureMessage = strings.TrimSpace(` -Expected - : "...aaaaab" -to equal | - : "...aaaaaz" -`) -var expectedTruncatedStartSizeFailureMessage = strings.TrimSpace(` -Expected - : "...aaaaaa" -to equal | - : "...aaaaa" -`) -var expectedTruncatedStartSizeSwappedFailureMessage = strings.TrimSpace(` -Expected - : "...aaaa" -to equal | - : "...aaaaa" -`) -var expectedTruncatedMultiByteFailureMessage = strings.TrimSpace(` -Expected - : "...tuvwxyz1" -to equal | - : "...tuvwxyz" -`) - -var expectedFullFailureDiff = strings.TrimSpace(` -Expected - : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -to equal - : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -`) - -var expectedSpecialCharacterFailureMessage = strings.TrimSpace(` -Expected - : \n -to equal - : something_else - -`) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer.go deleted file mode 100644 index 336086f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -Package gbytes provides a buffer that supports incrementally detecting input. - -You use gbytes.Buffer with the gbytes.Say matcher. When Say finds a match, it fastforwards the buffer's read cursor to the end of that match. - -Subsequent matches against the buffer will only operate against data that appears *after* the read cursor. - -The read cursor is an opaque implementation detail that you cannot access. You should use the Say matcher to sift through the buffer. You can always -access the entire buffer's contents with Contents(). - -*/ -package gbytes - -import ( - "errors" - "fmt" - "io" - "regexp" - "sync" - "time" -) - -/* -gbytes.Buffer implements an io.Writer and can be used with the gbytes.Say matcher. - -You should only use a gbytes.Buffer in test code. It stores all writes in an in-memory buffer - behavior that is inappropriate for production code! -*/ -type Buffer struct { - contents []byte - readCursor uint64 - lock *sync.Mutex - detectCloser chan interface{} - closed bool -} - -/* -NewBuffer returns a new gbytes.Buffer -*/ -func NewBuffer() *Buffer { - return &Buffer{ - lock: &sync.Mutex{}, - } -} - -/* -BufferWithBytes returns a new gbytes.Buffer seeded with the passed in bytes -*/ -func BufferWithBytes(bytes []byte) *Buffer { - return &Buffer{ - lock: &sync.Mutex{}, - contents: bytes, - } -} - -/* -BufferReader returns a new gbytes.Buffer that wraps a reader. The reader's contents are read into -the Buffer via io.Copy -*/ -func BufferReader(reader io.Reader) *Buffer { - b := &Buffer{ - lock: &sync.Mutex{}, - } - - go func() { - io.Copy(b, reader) - b.Close() - }() - - return b -} - -/* -Write implements the io.Writer interface -*/ -func (b *Buffer) Write(p []byte) (n int, err error) { - b.lock.Lock() - defer b.lock.Unlock() - - if b.closed { - return 0, errors.New("attempt to write to closed buffer") - } - - b.contents = append(b.contents, p...) - return len(p), nil -} - -/* -Read implements the io.Reader interface. It advances the -cursor as it reads. - -Returns an error if called after Close. -*/ -func (b *Buffer) Read(d []byte) (int, error) { - b.lock.Lock() - defer b.lock.Unlock() - - if b.closed { - return 0, errors.New("attempt to read from closed buffer") - } - - if uint64(len(b.contents)) <= b.readCursor { - return 0, io.EOF - } - - n := copy(d, b.contents[b.readCursor:]) - b.readCursor += uint64(n) - - return n, nil -} - -/* -Close signifies that the buffer will no longer be written to -*/ -func (b *Buffer) Close() error { - b.lock.Lock() - defer b.lock.Unlock() - - b.closed = true - - return nil -} - -/* -Closed returns true if the buffer has been closed -*/ -func (b *Buffer) Closed() bool { - b.lock.Lock() - defer b.lock.Unlock() - - return b.closed -} - -/* -Contents returns all data ever written to the buffer. -*/ -func (b *Buffer) Contents() []byte { - b.lock.Lock() - defer b.lock.Unlock() - - contents := make([]byte, len(b.contents)) - copy(contents, b.contents) - return contents -} - -/* -Detect takes a regular expression and returns a channel. - -The channel will receive true the first time data matching the regular expression is written to the buffer. -The channel is subsequently closed and the buffer's read-cursor is fast-forwarded to just after the matching region. - -You typically don't need to use Detect and should use the ghttp.Say matcher instead. Detect is useful, however, in cases where your code must -be branch and handle different outputs written to the buffer. - -For example, consider a buffer hooked up to the stdout of a client library. You may (or may not, depending on state outside of your control) need to authenticate the client library. - -You could do something like: - -select { -case <-buffer.Detect("You are not logged in"): - //log in -case <-buffer.Detect("Success"): - //carry on -case <-time.After(time.Second): - //welp -} -buffer.CancelDetects() - -You should always call CancelDetects after using Detect. This will close any channels that have not detected and clean up the goroutines that were spawned to support them. - -Finally, you can pass detect a format string followed by variadic arguments. This will construct the regexp using fmt.Sprintf. -*/ -func (b *Buffer) Detect(desired string, args ...interface{}) chan bool { - formattedRegexp := desired - if len(args) > 0 { - formattedRegexp = fmt.Sprintf(desired, args...) - } - re := regexp.MustCompile(formattedRegexp) - - b.lock.Lock() - defer b.lock.Unlock() - - if b.detectCloser == nil { - b.detectCloser = make(chan interface{}) - } - - closer := b.detectCloser - response := make(chan bool) - go func() { - ticker := time.NewTicker(10 * time.Millisecond) - defer ticker.Stop() - defer close(response) - for { - select { - case <-ticker.C: - b.lock.Lock() - data, cursor := b.contents[b.readCursor:], b.readCursor - loc := re.FindIndex(data) - b.lock.Unlock() - - if loc != nil { - response <- true - b.lock.Lock() - newCursorPosition := cursor + uint64(loc[1]) - if newCursorPosition >= b.readCursor { - b.readCursor = newCursorPosition - } - b.lock.Unlock() - return - } - case <-closer: - return - } - } - }() - - return response -} - -/* -CancelDetects cancels any pending detects and cleans up their goroutines. You should always call this when you're done with a set of Detect channels. -*/ -func (b *Buffer) CancelDetects() { - b.lock.Lock() - defer b.lock.Unlock() - - close(b.detectCloser) - b.detectCloser = nil -} - -func (b *Buffer) didSay(re *regexp.Regexp) (bool, []byte) { - b.lock.Lock() - defer b.lock.Unlock() - - unreadBytes := b.contents[b.readCursor:] - copyOfUnreadBytes := make([]byte, len(unreadBytes)) - copy(copyOfUnreadBytes, unreadBytes) - - loc := re.FindIndex(unreadBytes) - - if loc != nil { - b.readCursor += uint64(loc[1]) - return true, copyOfUnreadBytes - } - return false, copyOfUnreadBytes -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer_test.go deleted file mode 100644 index 9d4e827..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/buffer_test.go +++ /dev/null @@ -1,205 +0,0 @@ -package gbytes_test - -import ( - "io" - "time" - - . "github.com/onsi/gomega/gbytes" - - "bytes" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -type SlowReader struct { - R io.Reader - D time.Duration -} - -func (s SlowReader) Read(p []byte) (int, error) { - time.Sleep(s.D) - return s.R.Read(p) -} - -var _ = Describe("Buffer", func() { - var buffer *Buffer - - BeforeEach(func() { - buffer = NewBuffer() - }) - - Describe("dumping the entire contents of the buffer", func() { - It("should return everything that's been written", func() { - buffer.Write([]byte("abc")) - buffer.Write([]byte("def")) - Expect(buffer.Contents()).Should(Equal([]byte("abcdef"))) - - Expect(buffer).Should(Say("bcd")) - Expect(buffer.Contents()).Should(Equal([]byte("abcdef"))) - }) - }) - - Describe("creating a buffer with bytes", func() { - It("should create the buffer with the cursor set to the beginning", func() { - buffer := BufferWithBytes([]byte("abcdef")) - Expect(buffer.Contents()).Should(Equal([]byte("abcdef"))) - Expect(buffer).Should(Say("abc")) - Expect(buffer).ShouldNot(Say("abc")) - Expect(buffer).Should(Say("def")) - }) - }) - - Describe("creating a buffer that wraps a reader", func() { - Context("for a well-behaved reader", func() { - It("should buffer the contents of the reader", func() { - reader := bytes.NewBuffer([]byte("abcdef")) - buffer := BufferReader(reader) - Eventually(buffer).Should(Say("abc")) - Expect(buffer).ShouldNot(Say("abc")) - Eventually(buffer).Should(Say("def")) - Eventually(buffer.Closed).Should(BeTrue()) - }) - }) - - Context("for a slow reader", func() { - It("should allow Eventually to time out", func() { - slowReader := SlowReader{ - R: bytes.NewBuffer([]byte("abcdef")), - D: time.Second, - } - buffer := BufferReader(slowReader) - failures := InterceptGomegaFailures(func() { - Eventually(buffer, 100*time.Millisecond).Should(Say("abc")) - }) - Expect(failures).ShouldNot(BeEmpty()) - - fastReader := SlowReader{ - R: bytes.NewBuffer([]byte("abcdef")), - D: time.Millisecond, - } - buffer = BufferReader(fastReader) - Eventually(buffer, 100*time.Millisecond).Should(Say("abc")) - Eventually(buffer.Closed).Should(BeTrue()) - }) - }) - }) - - Describe("reading from a buffer", func() { - It("should read the current contents of the buffer", func() { - buffer := BufferWithBytes([]byte("abcde")) - - dest := make([]byte, 3) - n, err := buffer.Read(dest) - Expect(err).ShouldNot(HaveOccurred()) - Expect(n).Should(Equal(3)) - Expect(string(dest)).Should(Equal("abc")) - - dest = make([]byte, 3) - n, err = buffer.Read(dest) - Expect(err).ShouldNot(HaveOccurred()) - Expect(n).Should(Equal(2)) - Expect(string(dest[:n])).Should(Equal("de")) - - n, err = buffer.Read(dest) - Expect(err).Should(Equal(io.EOF)) - Expect(n).Should(Equal(0)) - }) - - Context("after the buffer has been closed", func() { - It("returns an error", func() { - buffer := BufferWithBytes([]byte("abcde")) - - buffer.Close() - - dest := make([]byte, 3) - n, err := buffer.Read(dest) - Expect(err).Should(HaveOccurred()) - Expect(n).Should(Equal(0)) - }) - }) - }) - - Describe("detecting regular expressions", func() { - It("should fire the appropriate channel when the passed in pattern matches, then close it", func(done Done) { - go func() { - time.Sleep(10 * time.Millisecond) - buffer.Write([]byte("abcde")) - }() - - A := buffer.Detect("%s", "a.c") - B := buffer.Detect("def") - - var gotIt bool - select { - case gotIt = <-A: - case <-B: - Fail("should not have gotten here") - } - - Expect(gotIt).Should(BeTrue()) - Eventually(A).Should(BeClosed()) - - buffer.Write([]byte("f")) - Eventually(B).Should(Receive()) - Eventually(B).Should(BeClosed()) - - close(done) - }) - - It("should fast-forward the buffer upon detection", func(done Done) { - buffer.Write([]byte("abcde")) - <-buffer.Detect("abc") - Expect(buffer).ShouldNot(Say("abc")) - Expect(buffer).Should(Say("de")) - close(done) - }) - - It("should only fast-forward the buffer when the channel is read, and only if doing so would not rewind it", func(done Done) { - buffer.Write([]byte("abcde")) - A := buffer.Detect("abc") - time.Sleep(20 * time.Millisecond) //give the goroutine a chance to detect and write to the channel - Expect(buffer).Should(Say("abcd")) - <-A - Expect(buffer).ShouldNot(Say("d")) - Expect(buffer).Should(Say("e")) - Eventually(A).Should(BeClosed()) - close(done) - }) - - It("should be possible to cancel a detection", func(done Done) { - A := buffer.Detect("abc") - B := buffer.Detect("def") - buffer.CancelDetects() - buffer.Write([]byte("abcdef")) - Eventually(A).Should(BeClosed()) - Eventually(B).Should(BeClosed()) - - Expect(buffer).Should(Say("bcde")) - <-buffer.Detect("f") - close(done) - }) - }) - - Describe("closing the buffer", func() { - It("should error when further write attempts are made", func() { - _, err := buffer.Write([]byte("abc")) - Expect(err).ShouldNot(HaveOccurred()) - - buffer.Close() - - _, err = buffer.Write([]byte("def")) - Expect(err).Should(HaveOccurred()) - - Expect(buffer.Contents()).Should(Equal([]byte("abc"))) - }) - - It("should be closed", func() { - Expect(buffer.Closed()).Should(BeFalse()) - - buffer.Close() - - Expect(buffer.Closed()).Should(BeTrue()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/gbuffer_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/gbuffer_suite_test.go deleted file mode 100644 index 3a7dc06..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/gbuffer_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package gbytes_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestGbytes(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Gbytes Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers.go deleted file mode 100644 index 3caed87..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers.go +++ /dev/null @@ -1,85 +0,0 @@ -package gbytes - -import ( - "errors" - "io" - "time" -) - -// ErrTimeout is returned by TimeoutCloser, TimeoutReader, and TimeoutWriter when the underlying Closer/Reader/Writer does not return within the specified timeout -var ErrTimeout = errors.New("timeout occurred") - -// TimeoutCloser returns an io.Closer that wraps the passed-in io.Closer. If the underlying Closer fails to close within the alloted timeout ErrTimeout is returned. -func TimeoutCloser(c io.Closer, timeout time.Duration) io.Closer { - return timeoutReaderWriterCloser{c: c, d: timeout} -} - -// TimeoutReader returns an io.Reader that wraps the passed-in io.Reader. If the underlying Reader fails to read within the alloted timeout ErrTimeout is returned. -func TimeoutReader(r io.Reader, timeout time.Duration) io.Reader { - return timeoutReaderWriterCloser{r: r, d: timeout} -} - -// TimeoutWriter returns an io.Writer that wraps the passed-in io.Writer. If the underlying Writer fails to write within the alloted timeout ErrTimeout is returned. -func TimeoutWriter(w io.Writer, timeout time.Duration) io.Writer { - return timeoutReaderWriterCloser{w: w, d: timeout} -} - -type timeoutReaderWriterCloser struct { - c io.Closer - w io.Writer - r io.Reader - d time.Duration -} - -func (t timeoutReaderWriterCloser) Close() error { - done := make(chan struct{}) - var err error - - go func() { - err = t.c.Close() - close(done) - }() - - select { - case <-done: - return err - case <-time.After(t.d): - return ErrTimeout - } -} - -func (t timeoutReaderWriterCloser) Read(p []byte) (int, error) { - done := make(chan struct{}) - var n int - var err error - - go func() { - n, err = t.r.Read(p) - close(done) - }() - - select { - case <-done: - return n, err - case <-time.After(t.d): - return 0, ErrTimeout - } -} - -func (t timeoutReaderWriterCloser) Write(p []byte) (int, error) { - done := make(chan struct{}) - var n int - var err error - - go func() { - n, err = t.w.Write(p) - close(done) - }() - - select { - case <-done: - return n, err - case <-time.After(t.d): - return 0, ErrTimeout - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers_test.go deleted file mode 100644 index 3da9734..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/io_wrappers_test.go +++ /dev/null @@ -1,188 +0,0 @@ -package gbytes_test - -import ( - "fmt" - "io" - "time" - - . "github.com/onsi/gomega/gbytes" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -type FakeCloser struct { - err error - duration time.Duration -} - -func (f FakeCloser) Close() error { - time.Sleep(f.duration) - return f.err -} - -type FakeReader struct { - err error - duration time.Duration -} - -func (f FakeReader) Read(p []byte) (int, error) { - time.Sleep(f.duration) - if f.err != nil { - return 0, f.err - } - - for i := 0; i < len(p); i++ { - p[i] = 'a' - } - - return len(p), nil -} - -type FakeWriter struct { - err error - duration time.Duration -} - -func (f FakeWriter) Write(p []byte) (int, error) { - time.Sleep(f.duration) - if f.err != nil { - return 0, f.err - } - - return len(p), nil -} - -var _ = Describe("Io Wrappers", func() { - Describe("TimeoutCloser", func() { - var innerCloser io.Closer - var timeoutCloser io.Closer - - JustBeforeEach(func() { - timeoutCloser = TimeoutCloser(innerCloser, 20*time.Millisecond) - }) - - Context("when the underlying Closer closes with no error", func() { - BeforeEach(func() { - innerCloser = FakeCloser{} - }) - - It("returns with no error", func() { - Expect(timeoutCloser.Close()).Should(Succeed()) - }) - }) - - Context("when the underlying Closer closes with an error", func() { - BeforeEach(func() { - innerCloser = FakeCloser{err: fmt.Errorf("boom")} - }) - - It("returns the error", func() { - Expect(timeoutCloser.Close()).Should(MatchError("boom")) - }) - }) - - Context("when the underlying Closer hangs", func() { - BeforeEach(func() { - innerCloser = FakeCloser{ - err: fmt.Errorf("boom"), - duration: time.Hour, - } - }) - - It("returns ErrTimeout", func() { - Expect(timeoutCloser.Close()).Should(MatchError(ErrTimeout)) - }) - }) - }) - - Describe("TimeoutReader", func() { - var innerReader io.Reader - var timeoutReader io.Reader - - JustBeforeEach(func() { - timeoutReader = TimeoutReader(innerReader, 20*time.Millisecond) - }) - - Context("when the underlying Reader returns no error", func() { - BeforeEach(func() { - innerReader = FakeReader{} - }) - - It("returns with no error", func() { - p := make([]byte, 5) - n, err := timeoutReader.Read(p) - Expect(n).Should(Equal(5)) - Expect(err).ShouldNot(HaveOccurred()) - Expect(p).Should(Equal([]byte("aaaaa"))) - }) - }) - - Context("when the underlying Reader returns an error", func() { - BeforeEach(func() { - innerReader = FakeReader{err: fmt.Errorf("boom")} - }) - - It("returns the error", func() { - p := make([]byte, 5) - _, err := timeoutReader.Read(p) - Expect(err).Should(MatchError("boom")) - }) - }) - - Context("when the underlying Reader hangs", func() { - BeforeEach(func() { - innerReader = FakeReader{err: fmt.Errorf("boom"), duration: time.Hour} - }) - - It("returns ErrTimeout", func() { - p := make([]byte, 5) - _, err := timeoutReader.Read(p) - Expect(err).Should(MatchError(ErrTimeout)) - }) - }) - }) - - Describe("TimeoutWriter", func() { - var innerWriter io.Writer - var timeoutWriter io.Writer - - JustBeforeEach(func() { - timeoutWriter = TimeoutWriter(innerWriter, 20*time.Millisecond) - }) - - Context("when the underlying Writer returns no error", func() { - BeforeEach(func() { - innerWriter = FakeWriter{} - }) - - It("returns with no error", func() { - n, err := timeoutWriter.Write([]byte("aaaaa")) - Expect(n).Should(Equal(5)) - Expect(err).ShouldNot(HaveOccurred()) - }) - }) - - Context("when the underlying Writer returns an error", func() { - BeforeEach(func() { - innerWriter = FakeWriter{err: fmt.Errorf("boom")} - }) - - It("returns the error", func() { - _, err := timeoutWriter.Write([]byte("aaaaa")) - Expect(err).Should(MatchError("boom")) - }) - }) - - Context("when the underlying Writer hangs", func() { - BeforeEach(func() { - innerWriter = FakeWriter{err: fmt.Errorf("boom"), duration: time.Hour} - }) - - It("returns ErrTimeout", func() { - _, err := timeoutWriter.Write([]byte("aaaaa")) - Expect(err).Should(MatchError(ErrTimeout)) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher.go deleted file mode 100644 index c15ddbf..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher.go +++ /dev/null @@ -1,106 +0,0 @@ -// untested sections: 1 - -package gbytes - -import ( - "fmt" - "regexp" - - "github.com/onsi/gomega/format" -) - -//Objects satisfying the BufferProvider can be used with the Say matcher. -type BufferProvider interface { - Buffer() *Buffer -} - -/* -Say is a Gomega matcher that operates on gbytes.Buffers: - - Expect(buffer).Should(Say("something")) - -will succeed if the unread portion of the buffer matches the regular expression "something". - -When Say succeeds, it fast forwards the gbytes.Buffer's read cursor to just after the succesful match. -Thus, subsequent calls to Say will only match against the unread portion of the buffer - -Say pairs very well with Eventually. To assert that a buffer eventually receives data matching "[123]-star" within 3 seconds you can: - - Eventually(buffer, 3).Should(Say("[123]-star")) - -Ditto with consistently. To assert that a buffer does not receive data matching "never-see-this" for 1 second you can: - - Consistently(buffer, 1).ShouldNot(Say("never-see-this")) - -In addition to bytes.Buffers, Say can operate on objects that implement the gbytes.BufferProvider interface. -In such cases, Say simply operates on the *gbytes.Buffer returned by Buffer() - -If the buffer is closed, the Say matcher will tell Eventually to abort. -*/ -func Say(expected string, args ...interface{}) *sayMatcher { - if len(args) > 0 { - expected = fmt.Sprintf(expected, args...) - } - return &sayMatcher{ - re: regexp.MustCompile(expected), - } -} - -type sayMatcher struct { - re *regexp.Regexp - receivedSayings []byte -} - -func (m *sayMatcher) buffer(actual interface{}) (*Buffer, bool) { - var buffer *Buffer - - switch x := actual.(type) { - case *Buffer: - buffer = x - case BufferProvider: - buffer = x.Buffer() - default: - return nil, false - } - - return buffer, true -} - -func (m *sayMatcher) Match(actual interface{}) (success bool, err error) { - buffer, ok := m.buffer(actual) - if !ok { - return false, fmt.Errorf("Say must be passed a *gbytes.Buffer or BufferProvider. Got:\n%s", format.Object(actual, 1)) - } - - didSay, sayings := buffer.didSay(m.re) - m.receivedSayings = sayings - - return didSay, nil -} - -func (m *sayMatcher) FailureMessage(actual interface{}) (message string) { - return fmt.Sprintf( - "Got stuck at:\n%s\nWaiting for:\n%s", - format.IndentString(string(m.receivedSayings), 1), - format.IndentString(m.re.String(), 1), - ) -} - -func (m *sayMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return fmt.Sprintf( - "Saw:\n%s\nWhich matches the unexpected:\n%s", - format.IndentString(string(m.receivedSayings), 1), - format.IndentString(m.re.String(), 1), - ) -} - -func (m *sayMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { - switch x := actual.(type) { - case *Buffer: - return !x.Closed() - case BufferProvider: - return !x.Buffer().Closed() - default: - return true - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher_test.go deleted file mode 100644 index 0055d4a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gbytes/say_matcher_test.go +++ /dev/null @@ -1,169 +0,0 @@ -package gbytes_test - -import ( - "time" - - . "github.com/onsi/gomega/gbytes" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -type speaker struct { - buffer *Buffer -} - -func (s *speaker) Buffer() *Buffer { - return s.buffer -} - -var _ = Describe("SayMatcher", func() { - var buffer *Buffer - - BeforeEach(func() { - buffer = NewBuffer() - buffer.Write([]byte("abc")) - }) - - Context("when actual is not a gexec Buffer, or a BufferProvider", func() { - It("should error", func() { - failures := InterceptGomegaFailures(func() { - Expect("foo").Should(Say("foo")) - }) - Expect(failures[0]).Should(ContainSubstring("*gbytes.Buffer")) - }) - }) - - Context("when a match is found", func() { - It("should succeed", func() { - Expect(buffer).Should(Say("abc")) - }) - - It("should support printf-like formatting", func() { - Expect(buffer).Should(Say("a%sc", "b")) - }) - - It("should match literal %", func() { - buffer.Write([]byte("%")) - Expect(buffer).Should(Say("abc%")) - }) - - It("should use a regular expression", func() { - Expect(buffer).Should(Say("a.c")) - }) - - It("should fastforward the buffer", func() { - buffer.Write([]byte("def")) - Expect(buffer).Should(Say("abcd")) - Expect(buffer).Should(Say("ef")) - Expect(buffer).ShouldNot(Say("[a-z]")) - }) - }) - - Context("when no match is found", func() { - It("should not error", func() { - Expect(buffer).ShouldNot(Say("def")) - }) - - Context("when the buffer is closed", func() { - BeforeEach(func() { - buffer.Close() - }) - - It("should abort an eventually", func() { - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(buffer).Should(Say("def")) - }) - Eventually(buffer).ShouldNot(Say("def")) - Expect(time.Since(t)).Should(BeNumerically("<", 500*time.Millisecond)) - Expect(failures).Should(HaveLen(1)) - - t = time.Now() - Eventually(buffer).Should(Say("abc")) - Expect(time.Since(t)).Should(BeNumerically("<", 500*time.Millisecond)) - }) - - It("should abort a consistently", func() { - t := time.Now() - Consistently(buffer, 2.0).ShouldNot(Say("def")) - Expect(time.Since(t)).Should(BeNumerically("<", 500*time.Millisecond)) - }) - - It("should not error with a synchronous matcher", func() { - Expect(buffer).ShouldNot(Say("def")) - Expect(buffer).Should(Say("abc")) - }) - }) - }) - - Context("when a positive match fails", func() { - It("should report where it got stuck", func() { - Expect(buffer).Should(Say("abc")) - buffer.Write([]byte("def")) - failures := InterceptGomegaFailures(func() { - Expect(buffer).Should(Say("abc")) - }) - Expect(failures[0]).Should(ContainSubstring("Got stuck at:")) - Expect(failures[0]).Should(ContainSubstring("def")) - }) - }) - - Context("when a negative match fails", func() { - It("should report where it got stuck", func() { - failures := InterceptGomegaFailures(func() { - Expect(buffer).ShouldNot(Say("abc")) - }) - Expect(failures[0]).Should(ContainSubstring("Saw:")) - Expect(failures[0]).Should(ContainSubstring("Which matches the unexpected:")) - Expect(failures[0]).Should(ContainSubstring("abc")) - }) - }) - - Context("when a match is not found", func() { - It("should not fastforward the buffer", func() { - Expect(buffer).ShouldNot(Say("def")) - Expect(buffer).Should(Say("abc")) - }) - }) - - Context("a nice real-life example", func() { - It("should behave well", func() { - Expect(buffer).Should(Say("abc")) - go func() { - time.Sleep(10 * time.Millisecond) - buffer.Write([]byte("def")) - }() - Expect(buffer).ShouldNot(Say("def")) - Eventually(buffer).Should(Say("def")) - }) - }) - - Context("when actual is a BufferProvider", func() { - It("should use actual's buffer", func() { - s := &speaker{ - buffer: NewBuffer(), - } - - Expect(s).ShouldNot(Say("abc")) - - s.Buffer().Write([]byte("abc")) - Expect(s).Should(Say("abc")) - }) - - It("should abort an eventually", func() { - s := &speaker{ - buffer: NewBuffer(), - } - - s.buffer.Close() - - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(s).Should(Say("def")) - }) - Expect(failures).Should(HaveLen(1)) - Expect(time.Since(t)).Should(BeNumerically("<", 500*time.Millisecond)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go deleted file mode 100644 index 16091c2..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/_fixture/firefly/main.go +++ /dev/null @@ -1,36 +0,0 @@ -package main - -import ( - "fmt" - "math/rand" - "os" - "strconv" - "time" -) - -var outQuote = "We've done the impossible, and that makes us mighty." -var errQuote = "Ah, curse your sudden but inevitable betrayal!" - -var randomQuotes = []string{ - "Can we maybe vote on the whole murdering people issue?", - "I swear by my pretty floral bonnet, I will end you.", - "My work's illegal, but at least it's honest.", -} - -func main() { - fmt.Fprintln(os.Stdout, outQuote) - fmt.Fprintln(os.Stderr, errQuote) - - randomIndex := rand.New(rand.NewSource(time.Now().UnixNano())).Intn(len(randomQuotes)) - - time.Sleep(100 * time.Millisecond) - - fmt.Fprintln(os.Stdout, randomQuotes[randomIndex]) - - if len(os.Args) == 2 { - exitCode, _ := strconv.Atoi(os.Args[1]) - os.Exit(exitCode) - } else { - os.Exit(randomIndex) - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/build.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/build.go deleted file mode 100644 index ce1574d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/build.go +++ /dev/null @@ -1,114 +0,0 @@ -// untested sections: 5 - -package gexec - -import ( - "errors" - "fmt" - "go/build" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "runtime" - "strings" - "sync" -) - -var ( - mu sync.Mutex - tmpDir string -) - -/* -Build uses go build to compile the package at packagePath. The resulting binary is saved off in a temporary directory. -A path pointing to this binary is returned. - -Build uses the $GOPATH set in your environment. If $GOPATH is not set and you are using Go 1.8+, -it will use the default GOPATH instead. It passes the variadic args on to `go build`. -*/ -func Build(packagePath string, args ...string) (compiledPath string, err error) { - return doBuild(build.Default.GOPATH, packagePath, nil, args...) -} - -/* -BuildWithEnvironment is identical to Build but allows you to specify env vars to be set at build time. -*/ -func BuildWithEnvironment(packagePath string, env []string, args ...string) (compiledPath string, err error) { - return doBuild(build.Default.GOPATH, packagePath, env, args...) -} - -/* -BuildIn is identical to Build but allows you to specify a custom $GOPATH (the first argument). -*/ -func BuildIn(gopath string, packagePath string, args ...string) (compiledPath string, err error) { - return doBuild(gopath, packagePath, nil, args...) -} - -func replaceGoPath(environ []string, newGoPath string) []string { - newEnviron := []string{} - for _, v := range environ { - if !strings.HasPrefix(v, "GOPATH=") { - newEnviron = append(newEnviron, v) - } - } - return append(newEnviron, "GOPATH="+newGoPath) -} - -func doBuild(gopath, packagePath string, env []string, args ...string) (compiledPath string, err error) { - tmpDir, err := temporaryDirectory() - if err != nil { - return "", err - } - - if len(gopath) == 0 { - return "", errors.New("$GOPATH not provided when building " + packagePath) - } - - executable := filepath.Join(tmpDir, path.Base(packagePath)) - if runtime.GOOS == "windows" { - executable = executable + ".exe" - } - - cmdArgs := append([]string{"build"}, args...) - cmdArgs = append(cmdArgs, "-o", executable, packagePath) - - build := exec.Command("go", cmdArgs...) - build.Env = replaceGoPath(os.Environ(), gopath) - build.Env = append(build.Env, env...) - - output, err := build.CombinedOutput() - if err != nil { - return "", fmt.Errorf("Failed to build %s:\n\nError:\n%s\n\nOutput:\n%s", packagePath, err, string(output)) - } - - return executable, nil -} - -/* -You should call CleanupBuildArtifacts before your test ends to clean up any temporary artifacts generated by -gexec. In Ginkgo this is typically done in an AfterSuite callback. -*/ -func CleanupBuildArtifacts() { - mu.Lock() - defer mu.Unlock() - if tmpDir != "" { - os.RemoveAll(tmpDir) - tmpDir = "" - } -} - -func temporaryDirectory() (string, error) { - var err error - mu.Lock() - defer mu.Unlock() - if tmpDir == "" { - tmpDir, err = ioutil.TempDir("", "gexec_artifacts") - if err != nil { - return "", err - } - } - - return ioutil.TempDir(tmpDir, "g") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/build_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/build_test.go deleted file mode 100644 index 295dac8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/build_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package gexec_test - -import ( - "fmt" - "io/ioutil" - "os" - "path/filepath" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" -) - -var packagePath = "./_fixture/firefly" - -var _ = Describe(".Build", func() { - Context("when there have been previous calls to Build", func() { - BeforeEach(func() { - _, err := gexec.Build(packagePath) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("compiles the specified package", func() { - compiledPath, err := gexec.Build(packagePath) - Expect(err).ShouldNot(HaveOccurred()) - Expect(compiledPath).Should(BeAnExistingFile()) - }) - - Context("and CleanupBuildArtifacts has been called", func() { - BeforeEach(func() { - gexec.CleanupBuildArtifacts() - }) - - It("compiles the specified package", func() { - var err error - fireflyPath, err = gexec.Build(packagePath) - Expect(err).ShouldNot(HaveOccurred()) - Expect(fireflyPath).Should(BeAnExistingFile()) - }) - }) - }) -}) - -var _ = Describe(".BuildWithEnvironment", func() { - var err error - env := []string{ - "GOOS=linux", - "GOARCH=amd64", - } - - It("compiles the specified package with the specified env vars", func() { - compiledPath, err := gexec.BuildWithEnvironment(packagePath, env) - Expect(err).ShouldNot(HaveOccurred()) - Expect(compiledPath).Should(BeAnExistingFile()) - }) - - It("returns the environment to a good state", func() { - _, err = gexec.BuildWithEnvironment(packagePath, env) - Expect(err).ShouldNot(HaveOccurred()) - Expect(os.Environ()).ShouldNot(ContainElement("GOOS=linux")) - }) -}) - -var _ = Describe(".BuildIn", func() { - const ( - target = "github.com/onsi/gomega/gexec/_fixture/firefly/" - ) - - var ( - original string - gopath string - ) - - BeforeEach(func() { - var err error - original = os.Getenv("GOPATH") - gopath, err = ioutil.TempDir("", "") - Expect(err).NotTo(HaveOccurred()) - copyFile(filepath.Join("_fixture", "firefly", "main.go"), filepath.Join(gopath, "src", target), "main.go") - Expect(os.Setenv("GOPATH", filepath.Join(os.TempDir(), "emptyFakeGopath"))).To(Succeed()) - Expect(os.Environ()).To(ContainElement(fmt.Sprintf("GOPATH=%s", filepath.Join(os.TempDir(), "emptyFakeGopath")))) - }) - - AfterEach(func() { - if original == "" { - Expect(os.Unsetenv("GOPATH")).To(Succeed()) - } else { - Expect(os.Setenv("GOPATH", original)).To(Succeed()) - } - if gopath != "" { - os.RemoveAll(gopath) - } - }) - - It("appends the gopath env var", func() { - _, err := gexec.BuildIn(gopath, target) - Expect(err).NotTo(HaveOccurred()) - }) - - It("resets GOPATH to its original value", func() { - _, err := gexec.BuildIn(gopath, target) - Expect(err).NotTo(HaveOccurred()) - Expect(os.Getenv("GOPATH")).To(Equal(filepath.Join(os.TempDir(), "emptyFakeGopath"))) - }) -}) - -func copyFile(source, directory, basename string) { - Expect(os.MkdirAll(directory, 0755)).To(Succeed()) - content, err := ioutil.ReadFile(source) - Expect(err).NotTo(HaveOccurred()) - Expect(ioutil.WriteFile(filepath.Join(directory, basename), content, 0644)).To(Succeed()) -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher.go deleted file mode 100644 index 6e70de6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher.go +++ /dev/null @@ -1,88 +0,0 @@ -// untested sections: 2 - -package gexec - -import ( - "fmt" - - "github.com/onsi/gomega/format" -) - -/* -The Exit matcher operates on a session: - - Expect(session).Should(Exit()) - -Exit passes if the session has already exited. - -If no status code is provided, then Exit will succeed if the session has exited regardless of exit code. -Otherwise, Exit will only succeed if the process has exited with the provided status code. - -Note that the process must have already exited. To wait for a process to exit, use Eventually: - - Eventually(session, 3).Should(Exit(0)) -*/ -func Exit(optionalExitCode ...int) *exitMatcher { - exitCode := -1 - if len(optionalExitCode) > 0 { - exitCode = optionalExitCode[0] - } - - return &exitMatcher{ - exitCode: exitCode, - } -} - -type exitMatcher struct { - exitCode int - didExit bool - actualExitCode int -} - -type Exiter interface { - ExitCode() int -} - -func (m *exitMatcher) Match(actual interface{}) (success bool, err error) { - exiter, ok := actual.(Exiter) - if !ok { - return false, fmt.Errorf("Exit must be passed a gexec.Exiter (Missing method ExitCode() int) Got:\n%s", format.Object(actual, 1)) - } - - m.actualExitCode = exiter.ExitCode() - - if m.actualExitCode == -1 { - return false, nil - } - - if m.exitCode == -1 { - return true, nil - } - return m.exitCode == m.actualExitCode, nil -} - -func (m *exitMatcher) FailureMessage(actual interface{}) (message string) { - if m.actualExitCode == -1 { - return "Expected process to exit. It did not." - } - return format.Message(m.actualExitCode, "to match exit code:", m.exitCode) -} - -func (m *exitMatcher) NegatedFailureMessage(actual interface{}) (message string) { - if m.actualExitCode == -1 { - return "you really shouldn't be able to see this!" - } else { - if m.exitCode == -1 { - return "Expected process not to exit. It did." - } - return format.Message(m.actualExitCode, "not to match exit code:", m.exitCode) - } -} - -func (m *exitMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { - session, ok := actual.(*Session) - if ok { - return session.ExitCode() == -1 - } - return true -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher_test.go deleted file mode 100644 index 9abc322..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/exit_matcher_test.go +++ /dev/null @@ -1,114 +0,0 @@ -package gexec_test - -import ( - "os/exec" - "time" - - . "github.com/onsi/gomega/gexec" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -type NeverExits struct{} - -func (e NeverExits) ExitCode() int { - return -1 -} - -var _ = Describe("ExitMatcher", func() { - var command *exec.Cmd - var session *Session - - BeforeEach(func() { - var err error - command = exec.Command(fireflyPath, "0") - session, err = Start(command, nil, nil) - Expect(err).ShouldNot(HaveOccurred()) - }) - - Describe("when passed something that is an Exiter", func() { - It("should act normally", func() { - failures := InterceptGomegaFailures(func() { - Expect(NeverExits{}).Should(Exit()) - }) - - Expect(failures[0]).Should(ContainSubstring("Expected process to exit. It did not.")) - }) - }) - - Describe("when passed something that is not an Exiter", func() { - It("should error", func() { - failures := InterceptGomegaFailures(func() { - Expect("aardvark").Should(Exit()) - }) - - Expect(failures[0]).Should(ContainSubstring("Exit must be passed a gexec.Exiter")) - }) - }) - - Context("with no exit code", func() { - It("should say the right things when it fails", func() { - Expect(session).ShouldNot(Exit()) - - failures := InterceptGomegaFailures(func() { - Expect(session).Should(Exit()) - }) - - Expect(failures[0]).Should(ContainSubstring("Expected process to exit. It did not.")) - - Eventually(session).Should(Exit()) - - Expect(session).Should(Exit()) - - failures = InterceptGomegaFailures(func() { - Expect(session).ShouldNot(Exit()) - }) - - Expect(failures[0]).Should(ContainSubstring("Expected process not to exit. It did.")) - }) - }) - - Context("with an exit code", func() { - It("should say the right things when it fails", func() { - Expect(session).ShouldNot(Exit(0)) - Expect(session).ShouldNot(Exit(1)) - - failures := InterceptGomegaFailures(func() { - Expect(session).Should(Exit(0)) - }) - - Expect(failures[0]).Should(ContainSubstring("Expected process to exit. It did not.")) - - Eventually(session).Should(Exit(0)) - - Expect(session).Should(Exit(0)) - - failures = InterceptGomegaFailures(func() { - Expect(session).Should(Exit(1)) - }) - - Expect(failures[0]).Should(ContainSubstring("to match exit code:")) - - Expect(session).ShouldNot(Exit(1)) - - failures = InterceptGomegaFailures(func() { - Expect(session).ShouldNot(Exit(0)) - }) - - Expect(failures[0]).Should(ContainSubstring("not to match exit code:")) - }) - }) - - Describe("bailing out early", func() { - It("should bail out early once the process exits", func() { - t := time.Now() - - failures := InterceptGomegaFailures(func() { - Eventually(session).Should(Exit(1)) - }) - Expect(time.Since(t)).Should(BeNumerically("<=", 500*time.Millisecond)) - Expect(failures).Should(HaveLen(1)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/gexec_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/gexec_suite_test.go deleted file mode 100644 index dc8e1f4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/gexec_suite_test.go +++ /dev/null @@ -1,26 +0,0 @@ -package gexec_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" - - "testing" -) - -var fireflyPath string - -func TestGexec(t *testing.T) { - BeforeSuite(func() { - var err error - fireflyPath, err = gexec.Build("./_fixture/firefly") - Expect(err).ShouldNot(HaveOccurred()) - }) - - AfterSuite(func() { - gexec.CleanupBuildArtifacts() - }) - - RegisterFailHandler(Fail) - RunSpecs(t, "Gexec Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go deleted file mode 100644 index ee3cf40..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer.go +++ /dev/null @@ -1,55 +0,0 @@ -// untested sections: 1 - -package gexec - -import ( - "io" - "sync" -) - -/* -PrefixedWriter wraps an io.Writer, emiting the passed in prefix at the beginning of each new line. -This can be useful when running multiple gexec.Sessions concurrently - you can prefix the log output of each -session by passing in a PrefixedWriter: - -gexec.Start(cmd, NewPrefixedWriter("[my-cmd] ", GinkgoWriter), NewPrefixedWriter("[my-cmd] ", GinkgoWriter)) -*/ -type PrefixedWriter struct { - prefix []byte - writer io.Writer - lock *sync.Mutex - atStartOfLine bool -} - -func NewPrefixedWriter(prefix string, writer io.Writer) *PrefixedWriter { - return &PrefixedWriter{ - prefix: []byte(prefix), - writer: writer, - lock: &sync.Mutex{}, - atStartOfLine: true, - } -} - -func (w *PrefixedWriter) Write(b []byte) (int, error) { - w.lock.Lock() - defer w.lock.Unlock() - - toWrite := []byte{} - - for _, c := range b { - if w.atStartOfLine { - toWrite = append(toWrite, w.prefix...) - } - - toWrite = append(toWrite, c) - - w.atStartOfLine = c == '\n' - } - - _, err := w.writer.Write(toWrite) - if err != nil { - return 0, err - } - - return len(b), nil -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer_test.go deleted file mode 100644 index e847b15..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/prefixed_writer_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package gexec_test - -import ( - "bytes" - - . "github.com/onsi/gomega/gexec" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("PrefixedWriter", func() { - var buffer *bytes.Buffer - var writer *PrefixedWriter - BeforeEach(func() { - buffer = &bytes.Buffer{} - writer = NewPrefixedWriter("[p]", buffer) - }) - - It("should emit the prefix on newlines", func() { - writer.Write([]byte("abc")) - writer.Write([]byte("def\n")) - writer.Write([]byte("hij\n")) - writer.Write([]byte("\n\n")) - writer.Write([]byte("klm\n\nnop")) - writer.Write([]byte("")) - writer.Write([]byte("qrs")) - writer.Write([]byte("\ntuv\nwx")) - writer.Write([]byte("yz\n\n")) - - Expect(buffer.String()).Should(Equal(`[p]abcdef -[p]hij -[p] -[p] -[p]klm -[p] -[p]nopqrs -[p]tuv -[p]wxyz -[p] -`)) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/session.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/session.go deleted file mode 100644 index 6a09140..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/session.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -Package gexec provides support for testing external processes. -*/ - -// untested sections: 1 - -package gexec - -import ( - "io" - "os" - "os/exec" - "sync" - "syscall" - - . "github.com/onsi/gomega" - "github.com/onsi/gomega/gbytes" -) - -const INVALID_EXIT_CODE = 254 - -type Session struct { - //The wrapped command - Command *exec.Cmd - - //A *gbytes.Buffer connected to the command's stdout - Out *gbytes.Buffer - - //A *gbytes.Buffer connected to the command's stderr - Err *gbytes.Buffer - - //A channel that will close when the command exits - Exited <-chan struct{} - - lock *sync.Mutex - exitCode int -} - -/* -Start starts the passed-in *exec.Cmd command. It wraps the command in a *gexec.Session. - -The session pipes the command's stdout and stderr to two *gbytes.Buffers available as properties on the session: session.Out and session.Err. -These buffers can be used with the gbytes.Say matcher to match against unread output: - - Expect(session.Out).Should(gbytes.Say("foo-out")) - Expect(session.Err).Should(gbytes.Say("foo-err")) - -In addition, Session satisfies the gbytes.BufferProvider interface and provides the stdout *gbytes.Buffer. This allows you to replace the first line, above, with: - - Expect(session).Should(gbytes.Say("foo-out")) - -When outWriter and/or errWriter are non-nil, the session will pipe stdout and/or stderr output both into the session *gybtes.Buffers and to the passed-in outWriter/errWriter. -This is useful for capturing the process's output or logging it to screen. In particular, when using Ginkgo it can be convenient to direct output to the GinkgoWriter: - - session, err := Start(command, GinkgoWriter, GinkgoWriter) - -This will log output when running tests in verbose mode, but - otherwise - will only log output when a test fails. - -The session wrapper is responsible for waiting on the *exec.Cmd command. You *should not* call command.Wait() yourself. -Instead, to assert that the command has exited you can use the gexec.Exit matcher: - - Expect(session).Should(gexec.Exit()) - -When the session exits it closes the stdout and stderr gbytes buffers. This will short circuit any -Eventuallys waiting for the buffers to Say something. -*/ -func Start(command *exec.Cmd, outWriter io.Writer, errWriter io.Writer) (*Session, error) { - exited := make(chan struct{}) - - session := &Session{ - Command: command, - Out: gbytes.NewBuffer(), - Err: gbytes.NewBuffer(), - Exited: exited, - lock: &sync.Mutex{}, - exitCode: -1, - } - - var commandOut, commandErr io.Writer - - commandOut, commandErr = session.Out, session.Err - - if outWriter != nil { - commandOut = io.MultiWriter(commandOut, outWriter) - } - - if errWriter != nil { - commandErr = io.MultiWriter(commandErr, errWriter) - } - - command.Stdout = commandOut - command.Stderr = commandErr - - err := command.Start() - if err == nil { - go session.monitorForExit(exited) - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - trackedSessions = append(trackedSessions, session) - } - - return session, err -} - -/* -Buffer implements the gbytes.BufferProvider interface and returns s.Out -This allows you to make gbytes.Say matcher assertions against stdout without having to reference .Out: - - Eventually(session).Should(gbytes.Say("foo")) -*/ -func (s *Session) Buffer() *gbytes.Buffer { - return s.Out -} - -/* -ExitCode returns the wrapped command's exit code. If the command hasn't exited yet, ExitCode returns -1. - -To assert that the command has exited it is more convenient to use the Exit matcher: - - Eventually(s).Should(gexec.Exit()) - -When the process exits because it has received a particular signal, the exit code will be 128+signal-value -(See http://www.tldp.org/LDP/abs/html/exitcodes.html and http://man7.org/linux/man-pages/man7/signal.7.html) - -*/ -func (s *Session) ExitCode() int { - s.lock.Lock() - defer s.lock.Unlock() - return s.exitCode -} - -/* -Wait waits until the wrapped command exits. It can be passed an optional timeout. -If the command does not exit within the timeout, Wait will trigger a test failure. - -Wait returns the session, making it possible to chain: - - session.Wait().Out.Contents() - -will wait for the command to exit then return the entirety of Out's contents. - -Wait uses eventually under the hood and accepts the same timeout/polling intervals that eventually does. -*/ -func (s *Session) Wait(timeout ...interface{}) *Session { - EventuallyWithOffset(1, s, timeout...).Should(Exit()) - return s -} - -/* -Kill sends the running command a SIGKILL signal. It does not wait for the process to exit. - -If the command has already exited, Kill returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Kill() *Session { - return s.Signal(syscall.SIGKILL) -} - -/* -Interrupt sends the running command a SIGINT signal. It does not wait for the process to exit. - -If the command has already exited, Interrupt returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Interrupt() *Session { - return s.Signal(syscall.SIGINT) -} - -/* -Terminate sends the running command a SIGTERM signal. It does not wait for the process to exit. - -If the command has already exited, Terminate returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Terminate() *Session { - return s.Signal(syscall.SIGTERM) -} - -/* -Signal sends the running command the passed in signal. It does not wait for the process to exit. - -If the command has already exited, Signal returns silently. - -The session is returned to enable chaining. -*/ -func (s *Session) Signal(signal os.Signal) *Session { - if s.processIsAlive() { - s.Command.Process.Signal(signal) - } - return s -} - -func (s *Session) monitorForExit(exited chan<- struct{}) { - err := s.Command.Wait() - s.lock.Lock() - s.Out.Close() - s.Err.Close() - status := s.Command.ProcessState.Sys().(syscall.WaitStatus) - if status.Signaled() { - s.exitCode = 128 + int(status.Signal()) - } else { - exitStatus := status.ExitStatus() - if exitStatus == -1 && err != nil { - s.exitCode = INVALID_EXIT_CODE - } - s.exitCode = exitStatus - } - s.lock.Unlock() - - close(exited) -} - -func (s *Session) processIsAlive() bool { - return s.ExitCode() == -1 && s.Command.Process != nil -} - -var trackedSessions = []*Session{} -var trackedSessionsMutex = &sync.Mutex{} - -/* -Kill sends a SIGKILL signal to all the processes started by Run, and waits for them to exit. -The timeout specified is applied to each process killed. - -If any of the processes already exited, KillAndWait returns silently. -*/ -func KillAndWait(timeout ...interface{}) { - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - for _, session := range trackedSessions { - session.Kill().Wait(timeout...) - } - trackedSessions = []*Session{} -} - -/* -Kill sends a SIGTERM signal to all the processes started by Run, and waits for them to exit. -The timeout specified is applied to each process killed. - -If any of the processes already exited, TerminateAndWait returns silently. -*/ -func TerminateAndWait(timeout ...interface{}) { - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - for _, session := range trackedSessions { - session.Terminate().Wait(timeout...) - } -} - -/* -Kill sends a SIGKILL signal to all the processes started by Run. -It does not wait for the processes to exit. - -If any of the processes already exited, Kill returns silently. -*/ -func Kill() { - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - for _, session := range trackedSessions { - session.Kill() - } -} - -/* -Terminate sends a SIGTERM signal to all the processes started by Run. -It does not wait for the processes to exit. - -If any of the processes already exited, Terminate returns silently. -*/ -func Terminate() { - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - for _, session := range trackedSessions { - session.Terminate() - } -} - -/* -Signal sends the passed in signal to all the processes started by Run. -It does not wait for the processes to exit. - -If any of the processes already exited, Signal returns silently. -*/ -func Signal(signal os.Signal) { - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - for _, session := range trackedSessions { - session.Signal(signal) - } -} - -/* -Interrupt sends the SIGINT signal to all the processes started by Run. -It does not wait for the processes to exit. - -If any of the processes already exited, Interrupt returns silently. -*/ -func Interrupt() { - trackedSessionsMutex.Lock() - defer trackedSessionsMutex.Unlock() - for _, session := range trackedSessions { - session.Interrupt() - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/session_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gexec/session_test.go deleted file mode 100644 index d36f68e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gexec/session_test.go +++ /dev/null @@ -1,338 +0,0 @@ -// +build !windows - -package gexec_test - -import ( - "io" - "io/ioutil" - "os/exec" - "syscall" - "time" - - . "github.com/onsi/gomega/gbytes" - . "github.com/onsi/gomega/gexec" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("Session", func() { - var command *exec.Cmd - var session *Session - - var outWriter, errWriter io.Writer - - BeforeEach(func() { - outWriter = nil - errWriter = nil - }) - - JustBeforeEach(func() { - command = exec.Command(fireflyPath) - var err error - session, err = Start(command, outWriter, errWriter) - Expect(err).ShouldNot(HaveOccurred()) - }) - - Context("running a command", func() { - It("should start the process", func() { - Expect(command.Process).ShouldNot(BeNil()) - }) - - It("should wrap the process's stdout and stderr with gbytes buffers", func(done Done) { - Eventually(session.Out).Should(Say("We've done the impossible, and that makes us mighty")) - Eventually(session.Err).Should(Say("Ah, curse your sudden but inevitable betrayal!")) - defer session.Out.CancelDetects() - - select { - case <-session.Out.Detect("Can we maybe vote on the whole murdering people issue"): - Eventually(session).Should(Exit(0)) - case <-session.Out.Detect("I swear by my pretty floral bonnet, I will end you."): - Eventually(session).Should(Exit(1)) - case <-session.Out.Detect("My work's illegal, but at least it's honest."): - Eventually(session).Should(Exit(2)) - } - - close(done) - }) - - It("should satisfy the gbytes.BufferProvider interface, passing Stdout", func() { - Eventually(session).Should(Say("We've done the impossible, and that makes us mighty")) - Eventually(session).Should(Exit()) - }) - }) - - Describe("providing the exit code", func() { - It("should provide the app's exit code", func() { - Expect(session.ExitCode()).Should(Equal(-1)) - - Eventually(session).Should(Exit()) - Expect(session.ExitCode()).Should(BeNumerically(">=", 0)) - Expect(session.ExitCode()).Should(BeNumerically("<", 3)) - }) - }) - - Describe("wait", func() { - It("should wait till the command exits", func() { - Expect(session.ExitCode()).Should(Equal(-1)) - Expect(session.Wait().ExitCode()).Should(BeNumerically(">=", 0)) - Expect(session.Wait().ExitCode()).Should(BeNumerically("<", 3)) - }) - }) - - Describe("exited", func() { - It("should close when the command exits", func() { - Eventually(session.Exited).Should(BeClosed()) - Expect(session.ExitCode()).ShouldNot(Equal(-1)) - }) - }) - - Describe("kill", func() { - It("should kill the command", func() { - session, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session.Kill() - Eventually(session).Should(Exit(128 + 9)) - }) - }) - - Describe("interrupt", func() { - It("should interrupt the command", func() { - session, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session.Interrupt() - Eventually(session).Should(Exit(128 + 2)) - }) - }) - - Describe("terminate", func() { - It("should terminate the command", func() { - session, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session.Terminate() - Eventually(session).Should(Exit(128 + 15)) - }) - }) - - Describe("signal", func() { - It("should send the signal to the command", func() { - session, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session.Signal(syscall.SIGABRT) - Eventually(session).Should(Exit(128 + 6)) - }) - - It("should ignore sending a signal if the command did not start", func() { - session, err := Start(exec.Command("notexisting"), GinkgoWriter, GinkgoWriter) - Expect(err).To(HaveOccurred()) - - Expect(func() { session.Signal(syscall.SIGUSR1) }).NotTo(Panic()) - }) - }) - - Context("tracking sessions", func() { - BeforeEach(func() { - KillAndWait() - }) - - Describe("kill", func() { - It("should kill all the started sessions", func() { - session1, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - Kill() - - Eventually(session1).Should(Exit(128 + 9)) - Eventually(session2).Should(Exit(128 + 9)) - Eventually(session3).Should(Exit(128 + 9)) - }) - - It("should not track unstarted sessions", func() { - _, err := Start(exec.Command("does not exist", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).Should(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - Kill() - - Eventually(session2).Should(Exit(128 + 9)) - Eventually(session3).Should(Exit(128 + 9)) - }) - - }) - - Describe("killAndWait", func() { - It("should kill all the started sessions and wait for them to finish", func() { - session1, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - KillAndWait() - Expect(session1).Should(Exit(128+9), "Should have exited") - Expect(session2).Should(Exit(128+9), "Should have exited") - Expect(session3).Should(Exit(128+9), "Should have exited") - }) - }) - - Describe("terminate", func() { - It("should terminate all the started sessions", func() { - session1, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - Terminate() - - Eventually(session1).Should(Exit(128 + 15)) - Eventually(session2).Should(Exit(128 + 15)) - Eventually(session3).Should(Exit(128 + 15)) - }) - }) - - Describe("terminateAndWait", func() { - It("should terminate all the started sessions, and wait for them to exit", func() { - session1, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - TerminateAndWait() - - Expect(session1).Should(Exit(128+15), "Should have exited") - Expect(session2).Should(Exit(128+15), "Should have exited") - Expect(session3).Should(Exit(128+15), "Should have exited") - }) - }) - - Describe("signal", func() { - It("should signal all the started sessions", func() { - session1, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - Signal(syscall.SIGABRT) - - Eventually(session1).Should(Exit(128 + 6)) - Eventually(session2).Should(Exit(128 + 6)) - Eventually(session3).Should(Exit(128 + 6)) - }) - }) - - Describe("interrupt", func() { - It("should interrupt all the started sessions, and not wait", func() { - session1, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session2, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - session3, err := Start(exec.Command("sleep", "10000000"), GinkgoWriter, GinkgoWriter) - Expect(err).ShouldNot(HaveOccurred()) - - Interrupt() - - Eventually(session1).Should(Exit(128 + 2)) - Eventually(session2).Should(Exit(128 + 2)) - Eventually(session3).Should(Exit(128 + 2)) - }) - }) - }) - - Context("when the command exits", func() { - It("should close the buffers", func() { - Eventually(session).Should(Exit()) - - Expect(session.Out.Closed()).Should(BeTrue()) - Expect(session.Err.Closed()).Should(BeTrue()) - - Expect(session.Out).Should(Say("We've done the impossible, and that makes us mighty")) - }) - - var So = It - - So("this means that eventually should short circuit", func() { - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(session).Should(Say("blah blah blah blah blah")) - }) - Expect(time.Since(t)).Should(BeNumerically("<=", 500*time.Millisecond)) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Context("when wrapping out and err", func() { - var ( - outWriterBuffer, errWriterBuffer *Buffer - ) - - BeforeEach(func() { - outWriterBuffer = NewBuffer() - outWriter = outWriterBuffer - errWriterBuffer = NewBuffer() - errWriter = errWriterBuffer - }) - - It("should route to both the provided writers and the gbytes buffers", func() { - Eventually(session.Out).Should(Say("We've done the impossible, and that makes us mighty")) - Eventually(session.Err).Should(Say("Ah, curse your sudden but inevitable betrayal!")) - - Expect(outWriterBuffer.Contents()).Should(ContainSubstring("We've done the impossible, and that makes us mighty")) - Expect(errWriterBuffer.Contents()).Should(ContainSubstring("Ah, curse your sudden but inevitable betrayal!")) - - Eventually(session).Should(Exit()) - - Expect(outWriterBuffer.Contents()).Should(Equal(session.Out.Contents())) - Expect(errWriterBuffer.Contents()).Should(Equal(session.Err.Contents())) - }) - - Context("when discarding the output of the command", func() { - BeforeEach(func() { - outWriter = ioutil.Discard - errWriter = ioutil.Discard - }) - - It("executes succesfuly", func() { - Eventually(session).Should(Exit()) - }) - }) - }) - - Describe("when the command fails to start", func() { - It("should return an error", func() { - _, err := Start(exec.Command("agklsjdfas"), nil, nil) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/handlers.go b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/handlers.go deleted file mode 100644 index 64e612b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/handlers.go +++ /dev/null @@ -1,324 +0,0 @@ -// untested sections: 3 - -package ghttp - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "strings" - - "github.com/golang/protobuf/proto" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/types" -) - -//CombineHandler takes variadic list of handlers and produces one handler -//that calls each handler in order. -func CombineHandlers(handlers ...http.HandlerFunc) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - for _, handler := range handlers { - handler(w, req) - } - } -} - -//VerifyRequest returns a handler that verifies that a request uses the specified method to connect to the specified path -//You may also pass in an optional rawQuery string which is tested against the request's `req.URL.RawQuery` -// -//For path, you may pass in a string, in which case strict equality will be applied -//Alternatively you can pass in a matcher (ContainSubstring("/foo") and MatchRegexp("/foo/[a-f0-9]+") for example) -func VerifyRequest(method string, path interface{}, rawQuery ...string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - Expect(req.Method).Should(Equal(method), "Method mismatch") - switch p := path.(type) { - case types.GomegaMatcher: - Expect(req.URL.Path).Should(p, "Path mismatch") - default: - Expect(req.URL.Path).Should(Equal(path), "Path mismatch") - } - if len(rawQuery) > 0 { - values, err := url.ParseQuery(rawQuery[0]) - Expect(err).ShouldNot(HaveOccurred(), "Expected RawQuery is malformed") - - Expect(req.URL.Query()).Should(Equal(values), "RawQuery mismatch") - } - } -} - -//VerifyContentType returns a handler that verifies that a request has a Content-Type header set to the -//specified value -func VerifyContentType(contentType string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - Expect(req.Header.Get("Content-Type")).Should(Equal(contentType)) - } -} - -//VerifyMimeType returns a handler that verifies that a request has a specified mime type set -//in Content-Type header -func VerifyMimeType(mimeType string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - Expect(strings.Split(req.Header.Get("Content-Type"), ";")[0]).Should(Equal(mimeType)) - } -} - -//VerifyBasicAuth returns a handler that verifies the request contains a BasicAuth Authorization header -//matching the passed in username and password -func VerifyBasicAuth(username string, password string) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - auth := req.Header.Get("Authorization") - Expect(auth).ShouldNot(Equal(""), "Authorization header must be specified") - - decoded, err := base64.StdEncoding.DecodeString(auth[6:]) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(string(decoded)).Should(Equal(fmt.Sprintf("%s:%s", username, password)), "Authorization mismatch") - } -} - -//VerifyHeader returns a handler that verifies the request contains the passed in headers. -//The passed in header keys are first canonicalized via http.CanonicalHeaderKey. -// -//The request must contain *all* the passed in headers, but it is allowed to have additional headers -//beyond the passed in set. -func VerifyHeader(header http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - for key, values := range header { - key = http.CanonicalHeaderKey(key) - Expect(req.Header[key]).Should(Equal(values), "Header mismatch for key: %s", key) - } - } -} - -//VerifyHeaderKV returns a handler that verifies the request contains a header matching the passed in key and values -//(recall that a `http.Header` is a mapping from string (key) to []string (values)) -//It is a convenience wrapper around `VerifyHeader` that allows you to avoid having to create an `http.Header` object. -func VerifyHeaderKV(key string, values ...string) http.HandlerFunc { - return VerifyHeader(http.Header{key: values}) -} - -//VerifyBody returns a handler that verifies that the body of the request matches the passed in byte array. -//It does this using Equal(). -func VerifyBody(expectedBody []byte) http.HandlerFunc { - return CombineHandlers( - func(w http.ResponseWriter, req *http.Request) { - body, err := ioutil.ReadAll(req.Body) - req.Body.Close() - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(Equal(expectedBody), "Body Mismatch") - }, - ) -} - -//VerifyJSON returns a handler that verifies that the body of the request is a valid JSON representation -//matching the passed in JSON string. It does this using Gomega's MatchJSON method -// -//VerifyJSON also verifies that the request's content type is application/json -func VerifyJSON(expectedJSON string) http.HandlerFunc { - return CombineHandlers( - VerifyMimeType("application/json"), - func(w http.ResponseWriter, req *http.Request) { - body, err := ioutil.ReadAll(req.Body) - req.Body.Close() - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(MatchJSON(expectedJSON), "JSON Mismatch") - }, - ) -} - -//VerifyJSONRepresenting is similar to VerifyJSON. Instead of taking a JSON string, however, it -//takes an arbitrary JSON-encodable object and verifies that the requests's body is a JSON representation -//that matches the object -func VerifyJSONRepresenting(object interface{}) http.HandlerFunc { - data, err := json.Marshal(object) - Expect(err).ShouldNot(HaveOccurred()) - return CombineHandlers( - VerifyContentType("application/json"), - VerifyJSON(string(data)), - ) -} - -//VerifyForm returns a handler that verifies a request contains the specified form values. -// -//The request must contain *all* of the specified values, but it is allowed to have additional -//form values beyond the passed in set. -func VerifyForm(values url.Values) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - Expect(err).ShouldNot(HaveOccurred()) - for key, vals := range values { - Expect(r.Form[key]).Should(Equal(vals), "Form mismatch for key: %s", key) - } - } -} - -//VerifyFormKV returns a handler that verifies a request contains a form key with the specified values. -// -//It is a convenience wrapper around `VerifyForm` that lets you avoid having to create a `url.Values` object. -func VerifyFormKV(key string, values ...string) http.HandlerFunc { - return VerifyForm(url.Values{key: values}) -} - -//VerifyProtoRepresenting returns a handler that verifies that the body of the request is a valid protobuf -//representation of the passed message. -// -//VerifyProtoRepresenting also verifies that the request's content type is application/x-protobuf -func VerifyProtoRepresenting(expected proto.Message) http.HandlerFunc { - return CombineHandlers( - VerifyContentType("application/x-protobuf"), - func(w http.ResponseWriter, req *http.Request) { - body, err := ioutil.ReadAll(req.Body) - Expect(err).ShouldNot(HaveOccurred()) - req.Body.Close() - - expectedType := reflect.TypeOf(expected) - actualValuePtr := reflect.New(expectedType.Elem()) - - actual, ok := actualValuePtr.Interface().(proto.Message) - Expect(ok).Should(BeTrue(), "Message value is not a proto.Message") - - err = proto.Unmarshal(body, actual) - Expect(err).ShouldNot(HaveOccurred(), "Failed to unmarshal protobuf") - - Expect(actual).Should(Equal(expected), "ProtoBuf Mismatch") - }, - ) -} - -func copyHeader(src http.Header, dst http.Header) { - for key, value := range src { - dst[key] = value - } -} - -/* -RespondWith returns a handler that responds to a request with the specified status code and body - -Body may be a string or []byte - -Also, RespondWith can be given an optional http.Header. The headers defined therein will be added to the response headers. -*/ -func RespondWith(statusCode int, body interface{}, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - if len(optionalHeader) == 1 { - copyHeader(optionalHeader[0], w.Header()) - } - w.WriteHeader(statusCode) - switch x := body.(type) { - case string: - w.Write([]byte(x)) - case []byte: - w.Write(x) - default: - Expect(body).Should(BeNil(), "Invalid type for body. Should be string or []byte.") - } - } -} - -/* -RespondWithPtr returns a handler that responds to a request with the specified status code and body - -Unlike RespondWith, you pass RepondWithPtr a pointer to the status code and body allowing different tests -to share the same setup but specify different status codes and bodies. - -Also, RespondWithPtr can be given an optional http.Header. The headers defined therein will be added to the response headers. -Since the http.Header can be mutated after the fact you don't need to pass in a pointer. -*/ -func RespondWithPtr(statusCode *int, body interface{}, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - if len(optionalHeader) == 1 { - copyHeader(optionalHeader[0], w.Header()) - } - w.WriteHeader(*statusCode) - if body != nil { - switch x := (body).(type) { - case *string: - w.Write([]byte(*x)) - case *[]byte: - w.Write(*x) - default: - Expect(body).Should(BeNil(), "Invalid type for body. Should be string or []byte.") - } - } - } -} - -/* -RespondWithJSONEncoded returns a handler that responds to a request with the specified status code and a body -containing the JSON-encoding of the passed in object - -Also, RespondWithJSONEncoded can be given an optional http.Header. The headers defined therein will be added to the response headers. -*/ -func RespondWithJSONEncoded(statusCode int, object interface{}, optionalHeader ...http.Header) http.HandlerFunc { - data, err := json.Marshal(object) - Expect(err).ShouldNot(HaveOccurred()) - - var headers http.Header - if len(optionalHeader) == 1 { - headers = optionalHeader[0] - } else { - headers = make(http.Header) - } - if _, found := headers["Content-Type"]; !found { - headers["Content-Type"] = []string{"application/json"} - } - return RespondWith(statusCode, string(data), headers) -} - -/* -RespondWithJSONEncodedPtr behaves like RespondWithJSONEncoded but takes a pointer -to a status code and object. - -This allows different tests to share the same setup but specify different status codes and JSON-encoded -objects. - -Also, RespondWithJSONEncodedPtr can be given an optional http.Header. The headers defined therein will be added to the response headers. -Since the http.Header can be mutated after the fact you don't need to pass in a pointer. -*/ -func RespondWithJSONEncodedPtr(statusCode *int, object interface{}, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - data, err := json.Marshal(object) - Expect(err).ShouldNot(HaveOccurred()) - var headers http.Header - if len(optionalHeader) == 1 { - headers = optionalHeader[0] - } else { - headers = make(http.Header) - } - if _, found := headers["Content-Type"]; !found { - headers["Content-Type"] = []string{"application/json"} - } - copyHeader(headers, w.Header()) - w.WriteHeader(*statusCode) - w.Write(data) - } -} - -//RespondWithProto returns a handler that responds to a request with the specified status code and a body -//containing the protobuf serialization of the provided message. -// -//Also, RespondWithProto can be given an optional http.Header. The headers defined therein will be added to the response headers. -func RespondWithProto(statusCode int, message proto.Message, optionalHeader ...http.Header) http.HandlerFunc { - return func(w http.ResponseWriter, req *http.Request) { - data, err := proto.Marshal(message) - Expect(err).ShouldNot(HaveOccurred()) - - var headers http.Header - if len(optionalHeader) == 1 { - headers = optionalHeader[0] - } else { - headers = make(http.Header) - } - if _, found := headers["Content-Type"]; !found { - headers["Content-Type"] = []string{"application/x-protobuf"} - } - copyHeader(headers, w.Header()) - - w.WriteHeader(statusCode) - w.Write(data) - } -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go deleted file mode 100644 index b2972bc..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go +++ /dev/null @@ -1,3 +0,0 @@ -package protobuf - -//go:generate protoc --go_out=. simple_message.proto diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go deleted file mode 100644 index c55a484..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.pb.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by protoc-gen-go. -// source: simple_message.proto -// DO NOT EDIT! - -/* -Package protobuf is a generated protocol buffer package. - -It is generated from these files: - simple_message.proto - -It has these top-level messages: - SimpleMessage -*/ -package protobuf - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type SimpleMessage struct { - Description *string `protobuf:"bytes,1,req,name=description" json:"description,omitempty"` - Id *int32 `protobuf:"varint,2,req,name=id" json:"id,omitempty"` - Metadata *string `protobuf:"bytes,3,opt,name=metadata" json:"metadata,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *SimpleMessage) Reset() { *m = SimpleMessage{} } -func (m *SimpleMessage) String() string { return proto.CompactTextString(m) } -func (*SimpleMessage) ProtoMessage() {} - -func (m *SimpleMessage) GetDescription() string { - if m != nil && m.Description != nil { - return *m.Description - } - return "" -} - -func (m *SimpleMessage) GetId() int32 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *SimpleMessage) GetMetadata() string { - if m != nil && m.Metadata != nil { - return *m.Metadata - } - return "" -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto deleted file mode 100644 index 35b7145..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto2"; - -package protobuf; - -message SimpleMessage { - required string description = 1; - required int32 id = 2; - optional string metadata = 3; -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server.go b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server.go deleted file mode 100644 index 6524eb4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server.go +++ /dev/null @@ -1,425 +0,0 @@ -/* -Package ghttp supports testing HTTP clients by providing a test server (simply a thin wrapper around httptest's server) that supports -registering multiple handlers. Incoming requests are not routed between the different handlers -- rather it is merely the order of the handlers that matters. The first request is handled by the first -registered handler, the second request by the second handler, etc. - -The intent here is to have each handler *verify* that the incoming request is valid. To accomplish, ghttp -also provides a collection of bite-size handlers that each perform one aspect of request verification. These can -be composed together and registered with a ghttp server. The result is an expressive language for describing -the requests generated by the client under test. - -Here's a simple example, note that the server handler is only defined in one BeforeEach and then modified, as required, by the nested BeforeEaches. -A more comprehensive example is available at https://onsi.github.io/gomega/#_testing_http_clients - - var _ = Describe("A Sprockets Client", func() { - var server *ghttp.Server - var client *SprocketClient - BeforeEach(func() { - server = ghttp.NewServer() - client = NewSprocketClient(server.URL(), "skywalker", "tk427") - }) - - AfterEach(func() { - server.Close() - }) - - Describe("fetching sprockets", func() { - var statusCode int - var sprockets []Sprocket - BeforeEach(func() { - statusCode = http.StatusOK - sprockets = []Sprocket{} - server.AppendHandlers(ghttp.CombineHandlers( - ghttp.VerifyRequest("GET", "/sprockets"), - ghttp.VerifyBasicAuth("skywalker", "tk427"), - ghttp.RespondWithJSONEncodedPtr(&statusCode, &sprockets), - )) - }) - - Context("when requesting all sprockets", func() { - Context("when the response is succesful", func() { - BeforeEach(func() { - sprockets = []Sprocket{ - NewSprocket("Alfalfa"), - NewSprocket("Banana"), - } - }) - - It("should return the returned sprockets", func() { - Expect(client.Sprockets()).Should(Equal(sprockets)) - }) - }) - - Context("when the response is missing", func() { - BeforeEach(func() { - statusCode = http.StatusNotFound - }) - - It("should return an empty list of sprockets", func() { - Expect(client.Sprockets()).Should(BeEmpty()) - }) - }) - - Context("when the response fails to authenticate", func() { - BeforeEach(func() { - statusCode = http.StatusUnauthorized - }) - - It("should return an AuthenticationError error", func() { - sprockets, err := client.Sprockets() - Expect(sprockets).Should(BeEmpty()) - Expect(err).Should(MatchError(AuthenticationError)) - }) - }) - - Context("when the response is a server failure", func() { - BeforeEach(func() { - statusCode = http.StatusInternalServerError - }) - - It("should return an InternalError error", func() { - sprockets, err := client.Sprockets() - Expect(sprockets).Should(BeEmpty()) - Expect(err).Should(MatchError(InternalError)) - }) - }) - }) - - Context("when requesting some sprockets", func() { - BeforeEach(func() { - sprockets = []Sprocket{ - NewSprocket("Alfalfa"), - NewSprocket("Banana"), - } - - server.WrapHandler(0, ghttp.VerifyRequest("GET", "/sprockets", "filter=FOOD")) - }) - - It("should make the request with a filter", func() { - Expect(client.Sprockets("food")).Should(Equal(sprockets)) - }) - }) - }) - }) -*/ - -// untested sections: 5 - -package ghttp - -import ( - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "net/http/httputil" - "reflect" - "regexp" - "strings" - "sync" - - . "github.com/onsi/gomega" -) - -func new() *Server { - return &Server{ - AllowUnhandledRequests: false, - UnhandledRequestStatusCode: http.StatusInternalServerError, - rwMutex: &sync.RWMutex{}, - } -} - -type routedHandler struct { - method string - pathRegexp *regexp.Regexp - path string - handler http.HandlerFunc -} - -// NewServer returns a new `*ghttp.Server` that wraps an `httptest` server. The server is started automatically. -func NewServer() *Server { - s := new() - s.HTTPTestServer = httptest.NewServer(s) - return s -} - -// NewUnstartedServer return a new, unstarted, `*ghttp.Server`. Useful for specifying a custom listener on `server.HTTPTestServer`. -func NewUnstartedServer() *Server { - s := new() - s.HTTPTestServer = httptest.NewUnstartedServer(s) - return s -} - -// NewTLSServer returns a new `*ghttp.Server` that wraps an `httptest` TLS server. The server is started automatically. -func NewTLSServer() *Server { - s := new() - s.HTTPTestServer = httptest.NewTLSServer(s) - return s -} - -type Server struct { - //The underlying httptest server - HTTPTestServer *httptest.Server - - //Defaults to false. If set to true, the Server will allow more requests than there are registered handlers. - //Direct use of this property is deprecated and is likely to be removed, use GetAllowUnhandledRequests and SetAllowUnhandledRequests instead. - AllowUnhandledRequests bool - - //The status code returned when receiving an unhandled request. - //Defaults to http.StatusInternalServerError. - //Only applies if AllowUnhandledRequests is true - //Direct use of this property is deprecated and is likely to be removed, use GetUnhandledRequestStatusCode and SetUnhandledRequestStatusCode instead. - UnhandledRequestStatusCode int - - //If provided, ghttp will log about each request received to the provided io.Writer - //Defaults to nil - //If you're using Ginkgo, set this to GinkgoWriter to get improved output during failures - Writer io.Writer - - receivedRequests []*http.Request - requestHandlers []http.HandlerFunc - routedHandlers []routedHandler - - rwMutex *sync.RWMutex - calls int -} - -//Start() starts an unstarted ghttp server. It is a catastrophic error to call Start more than once (thanks, httptest). -func (s *Server) Start() { - s.HTTPTestServer.Start() -} - -//URL() returns a url that will hit the server -func (s *Server) URL() string { - s.rwMutex.RLock() - defer s.rwMutex.RUnlock() - return s.HTTPTestServer.URL -} - -//Addr() returns the address on which the server is listening. -func (s *Server) Addr() string { - s.rwMutex.RLock() - defer s.rwMutex.RUnlock() - return s.HTTPTestServer.Listener.Addr().String() -} - -//Close() should be called at the end of each test. It spins down and cleans up the test server. -func (s *Server) Close() { - s.rwMutex.Lock() - server := s.HTTPTestServer - s.HTTPTestServer = nil - s.rwMutex.Unlock() - - if server != nil { - server.Close() - } -} - -//ServeHTTP() makes Server an http.Handler -//When the server receives a request it handles the request in the following order: -// -//1. If the request matches a handler registered with RouteToHandler, that handler is called. -//2. Otherwise, if there are handlers registered via AppendHandlers, those handlers are called in order. -//3. If all registered handlers have been called then: -// a) If AllowUnhandledRequests is set to true, the request will be handled with response code of UnhandledRequestStatusCode -// b) If AllowUnhandledRequests is false, the request will not be handled and the current test will be marked as failed. -func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { - s.rwMutex.Lock() - defer func() { - e := recover() - if e != nil { - w.WriteHeader(http.StatusInternalServerError) - } - - //If the handler panics GHTTP will silently succeed. This is bad™. - //To catch this case we need to fail the test if the handler has panicked. - //However, if the handler is panicking because Ginkgo's causing it to panic (i.e. an assertion failed) - //then we shouldn't double-report the error as this will confuse people. - - //So: step 1, if this is a Ginkgo panic - do nothing, Ginkgo's aware of the failure - eAsString, ok := e.(string) - if ok && strings.Contains(eAsString, "defer GinkgoRecover()") { - return - } - - //If we're here, we have to do step 2: assert that the error is nil. This assertion will - //allow us to fail the test suite (note: we can't call Fail since Gomega is not allowed to import Ginkgo). - //Since a failed assertion throws a panic, and we are likely in a goroutine, we need to defer within our defer! - defer func() { - recover() - }() - Expect(e).Should(BeNil(), "Handler Panicked") - }() - - if s.Writer != nil { - s.Writer.Write([]byte(fmt.Sprintf("GHTTP Received Request: %s - %s\n", req.Method, req.URL))) - } - - s.receivedRequests = append(s.receivedRequests, req) - if routedHandler, ok := s.handlerForRoute(req.Method, req.URL.Path); ok { - s.rwMutex.Unlock() - routedHandler(w, req) - } else if s.calls < len(s.requestHandlers) { - h := s.requestHandlers[s.calls] - s.calls++ - s.rwMutex.Unlock() - h(w, req) - } else { - s.rwMutex.Unlock() - if s.GetAllowUnhandledRequests() { - ioutil.ReadAll(req.Body) - req.Body.Close() - w.WriteHeader(s.GetUnhandledRequestStatusCode()) - } else { - formatted, err := httputil.DumpRequest(req, true) - Expect(err).NotTo(HaveOccurred(), "Encountered error while dumping HTTP request") - Expect(string(formatted)).Should(BeNil(), "Received Unhandled Request") - } - } -} - -//ReceivedRequests is an array containing all requests received by the server (both handled and unhandled requests) -func (s *Server) ReceivedRequests() []*http.Request { - s.rwMutex.RLock() - defer s.rwMutex.RUnlock() - - return s.receivedRequests -} - -//RouteToHandler can be used to register handlers that will always handle requests that match -//the passed in method and path. -// -//The path may be either a string object or a *regexp.Regexp. -func (s *Server) RouteToHandler(method string, path interface{}, handler http.HandlerFunc) { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - rh := routedHandler{ - method: method, - handler: handler, - } - - switch p := path.(type) { - case *regexp.Regexp: - rh.pathRegexp = p - case string: - rh.path = p - default: - panic("path must be a string or a regular expression") - } - - for i, existingRH := range s.routedHandlers { - if existingRH.method == method && - reflect.DeepEqual(existingRH.pathRegexp, rh.pathRegexp) && - existingRH.path == rh.path { - s.routedHandlers[i] = rh - return - } - } - s.routedHandlers = append(s.routedHandlers, rh) -} - -func (s *Server) handlerForRoute(method string, path string) (http.HandlerFunc, bool) { - for _, rh := range s.routedHandlers { - if rh.method == method { - if rh.pathRegexp != nil { - if rh.pathRegexp.Match([]byte(path)) { - return rh.handler, true - } - } else if rh.path == path { - return rh.handler, true - } - } - } - - return nil, false -} - -//AppendHandlers will appends http.HandlerFuncs to the server's list of registered handlers. The first incoming request is handled by the first handler, the second by the second, etc... -func (s *Server) AppendHandlers(handlers ...http.HandlerFunc) { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - s.requestHandlers = append(s.requestHandlers, handlers...) -} - -//SetHandler overrides the registered handler at the passed in index with the passed in handler -//This is useful, for example, when a server has been set up in a shared context, but must be tweaked -//for a particular test. -func (s *Server) SetHandler(index int, handler http.HandlerFunc) { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - s.requestHandlers[index] = handler -} - -//GetHandler returns the handler registered at the passed in index. -func (s *Server) GetHandler(index int) http.HandlerFunc { - s.rwMutex.RLock() - defer s.rwMutex.RUnlock() - - return s.requestHandlers[index] -} - -func (s *Server) Reset() { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - s.HTTPTestServer.CloseClientConnections() - s.calls = 0 - s.receivedRequests = nil - s.requestHandlers = nil - s.routedHandlers = nil -} - -//WrapHandler combines the passed in handler with the handler registered at the passed in index. -//This is useful, for example, when a server has been set up in a shared context but must be tweaked -//for a particular test. -// -//If the currently registered handler is A, and the new passed in handler is B then -//WrapHandler will generate a new handler that first calls A, then calls B, and assign it to index -func (s *Server) WrapHandler(index int, handler http.HandlerFunc) { - existingHandler := s.GetHandler(index) - s.SetHandler(index, CombineHandlers(existingHandler, handler)) -} - -func (s *Server) CloseClientConnections() { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - s.HTTPTestServer.CloseClientConnections() -} - -//SetAllowUnhandledRequests enables the server to accept unhandled requests. -func (s *Server) SetAllowUnhandledRequests(allowUnhandledRequests bool) { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - s.AllowUnhandledRequests = allowUnhandledRequests -} - -//GetAllowUnhandledRequests returns true if the server accepts unhandled requests. -func (s *Server) GetAllowUnhandledRequests() bool { - s.rwMutex.RLock() - defer s.rwMutex.RUnlock() - - return s.AllowUnhandledRequests -} - -//SetUnhandledRequestStatusCode status code to be returned when the server receives unhandled requests -func (s *Server) SetUnhandledRequestStatusCode(statusCode int) { - s.rwMutex.Lock() - defer s.rwMutex.Unlock() - - s.UnhandledRequestStatusCode = statusCode -} - -//GetUnhandledRequestStatusCode returns the current status code being returned for unhandled requests -func (s *Server) GetUnhandledRequestStatusCode() int { - s.rwMutex.RLock() - defer s.rwMutex.RUnlock() - - return s.UnhandledRequestStatusCode -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_suite_test.go deleted file mode 100644 index 7c12360..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package ghttp_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestGHTTP(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "GHTTP Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_test.go deleted file mode 100644 index be1c58e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/ghttp/test_server_test.go +++ /dev/null @@ -1,1129 +0,0 @@ -package ghttp_test - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - "net/url" - "regexp" - - "github.com/golang/protobuf/proto" - "github.com/onsi/gomega/gbytes" - "github.com/onsi/gomega/ghttp/protobuf" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/ghttp" -) - -var _ = Describe("TestServer", func() { - var ( - resp *http.Response - err error - s *Server - ) - - BeforeEach(func() { - s = NewServer() - }) - - AfterEach(func() { - s.Close() - }) - - Describe("Resetting the server", func() { - BeforeEach(func() { - s.RouteToHandler("GET", "/", func(w http.ResponseWriter, req *http.Request) {}) - s.AppendHandlers(func(w http.ResponseWriter, req *http.Request) {}) - http.Get(s.URL() + "/") - - Expect(s.ReceivedRequests()).Should(HaveLen(1)) - }) - - It("clears all handlers and call counts", func() { - s.Reset() - Expect(s.ReceivedRequests()).Should(HaveLen(0)) - Expect(func() { s.GetHandler(0) }).Should(Panic()) - }) - }) - - Describe("closing client connections", func() { - It("closes", func() { - s.RouteToHandler("GET", "/", - func(w http.ResponseWriter, req *http.Request) { - io.WriteString(w, req.RemoteAddr) - }, - ) - client := http.Client{Transport: &http.Transport{DisableKeepAlives: true}} - resp, err := client.Get(s.URL()) - Expect(err).ShouldNot(HaveOccurred()) - Expect(resp.StatusCode).Should(Equal(200)) - - body, err := ioutil.ReadAll(resp.Body) - resp.Body.Close() - Expect(err).ShouldNot(HaveOccurred()) - - s.CloseClientConnections() - - resp, err = client.Get(s.URL()) - Expect(err).ShouldNot(HaveOccurred()) - Expect(resp.StatusCode).Should(Equal(200)) - - body2, err := ioutil.ReadAll(resp.Body) - resp.Body.Close() - Expect(err).ShouldNot(HaveOccurred()) - - Expect(body2).ShouldNot(Equal(body)) - }) - }) - - Describe("closing server mulitple times", func() { - It("should not fail", func() { - s.Close() - Expect(s.Close).ShouldNot(Panic()) - }) - }) - - Describe("allowing unhandled requests", func() { - It("is not permitted by default", func() { - Expect(s.GetAllowUnhandledRequests()).To(BeFalse()) - }) - - Context("when true", func() { - BeforeEach(func() { - s.SetAllowUnhandledRequests(true) - s.SetUnhandledRequestStatusCode(http.StatusForbidden) - resp, err = http.Get(s.URL() + "/foo") - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should allow unhandled requests and respond with the passed in status code", func() { - Expect(err).ShouldNot(HaveOccurred()) - Expect(resp.StatusCode).Should(Equal(http.StatusForbidden)) - - data, err := ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(data).Should(BeEmpty()) - }) - - It("should record the requests", func() { - Expect(s.ReceivedRequests()).Should(HaveLen(1)) - Expect(s.ReceivedRequests()[0].URL.Path).Should(Equal("/foo")) - }) - }) - - Context("when false", func() { - It("should fail when attempting a request", func() { - failures := InterceptGomegaFailures(func() { - http.Get(s.URL() + "/foo") - }) - - Expect(failures[0]).Should(ContainSubstring("Received Unhandled Request")) - }) - }) - }) - - Describe("Managing Handlers", func() { - var called []string - BeforeEach(func() { - called = []string{} - s.RouteToHandler("GET", "/routed", func(w http.ResponseWriter, req *http.Request) { - called = append(called, "r1") - }) - s.RouteToHandler("POST", regexp.MustCompile(`/routed\d`), func(w http.ResponseWriter, req *http.Request) { - called = append(called, "r2") - }) - s.AppendHandlers(func(w http.ResponseWriter, req *http.Request) { - called = append(called, "A") - }, func(w http.ResponseWriter, req *http.Request) { - called = append(called, "B") - }) - }) - - It("should prefer routed handlers if there is a match", func() { - http.Get(s.URL() + "/routed") - http.Post(s.URL()+"/routed7", "application/json", nil) - http.Get(s.URL() + "/foo") - http.Get(s.URL() + "/routed") - http.Post(s.URL()+"/routed9", "application/json", nil) - http.Get(s.URL() + "/bar") - - failures := InterceptGomegaFailures(func() { - http.Get(s.URL() + "/foo") - http.Get(s.URL() + "/routed/not/a/match") - http.Get(s.URL() + "/routed7") - http.Post(s.URL()+"/routed", "application/json", nil) - }) - - Expect(failures[0]).Should(ContainSubstring("Received Unhandled Request")) - Expect(failures).Should(HaveLen(4)) - - http.Post(s.URL()+"/routed3", "application/json", nil) - - Expect(called).Should(Equal([]string{"r1", "r2", "A", "r1", "r2", "B", "r2"})) - }) - - It("should override routed handlers when reregistered", func() { - s.RouteToHandler("GET", "/routed", func(w http.ResponseWriter, req *http.Request) { - called = append(called, "r3") - }) - s.RouteToHandler("POST", regexp.MustCompile(`/routed\d`), func(w http.ResponseWriter, req *http.Request) { - called = append(called, "r4") - }) - - http.Get(s.URL() + "/routed") - http.Post(s.URL()+"/routed7", "application/json", nil) - - Expect(called).Should(Equal([]string{"r3", "r4"})) - }) - - It("should call the appended handlers, in order, as requests come in", func() { - http.Get(s.URL() + "/foo") - Expect(called).Should(Equal([]string{"A"})) - - http.Get(s.URL() + "/foo") - Expect(called).Should(Equal([]string{"A", "B"})) - - failures := InterceptGomegaFailures(func() { - http.Get(s.URL() + "/foo") - }) - - Expect(failures[0]).Should(ContainSubstring("Received Unhandled Request")) - }) - - Describe("Overwriting an existing handler", func() { - BeforeEach(func() { - s.SetHandler(0, func(w http.ResponseWriter, req *http.Request) { - called = append(called, "C") - }) - }) - - It("should override the specified handler", func() { - http.Get(s.URL() + "/foo") - http.Get(s.URL() + "/foo") - Expect(called).Should(Equal([]string{"C", "B"})) - }) - }) - - Describe("Getting an existing handler", func() { - It("should return the handler func", func() { - s.GetHandler(1)(nil, nil) - Expect(called).Should(Equal([]string{"B"})) - }) - }) - - Describe("Wrapping an existing handler", func() { - BeforeEach(func() { - s.WrapHandler(0, func(w http.ResponseWriter, req *http.Request) { - called = append(called, "C") - }) - }) - - It("should wrap the existing handler in a new handler", func() { - http.Get(s.URL() + "/foo") - http.Get(s.URL() + "/foo") - Expect(called).Should(Equal([]string{"A", "C", "B"})) - }) - }) - }) - - Describe("When a handler fails", func() { - BeforeEach(func() { - s.SetUnhandledRequestStatusCode(http.StatusForbidden) //just to be clear that 500s aren't coming from unhandled requests - }) - - Context("because the handler has panicked", func() { - BeforeEach(func() { - s.AppendHandlers(func(w http.ResponseWriter, req *http.Request) { - panic("bam") - }) - }) - - It("should respond with a 500 and make a failing assertion", func() { - var resp *http.Response - var err error - - failures := InterceptGomegaFailures(func() { - resp, err = http.Get(s.URL()) - }) - - Expect(err).ShouldNot(HaveOccurred()) - Expect(resp.StatusCode).Should(Equal(http.StatusInternalServerError)) - Expect(failures).Should(ConsistOf(ContainSubstring("Handler Panicked"))) - }) - }) - - Context("because an assertion has failed", func() { - BeforeEach(func() { - s.AppendHandlers(func(w http.ResponseWriter, req *http.Request) { - // Expect(true).Should(BeFalse()) <-- would be nice to do it this way, but the test just can't be written this way - - By("We're cheating a bit here -- we're throwing a GINKGO_PANIC which simulates a failed assertion") - panic(GINKGO_PANIC) - }) - }) - - It("should respond with a 500 and *not* make a failing assertion, instead relying on Ginkgo to have already been notified of the error", func() { - resp, err := http.Get(s.URL()) - - Expect(err).ShouldNot(HaveOccurred()) - Expect(resp.StatusCode).Should(Equal(http.StatusInternalServerError)) - }) - }) - }) - - Describe("Logging to the Writer", func() { - var buf *gbytes.Buffer - BeforeEach(func() { - buf = gbytes.NewBuffer() - s.Writer = buf - s.AppendHandlers(func(w http.ResponseWriter, req *http.Request) {}) - s.AppendHandlers(func(w http.ResponseWriter, req *http.Request) {}) - }) - - It("should write to the buffer when a request comes in", func() { - http.Get(s.URL() + "/foo") - Expect(buf).Should(gbytes.Say("GHTTP Received Request: GET - /foo\n")) - - http.Post(s.URL()+"/bar", "", nil) - Expect(buf).Should(gbytes.Say("GHTTP Received Request: POST - /bar\n")) - }) - }) - - Describe("Request Handlers", func() { - Describe("VerifyRequest", func() { - BeforeEach(func() { - s.AppendHandlers(VerifyRequest("GET", "/foo")) - }) - - It("should verify the method, path", func() { - resp, err = http.Get(s.URL() + "/foo?baz=bar") - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the method, path", func() { - failures := InterceptGomegaFailures(func() { - http.Get(s.URL() + "/foo2") - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("should verify the method, path", func() { - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/foo", "application/json", nil) - }) - Expect(failures).Should(HaveLen(1)) - }) - - Context("when passed a rawQuery", func() { - It("should also be possible to verify the rawQuery", func() { - s.SetHandler(0, VerifyRequest("GET", "/foo", "baz=bar")) - resp, err = http.Get(s.URL() + "/foo?baz=bar") - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should match irregardless of query parameter ordering", func() { - s.SetHandler(0, VerifyRequest("GET", "/foo", "type=get&name=money")) - u, _ := url.Parse(s.URL() + "/foo") - u.RawQuery = url.Values{ - "type": []string{"get"}, - "name": []string{"money"}, - }.Encode() - - resp, err = http.Get(u.String()) - Expect(err).ShouldNot(HaveOccurred()) - }) - }) - - Context("when passed a matcher for path", func() { - It("should apply the matcher", func() { - s.SetHandler(0, VerifyRequest("GET", MatchRegexp(`/foo/[a-f]*/3`))) - resp, err = http.Get(s.URL() + "/foo/abcdefa/3") - Expect(err).ShouldNot(HaveOccurred()) - }) - }) - }) - - Describe("VerifyContentType", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("GET", "/foo"), - VerifyContentType("application/octet-stream"), - )) - }) - - It("should verify the content type", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Set("Content-Type", "application/octet-stream") - - resp, err = http.DefaultClient.Do(req) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the content type", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Set("Content-Type", "application/json") - - failures := InterceptGomegaFailures(func() { - http.DefaultClient.Do(req) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("should verify the content type", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Set("Content-Type", "application/octet-stream; charset=utf-8") - - failures := InterceptGomegaFailures(func() { - http.DefaultClient.Do(req) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("Verify BasicAuth", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("GET", "/foo"), - VerifyBasicAuth("bob", "password"), - )) - }) - - It("should verify basic auth", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.SetBasicAuth("bob", "password") - - resp, err = http.DefaultClient.Do(req) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify basic auth", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.SetBasicAuth("bob", "bassword") - - failures := InterceptGomegaFailures(func() { - http.DefaultClient.Do(req) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("should require basic auth header", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - - failures := InterceptGomegaFailures(func() { - http.DefaultClient.Do(req) - }) - Expect(failures).Should(ContainElement(ContainSubstring("Authorization header must be specified"))) - }) - }) - - Describe("VerifyHeader", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("GET", "/foo"), - VerifyHeader(http.Header{ - "accept": []string{"jpeg", "png"}, - "cache-control": []string{"omicron"}, - "Return-Path": []string{"hobbiton"}, - }), - )) - }) - - It("should verify the headers", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Add("Accept", "jpeg") - req.Header.Add("Accept", "png") - req.Header.Add("Cache-Control", "omicron") - req.Header.Add("return-path", "hobbiton") - - resp, err = http.DefaultClient.Do(req) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the headers", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Add("Schmaccept", "jpeg") - req.Header.Add("Schmaccept", "png") - req.Header.Add("Cache-Control", "omicron") - req.Header.Add("return-path", "hobbiton") - - failures := InterceptGomegaFailures(func() { - http.DefaultClient.Do(req) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("VerifyHeaderKV", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("GET", "/foo"), - VerifyHeaderKV("accept", "jpeg", "png"), - VerifyHeaderKV("cache-control", "omicron"), - VerifyHeaderKV("Return-Path", "hobbiton"), - )) - }) - - It("should verify the headers", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Add("Accept", "jpeg") - req.Header.Add("Accept", "png") - req.Header.Add("Cache-Control", "omicron") - req.Header.Add("return-path", "hobbiton") - - resp, err = http.DefaultClient.Do(req) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the headers", func() { - req, err := http.NewRequest("GET", s.URL()+"/foo", nil) - Expect(err).ShouldNot(HaveOccurred()) - req.Header.Add("Accept", "jpeg") - req.Header.Add("Cache-Control", "omicron") - req.Header.Add("return-path", "hobbiton") - - failures := InterceptGomegaFailures(func() { - http.DefaultClient.Do(req) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("VerifyBody", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - VerifyBody([]byte("some body")), - )) - }) - - It("should verify the body", func() { - resp, err = http.Post(s.URL()+"/foo", "", bytes.NewReader([]byte("some body"))) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the body", func() { - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/foo", "", bytes.NewReader([]byte("wrong body"))) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("VerifyMimeType", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyMimeType("application/json"), - )) - }) - - It("should verify the mime type in content-type header", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json; charset=utf-8", bytes.NewReader([]byte(`{}`))) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the mime type in content-type header", func() { - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/foo", "text/plain", bytes.NewReader([]byte(`{}`))) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("VerifyJSON", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - VerifyJSON(`{"a":3, "b":2}`), - )) - }) - - It("should verify the json body and the content type", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", bytes.NewReader([]byte(`{"b":2, "a":3}`))) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the json body and the content type", func() { - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/foo", "application/json", bytes.NewReader([]byte(`{"b":2, "a":4}`))) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("should verify the json body and the content type", func() { - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/foo", "application/not-json", bytes.NewReader([]byte(`{"b":2, "a":3}`))) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("should verify the json body and the content type", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json; charset=utf-8", bytes.NewReader([]byte(`{"b":2, "a":3}`))) - Expect(err).ShouldNot(HaveOccurred()) - }) - }) - - Describe("VerifyJSONRepresenting", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - VerifyJSONRepresenting([]int{1, 3, 5}), - )) - }) - - It("should verify the json body and the content type", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", bytes.NewReader([]byte(`[1,3,5]`))) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the json body and the content type", func() { - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/foo", "application/json", bytes.NewReader([]byte(`[1,3]`))) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("VerifyForm", func() { - var formValues url.Values - - BeforeEach(func() { - formValues = make(url.Values) - formValues.Add("users", "user1") - formValues.Add("users", "user2") - formValues.Add("group", "users") - }) - - Context("when encoded in the URL", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("GET", "/foo"), - VerifyForm(url.Values{ - "users": []string{"user1", "user2"}, - "group": []string{"users"}, - }), - )) - }) - - It("should verify form values", func() { - resp, err = http.Get(s.URL() + "/foo?" + formValues.Encode()) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should ignore extra values", func() { - formValues.Add("extra", "value") - resp, err = http.Get(s.URL() + "/foo?" + formValues.Encode()) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("fail on missing values", func() { - formValues.Del("group") - failures := InterceptGomegaFailures(func() { - resp, err = http.Get(s.URL() + "/foo?" + formValues.Encode()) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("fail on incorrect values", func() { - formValues.Set("group", "wheel") - failures := InterceptGomegaFailures(func() { - resp, err = http.Get(s.URL() + "/foo?" + formValues.Encode()) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Context("when present in the body", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - VerifyForm(url.Values{ - "users": []string{"user1", "user2"}, - "group": []string{"users"}, - }), - )) - }) - - It("should verify form values", func() { - resp, err = http.PostForm(s.URL()+"/foo", formValues) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should ignore extra values", func() { - formValues.Add("extra", "value") - resp, err = http.PostForm(s.URL()+"/foo", formValues) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("fail on missing values", func() { - formValues.Del("group") - failures := InterceptGomegaFailures(func() { - resp, err = http.PostForm(s.URL()+"/foo", formValues) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("fail on incorrect values", func() { - formValues.Set("group", "wheel") - failures := InterceptGomegaFailures(func() { - resp, err = http.PostForm(s.URL()+"/foo", formValues) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - }) - - Describe("VerifyFormKV", func() { - Context("when encoded in the URL", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("GET", "/foo"), - VerifyFormKV("users", "user1", "user2"), - )) - }) - - It("verifies the form value", func() { - resp, err = http.Get(s.URL() + "/foo?users=user1&users=user2") - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("verifies the form value", func() { - failures := InterceptGomegaFailures(func() { - resp, err = http.Get(s.URL() + "/foo?users=user1") - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Context("when present in the body", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - VerifyFormKV("users", "user1", "user2"), - )) - }) - - It("verifies the form value", func() { - resp, err = http.PostForm(s.URL()+"/foo", url.Values{"users": []string{"user1", "user2"}}) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("verifies the form value", func() { - failures := InterceptGomegaFailures(func() { - resp, err = http.PostForm(s.URL()+"/foo", url.Values{"users": []string{"user1"}}) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - }) - - Describe("VerifyProtoRepresenting", func() { - var message *protobuf.SimpleMessage - - BeforeEach(func() { - message = new(protobuf.SimpleMessage) - message.Description = proto.String("A description") - message.Id = proto.Int32(0) - - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/proto"), - VerifyProtoRepresenting(message), - )) - }) - - It("verifies the proto body and the content type", func() { - serialized, err := proto.Marshal(message) - Expect(err).ShouldNot(HaveOccurred()) - - resp, err = http.Post(s.URL()+"/proto", "application/x-protobuf", bytes.NewReader(serialized)) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should verify the proto body and the content type", func() { - serialized, err := proto.Marshal(&protobuf.SimpleMessage{ - Description: proto.String("A description"), - Id: proto.Int32(0), - Metadata: proto.String("some metadata"), - }) - Expect(err).ShouldNot(HaveOccurred()) - - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/proto", "application/x-protobuf", bytes.NewReader(serialized)) - }) - Expect(failures).Should(HaveLen(1)) - }) - - It("should verify the proto body and the content type", func() { - serialized, err := proto.Marshal(message) - Expect(err).ShouldNot(HaveOccurred()) - - failures := InterceptGomegaFailures(func() { - http.Post(s.URL()+"/proto", "application/not-x-protobuf", bytes.NewReader(serialized)) - }) - Expect(failures).Should(HaveLen(1)) - }) - }) - - Describe("RespondWith", func() { - Context("without headers", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWith(http.StatusCreated, "sweet"), - ), CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWith(http.StatusOK, []byte("sour")), - )) - }) - - It("should return the response", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - - body, err := ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(Equal([]byte("sweet"))) - - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusOK)) - - body, err = ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(Equal([]byte("sour"))) - }) - }) - - Context("with headers", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWith(http.StatusCreated, "sweet", http.Header{"X-Custom-Header": []string{"my header"}}), - )) - }) - - It("should return the headers too", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - Expect(ioutil.ReadAll(resp.Body)).Should(Equal([]byte("sweet"))) - Expect(resp.Header.Get("X-Custom-Header")).Should(Equal("my header")) - }) - }) - }) - - Describe("RespondWithPtr", func() { - var code int - var byteBody []byte - var stringBody string - BeforeEach(func() { - code = http.StatusOK - byteBody = []byte("sweet") - stringBody = "sour" - - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithPtr(&code, &byteBody), - ), CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithPtr(&code, &stringBody), - )) - }) - - It("should return the response", func() { - code = http.StatusCreated - byteBody = []byte("tasty") - stringBody = "treat" - - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - - body, err := ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(Equal([]byte("tasty"))) - - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - - body, err = ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(Equal([]byte("treat"))) - }) - - Context("when passed a nil body", func() { - BeforeEach(func() { - s.SetHandler(0, CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithPtr(&code, nil), - )) - }) - - It("should return an empty body and not explode", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - - Expect(err).ShouldNot(HaveOccurred()) - Expect(resp.StatusCode).Should(Equal(http.StatusOK)) - body, err := ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(BeEmpty()) - - Expect(s.ReceivedRequests()).Should(HaveLen(1)) - }) - }) - }) - - Describe("RespondWithJSON", func() { - Context("when no optional headers are set", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithJSONEncoded(http.StatusCreated, []int{1, 2, 3}), - )) - }) - - It("should return the response", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - - body, err := ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(MatchJSON("[1,2,3]")) - }) - - It("should set the Content-Type header to application/json", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"application/json"})) - }) - }) - - Context("when optional headers are set", func() { - var headers http.Header - BeforeEach(func() { - headers = http.Header{"Stuff": []string{"things"}} - }) - - JustBeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithJSONEncoded(http.StatusCreated, []int{1, 2, 3}, headers), - )) - }) - - It("should preserve those headers", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Stuff"]).Should(Equal([]string{"things"})) - }) - - It("should set the Content-Type header to application/json", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"application/json"})) - }) - - Context("when setting the Content-Type explicitly", func() { - BeforeEach(func() { - headers["Content-Type"] = []string{"not-json"} - }) - - It("should use the Content-Type header that was explicitly set", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"not-json"})) - }) - }) - }) - }) - - Describe("RespondWithJSONPtr", func() { - type testObject struct { - Key string - Value string - } - - var code int - var object testObject - - Context("when no optional headers are set", func() { - BeforeEach(func() { - code = http.StatusOK - object = testObject{} - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithJSONEncodedPtr(&code, &object), - )) - }) - - It("should return the response", func() { - code = http.StatusCreated - object = testObject{ - Key: "Jim", - Value: "Codes", - } - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - - body, err := ioutil.ReadAll(resp.Body) - Expect(err).ShouldNot(HaveOccurred()) - Expect(body).Should(MatchJSON(`{"Key": "Jim", "Value": "Codes"}`)) - }) - - It("should set the Content-Type header to application/json", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"application/json"})) - }) - }) - - Context("when optional headers are set", func() { - var headers http.Header - BeforeEach(func() { - headers = http.Header{"Stuff": []string{"things"}} - }) - - JustBeforeEach(func() { - code = http.StatusOK - object = testObject{} - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/foo"), - RespondWithJSONEncodedPtr(&code, &object, headers), - )) - }) - - It("should preserve those headers", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Stuff"]).Should(Equal([]string{"things"})) - }) - - It("should set the Content-Type header to application/json", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"application/json"})) - }) - - Context("when setting the Content-Type explicitly", func() { - BeforeEach(func() { - headers["Content-Type"] = []string{"not-json"} - }) - - It("should use the Content-Type header that was explicitly set", func() { - resp, err = http.Post(s.URL()+"/foo", "application/json", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"not-json"})) - }) - }) - }) - }) - - Describe("RespondWithProto", func() { - var message *protobuf.SimpleMessage - - BeforeEach(func() { - message = new(protobuf.SimpleMessage) - message.Description = proto.String("A description") - message.Id = proto.Int32(99) - }) - - Context("when no optional headers are set", func() { - BeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/proto"), - RespondWithProto(http.StatusCreated, message), - )) - }) - - It("should return the response", func() { - resp, err = http.Post(s.URL()+"/proto", "application/x-protobuf", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.StatusCode).Should(Equal(http.StatusCreated)) - - var received protobuf.SimpleMessage - body, err := ioutil.ReadAll(resp.Body) - err = proto.Unmarshal(body, &received) - Expect(err).ShouldNot(HaveOccurred()) - }) - - It("should set the Content-Type header to application/x-protobuf", func() { - resp, err = http.Post(s.URL()+"/proto", "application/x-protobuf", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"application/x-protobuf"})) - }) - }) - - Context("when optional headers are set", func() { - var headers http.Header - BeforeEach(func() { - headers = http.Header{"Stuff": []string{"things"}} - }) - - JustBeforeEach(func() { - s.AppendHandlers(CombineHandlers( - VerifyRequest("POST", "/proto"), - RespondWithProto(http.StatusCreated, message, headers), - )) - }) - - It("should preserve those headers", func() { - resp, err = http.Post(s.URL()+"/proto", "application/x-protobuf", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Stuff"]).Should(Equal([]string{"things"})) - }) - - It("should set the Content-Type header to application/x-protobuf", func() { - resp, err = http.Post(s.URL()+"/proto", "application/x-protobuf", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"application/x-protobuf"})) - }) - - Context("when setting the Content-Type explicitly", func() { - BeforeEach(func() { - headers["Content-Type"] = []string{"not-x-protobuf"} - }) - - It("should use the Content-Type header that was explicitly set", func() { - resp, err = http.Post(s.URL()+"/proto", "application/x-protobuf", nil) - Expect(err).ShouldNot(HaveOccurred()) - - Expect(resp.Header["Content-Type"]).Should(Equal([]string{"not-x-protobuf"})) - }) - }) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements.go deleted file mode 100644 index 30e3369..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements.go +++ /dev/null @@ -1,161 +0,0 @@ -// untested sections: 6 - -package gstruct - -import ( - "errors" - "fmt" - "reflect" - "runtime/debug" - - "github.com/onsi/gomega/format" - errorsutil "github.com/onsi/gomega/gstruct/errors" - "github.com/onsi/gomega/types" -) - -//MatchAllElements succeeds if every element of a slice matches the element matcher it maps to -//through the id function, and every element matcher is matched. -// idFn := func(element interface{}) string { -// return fmt.Sprintf("%v", element) -// } -// -// Expect([]string{"a", "b"}).To(MatchAllElements(idFn, Elements{ -// "a": Equal("a"), -// "b": Equal("b"), -// })) -func MatchAllElements(identifier Identifier, elements Elements) types.GomegaMatcher { - return &ElementsMatcher{ - Identifier: identifier, - Elements: elements, - } -} - -//MatchElements succeeds if each element of a slice matches the element matcher it maps to -//through the id function. It can ignore extra elements and/or missing elements. -// idFn := func(element interface{}) string { -// return fmt.Sprintf("%v", element) -// } -// -// Expect([]string{"a", "b", "c"}).To(MatchElements(idFn, IgnoreExtras, Elements{ -// "a": Equal("a"), -// "b": Equal("b"), -// })) -// Expect([]string{"a", "c"}).To(MatchElements(idFn, IgnoreMissing, Elements{ -// "a": Equal("a"), -// "b": Equal("b"), -// "c": Equal("c"), -// "d": Equal("d"), -// })) -func MatchElements(identifier Identifier, options Options, elements Elements) types.GomegaMatcher { - return &ElementsMatcher{ - Identifier: identifier, - Elements: elements, - IgnoreExtras: options&IgnoreExtras != 0, - IgnoreMissing: options&IgnoreMissing != 0, - AllowDuplicates: options&AllowDuplicates != 0, - } -} - -// ElementsMatcher is a NestingMatcher that applies custom matchers to each element of a slice mapped -// by the Identifier function. -// TODO: Extend this to work with arrays & maps (map the key) as well. -type ElementsMatcher struct { - // Matchers for each element. - Elements Elements - // Function mapping an element to the string key identifying its matcher. - Identifier Identifier - - // Whether to ignore extra elements or consider it an error. - IgnoreExtras bool - // Whether to ignore missing elements or consider it an error. - IgnoreMissing bool - // Whether to key duplicates when matching IDs. - AllowDuplicates bool - - // State. - failures []error -} - -// Element ID to matcher. -type Elements map[string]types.GomegaMatcher - -// Function for identifying (mapping) elements. -type Identifier func(element interface{}) string - -func (m *ElementsMatcher) Match(actual interface{}) (success bool, err error) { - if reflect.TypeOf(actual).Kind() != reflect.Slice { - return false, fmt.Errorf("%v is type %T, expected slice", actual, actual) - } - - m.failures = m.matchElements(actual) - if len(m.failures) > 0 { - return false, nil - } - return true, nil -} - -func (m *ElementsMatcher) matchElements(actual interface{}) (errs []error) { - // Provide more useful error messages in the case of a panic. - defer func() { - if err := recover(); err != nil { - errs = append(errs, fmt.Errorf("panic checking %+v: %v\n%s", actual, err, debug.Stack())) - } - }() - - val := reflect.ValueOf(actual) - elements := map[string]bool{} - for i := 0; i < val.Len(); i++ { - element := val.Index(i).Interface() - id := m.Identifier(element) - if elements[id] { - if !m.AllowDuplicates { - errs = append(errs, fmt.Errorf("found duplicate element ID %s", id)) - continue - } - } - elements[id] = true - - matcher, expected := m.Elements[id] - if !expected { - if !m.IgnoreExtras { - errs = append(errs, fmt.Errorf("unexpected element %s", id)) - } - continue - } - - match, err := matcher.Match(element) - if match { - continue - } - - if err == nil { - if nesting, ok := matcher.(errorsutil.NestingMatcher); ok { - err = errorsutil.AggregateError(nesting.Failures()) - } else { - err = errors.New(matcher.FailureMessage(element)) - } - } - errs = append(errs, errorsutil.Nest(fmt.Sprintf("[%s]", id), err)) - } - - for id := range m.Elements { - if !elements[id] && !m.IgnoreMissing { - errs = append(errs, fmt.Errorf("missing expected element %s", id)) - } - } - - return errs -} - -func (m *ElementsMatcher) FailureMessage(actual interface{}) (message string) { - failure := errorsutil.AggregateError(m.failures) - return format.Message(actual, fmt.Sprintf("to match elements: %v", failure)) -} - -func (m *ElementsMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return format.Message(actual, "not to match elements") -} - -func (m *ElementsMatcher) Failures() []error { - return m.failures -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements_test.go deleted file mode 100644 index 355d463..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/elements_test.go +++ /dev/null @@ -1,144 +0,0 @@ -package gstruct_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gstruct" -) - -var _ = Describe("Slice", func() { - allElements := []string{"a", "b"} - missingElements := []string{"a"} - extraElements := []string{"a", "b", "c"} - duplicateElements := []string{"a", "a", "b"} - empty := []string{} - var nils []string - - It("should strictly match all elements", func() { - m := MatchAllElements(id, Elements{ - "b": Equal("b"), - "a": Equal("a"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(missingElements).ShouldNot(m, "should fail with missing elements") - Expect(extraElements).ShouldNot(m, "should fail with extra elements") - Expect(duplicateElements).ShouldNot(m, "should fail with duplicate elements") - Expect(nils).ShouldNot(m, "should fail with an uninitialized slice") - - m = MatchAllElements(id, Elements{ - "a": Equal("a"), - "b": Equal("fail"), - }) - Expect(allElements).ShouldNot(m, "should run nested matchers") - - m = MatchAllElements(id, Elements{}) - Expect(empty).Should(m, "should handle empty slices") - Expect(allElements).ShouldNot(m, "should handle only empty slices") - Expect(nils).Should(m, "should handle nil slices") - }) - - It("should ignore extra elements", func() { - m := MatchElements(id, IgnoreExtras, Elements{ - "b": Equal("b"), - "a": Equal("a"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(missingElements).ShouldNot(m, "should fail with missing elements") - Expect(extraElements).Should(m, "should ignore extra elements") - Expect(duplicateElements).ShouldNot(m, "should fail with duplicate elements") - Expect(nils).ShouldNot(m, "should fail with an uninitialized slice") - }) - - It("should ignore missing elements", func() { - m := MatchElements(id, IgnoreMissing, Elements{ - "a": Equal("a"), - "b": Equal("b"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(missingElements).Should(m, "should ignore missing elements") - Expect(extraElements).ShouldNot(m, "should fail with extra elements") - Expect(duplicateElements).ShouldNot(m, "should fail with duplicate elements") - Expect(nils).Should(m, "should ignore an uninitialized slice") - }) - - It("should ignore missing and extra elements", func() { - m := MatchElements(id, IgnoreMissing|IgnoreExtras, Elements{ - "a": Equal("a"), - "b": Equal("b"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(missingElements).Should(m, "should ignore missing elements") - Expect(extraElements).Should(m, "should ignore extra elements") - Expect(duplicateElements).ShouldNot(m, "should fail with duplicate elements") - Expect(nils).Should(m, "should ignore an uninitialized slice") - - m = MatchElements(id, IgnoreExtras|IgnoreMissing, Elements{ - "a": Equal("a"), - "b": Equal("fail"), - }) - Expect(allElements).ShouldNot(m, "should run nested matchers") - }) - - Context("with elements that share a key", func() { - nonUniqueID := func(element interface{}) string { - return element.(string)[0:1] - } - - allElements := []string{"a123", "a213", "b321"} - includingBadElements := []string{"a123", "b123", "b5555"} - extraElements := []string{"a123", "b1234", "c345"} - missingElements := []string{"b123", "b1234", "b1345"} - - It("should strictly allow multiple matches", func() { - m := MatchElements(nonUniqueID, AllowDuplicates, Elements{ - "a": ContainSubstring("1"), - "b": ContainSubstring("1"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(includingBadElements).ShouldNot(m, "should reject if a member fails the matcher") - Expect(extraElements).ShouldNot(m, "should reject with extra keys") - Expect(missingElements).ShouldNot(m, "should reject with missing keys") - Expect(nils).ShouldNot(m, "should fail with an uninitialized slice") - }) - - It("should ignore missing", func() { - m := MatchElements(nonUniqueID, AllowDuplicates|IgnoreMissing, Elements{ - "a": ContainSubstring("1"), - "b": ContainSubstring("1"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(includingBadElements).ShouldNot(m, "should reject if a member fails the matcher") - Expect(extraElements).ShouldNot(m, "should reject with extra keys") - Expect(missingElements).Should(m, "should allow missing keys") - Expect(nils).Should(m, "should allow an uninitialized slice") - }) - - It("should ignore extras", func() { - m := MatchElements(nonUniqueID, AllowDuplicates|IgnoreExtras, Elements{ - "a": ContainSubstring("1"), - "b": ContainSubstring("1"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(includingBadElements).ShouldNot(m, "should reject if a member fails the matcher") - Expect(extraElements).Should(m, "should allow extra keys") - Expect(missingElements).ShouldNot(m, "should reject missing keys") - Expect(nils).ShouldNot(m, "should reject an uninitialized slice") - }) - - It("should ignore missing and extras", func() { - m := MatchElements(nonUniqueID, AllowDuplicates|IgnoreExtras|IgnoreMissing, Elements{ - "a": ContainSubstring("1"), - "b": ContainSubstring("1"), - }) - Expect(allElements).Should(m, "should match all elements") - Expect(includingBadElements).ShouldNot(m, "should reject if a member fails the matcher") - Expect(extraElements).Should(m, "should allow extra keys") - Expect(missingElements).Should(m, "should allow missing keys") - Expect(nils).Should(m, "should allow an uninitialized slice") - }) - }) -}) - -func id(element interface{}) string { - return element.(string) -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go deleted file mode 100644 index 188492b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go +++ /dev/null @@ -1,72 +0,0 @@ -package errors - -import ( - "fmt" - "strings" - - "github.com/onsi/gomega/types" -) - -// A stateful matcher that nests other matchers within it and preserves the error types of the -// nested matcher failures. -type NestingMatcher interface { - types.GomegaMatcher - - // Returns the failures of nested matchers. - Failures() []error -} - -// An error type for labeling errors on deeply nested matchers. -type NestedError struct { - Path string - Err error -} - -func (e *NestedError) Error() string { - // Indent Errors. - indented := strings.Replace(e.Err.Error(), "\n", "\n\t", -1) - return fmt.Sprintf("%s:\n\t%v", e.Path, indented) -} - -// Create a NestedError with the given path. -// If err is a NestedError, prepend the path to it. -// If err is an AggregateError, recursively Nest each error. -func Nest(path string, err error) error { - if ag, ok := err.(AggregateError); ok { - var errs AggregateError - for _, e := range ag { - errs = append(errs, Nest(path, e)) - } - return errs - } - if ne, ok := err.(*NestedError); ok { - return &NestedError{ - Path: path + ne.Path, - Err: ne.Err, - } - } - return &NestedError{ - Path: path, - Err: err, - } -} - -// An error type for treating multiple errors as a single error. -type AggregateError []error - -// Error is part of the error interface. -func (err AggregateError) Error() string { - if len(err) == 0 { - // This should never happen, really. - return "" - } - if len(err) == 1 { - return err[0].Error() - } - result := fmt.Sprintf("[%s", err[0].Error()) - for i := 1; i < len(err); i++ { - result += fmt.Sprintf(", %s", err[i].Error()) - } - result += "]" - return result -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields.go deleted file mode 100644 index faf07b1..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields.go +++ /dev/null @@ -1,165 +0,0 @@ -// untested sections: 6 - -package gstruct - -import ( - "errors" - "fmt" - "reflect" - "runtime/debug" - "strings" - - "github.com/onsi/gomega/format" - errorsutil "github.com/onsi/gomega/gstruct/errors" - "github.com/onsi/gomega/types" -) - -//MatchAllFields succeeds if every field of a struct matches the field matcher associated with -//it, and every element matcher is matched. -// actual := struct{ -// A int -// B []bool -// C string -// }{ -// A: 5, -// B: []bool{true, false}, -// C: "foo", -// } -// -// Expect(actual).To(MatchAllFields(Fields{ -// "A": Equal(5), -// "B": ConsistOf(true, false), -// "C": Equal("foo"), -// })) -func MatchAllFields(fields Fields) types.GomegaMatcher { - return &FieldsMatcher{ - Fields: fields, - } -} - -//MatchFields succeeds if each element of a struct matches the field matcher associated with -//it. It can ignore extra fields and/or missing fields. -// actual := struct{ -// A int -// B []bool -// C string -// }{ -// A: 5, -// B: []bool{true, false}, -// C: "foo", -// } -// -// Expect(actual).To(MatchFields(IgnoreExtras, Fields{ -// "A": Equal(5), -// "B": ConsistOf(true, false), -// })) -// Expect(actual).To(MatchFields(IgnoreMissing, Fields{ -// "A": Equal(5), -// "B": ConsistOf(true, false), -// "C": Equal("foo"), -// "D": Equal("extra"), -// })) -func MatchFields(options Options, fields Fields) types.GomegaMatcher { - return &FieldsMatcher{ - Fields: fields, - IgnoreExtras: options&IgnoreExtras != 0, - IgnoreMissing: options&IgnoreMissing != 0, - } -} - -type FieldsMatcher struct { - // Matchers for each field. - Fields Fields - - // Whether to ignore extra elements or consider it an error. - IgnoreExtras bool - // Whether to ignore missing elements or consider it an error. - IgnoreMissing bool - - // State. - failures []error -} - -// Field name to matcher. -type Fields map[string]types.GomegaMatcher - -func (m *FieldsMatcher) Match(actual interface{}) (success bool, err error) { - if reflect.TypeOf(actual).Kind() != reflect.Struct { - return false, fmt.Errorf("%v is type %T, expected struct", actual, actual) - } - - m.failures = m.matchFields(actual) - if len(m.failures) > 0 { - return false, nil - } - return true, nil -} - -func (m *FieldsMatcher) matchFields(actual interface{}) (errs []error) { - val := reflect.ValueOf(actual) - typ := val.Type() - fields := map[string]bool{} - for i := 0; i < val.NumField(); i++ { - fieldName := typ.Field(i).Name - fields[fieldName] = true - - err := func() (err error) { - // This test relies heavily on reflect, which tends to panic. - // Recover here to provide more useful error messages in that case. - defer func() { - if r := recover(); r != nil { - err = fmt.Errorf("panic checking %+v: %v\n%s", actual, r, debug.Stack()) - } - }() - - matcher, expected := m.Fields[fieldName] - if !expected { - if !m.IgnoreExtras { - return fmt.Errorf("unexpected field %s: %+v", fieldName, actual) - } - return nil - } - - field := val.Field(i).Interface() - - match, err := matcher.Match(field) - if err != nil { - return err - } else if !match { - if nesting, ok := matcher.(errorsutil.NestingMatcher); ok { - return errorsutil.AggregateError(nesting.Failures()) - } - return errors.New(matcher.FailureMessage(field)) - } - return nil - }() - if err != nil { - errs = append(errs, errorsutil.Nest("."+fieldName, err)) - } - } - - for field := range m.Fields { - if !fields[field] && !m.IgnoreMissing { - errs = append(errs, fmt.Errorf("missing expected field %s", field)) - } - } - - return errs -} - -func (m *FieldsMatcher) FailureMessage(actual interface{}) (message string) { - failures := make([]string, len(m.failures)) - for i := range m.failures { - failures[i] = m.failures[i].Error() - } - return format.Message(reflect.TypeOf(actual).Name(), - fmt.Sprintf("to match fields: {\n%v\n}\n", strings.Join(failures, "\n"))) -} - -func (m *FieldsMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return format.Message(actual, "not to match fields") -} - -func (m *FieldsMatcher) Failures() []error { - return m.failures -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields_test.go deleted file mode 100644 index d5a30cf..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/fields_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package gstruct_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gstruct" -) - -var _ = Describe("Struct", func() { - allFields := struct{ A, B string }{"a", "b"} - missingFields := struct{ A string }{"a"} - extraFields := struct{ A, B, C string }{"a", "b", "c"} - emptyFields := struct{ A, B string }{} - - It("should strictly match all fields", func() { - m := MatchAllFields(Fields{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allFields).Should(m, "should match all fields") - Expect(missingFields).ShouldNot(m, "should fail with missing fields") - Expect(extraFields).ShouldNot(m, "should fail with extra fields") - Expect(emptyFields).ShouldNot(m, "should fail with empty fields") - - m = MatchAllFields(Fields{ - "A": Equal("a"), - "B": Equal("fail"), - }) - Expect(allFields).ShouldNot(m, "should run nested matchers") - }) - - It("should handle empty structs", func() { - m := MatchAllFields(Fields{}) - Expect(struct{}{}).Should(m, "should handle empty structs") - Expect(allFields).ShouldNot(m, "should fail with extra fields") - }) - - It("should ignore missing fields", func() { - m := MatchFields(IgnoreMissing, Fields{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allFields).Should(m, "should match all fields") - Expect(missingFields).Should(m, "should ignore missing fields") - Expect(extraFields).ShouldNot(m, "should fail with extra fields") - Expect(emptyFields).ShouldNot(m, "should fail with empty fields") - }) - - It("should ignore extra fields", func() { - m := MatchFields(IgnoreExtras, Fields{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allFields).Should(m, "should match all fields") - Expect(missingFields).ShouldNot(m, "should fail with missing fields") - Expect(extraFields).Should(m, "should ignore extra fields") - Expect(emptyFields).ShouldNot(m, "should fail with empty fields") - }) - - It("should ignore missing and extra fields", func() { - m := MatchFields(IgnoreMissing|IgnoreExtras, Fields{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allFields).Should(m, "should match all fields") - Expect(missingFields).Should(m, "should ignore missing fields") - Expect(extraFields).Should(m, "should ignore extra fields") - Expect(emptyFields).ShouldNot(m, "should fail with empty fields") - - m = MatchFields(IgnoreMissing|IgnoreExtras, Fields{ - "A": Equal("a"), - "B": Equal("fail"), - }) - Expect(allFields).ShouldNot(m, "should run nested matchers") - }) - - It("should produce sensible error messages", func() { - m := MatchAllFields(Fields{ - "B": Equal("b"), - "A": Equal("a"), - }) - - actual := struct{ A, C string }{A: "b", C: "c"} - - //Because the order of the constituent errors can't be guaranteed, - //we do a number of checks to make sure everything's included - m.Match(actual) - Expect(m.FailureMessage(actual)).Should(HavePrefix( - "Expected\n : \nto match fields: {\n", - )) - Expect(m.FailureMessage(actual)).Should(ContainSubstring( - ".A:\n Expected\n : b\n to equal\n : a\n", - )) - Expect(m.FailureMessage(actual)).Should(ContainSubstring( - "missing expected field B\n", - )) - Expect(m.FailureMessage(actual)).Should(ContainSubstring( - ".C:\n unexpected field C: {A:b C:c}", - )) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/gstruct_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/gstruct_tests_suite_test.go deleted file mode 100644 index d475663..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/gstruct_tests_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package gstruct_test - -import ( - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -func Test(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Gstruct Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore.go deleted file mode 100644 index 4396573..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore.go +++ /dev/null @@ -1,39 +0,0 @@ -// untested sections: 2 - -package gstruct - -import ( - "github.com/onsi/gomega/types" -) - -//Ignore ignores the actual value and always succeeds. -// Expect(nil).To(Ignore()) -// Expect(true).To(Ignore()) -func Ignore() types.GomegaMatcher { - return &IgnoreMatcher{true} -} - -//Reject ignores the actual value and always fails. It can be used in conjunction with IgnoreMissing -//to catch problematic elements, or to verify tests are running. -// Expect(nil).NotTo(Reject()) -// Expect(true).NotTo(Reject()) -func Reject() types.GomegaMatcher { - return &IgnoreMatcher{false} -} - -// A matcher that either always succeeds or always fails. -type IgnoreMatcher struct { - Succeed bool -} - -func (m *IgnoreMatcher) Match(actual interface{}) (bool, error) { - return m.Succeed, nil -} - -func (m *IgnoreMatcher) FailureMessage(_ interface{}) (message string) { - return "Unconditional failure" -} - -func (m *IgnoreMatcher) NegatedFailureMessage(_ interface{}) (message string) { - return "Unconditional success" -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore_test.go deleted file mode 100644 index 07775e7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/ignore_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package gstruct_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gstruct" -) - -var _ = Describe("Ignore", func() { - It("should always succeed", func() { - Expect(nil).Should(Ignore()) - Expect(struct{}{}).Should(Ignore()) - Expect(0).Should(Ignore()) - Expect(false).Should(Ignore()) - }) - - It("should always fail", func() { - Expect(nil).ShouldNot(Reject()) - Expect(struct{}{}).ShouldNot(Reject()) - Expect(1).ShouldNot(Reject()) - Expect(true).ShouldNot(Reject()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys.go deleted file mode 100644 index 56aed4b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys.go +++ /dev/null @@ -1,126 +0,0 @@ -// untested sections: 6 - -package gstruct - -import ( - "errors" - "fmt" - "reflect" - "runtime/debug" - "strings" - - "github.com/onsi/gomega/format" - errorsutil "github.com/onsi/gomega/gstruct/errors" - "github.com/onsi/gomega/types" -) - -func MatchAllKeys(keys Keys) types.GomegaMatcher { - return &KeysMatcher{ - Keys: keys, - } -} - -func MatchKeys(options Options, keys Keys) types.GomegaMatcher { - return &KeysMatcher{ - Keys: keys, - IgnoreExtras: options&IgnoreExtras != 0, - IgnoreMissing: options&IgnoreMissing != 0, - } -} - -type KeysMatcher struct { - // Matchers for each key. - Keys Keys - - // Whether to ignore extra keys or consider it an error. - IgnoreExtras bool - // Whether to ignore missing keys or consider it an error. - IgnoreMissing bool - - // State. - failures []error -} - -type Keys map[interface{}]types.GomegaMatcher - -func (m *KeysMatcher) Match(actual interface{}) (success bool, err error) { - if reflect.TypeOf(actual).Kind() != reflect.Map { - return false, fmt.Errorf("%v is type %T, expected map", actual, actual) - } - - m.failures = m.matchKeys(actual) - if len(m.failures) > 0 { - return false, nil - } - return true, nil -} - -func (m *KeysMatcher) matchKeys(actual interface{}) (errs []error) { - actualValue := reflect.ValueOf(actual) - keys := map[interface{}]bool{} - for _, keyValue := range actualValue.MapKeys() { - key := keyValue.Interface() - keys[key] = true - - err := func() (err error) { - // This test relies heavily on reflect, which tends to panic. - // Recover here to provide more useful error messages in that case. - defer func() { - if r := recover(); r != nil { - err = fmt.Errorf("panic checking %+v: %v\n%s", actual, r, debug.Stack()) - } - }() - - matcher, ok := m.Keys[key] - if !ok { - if !m.IgnoreExtras { - return fmt.Errorf("unexpected key %s: %+v", key, actual) - } - return nil - } - - valInterface := actualValue.MapIndex(keyValue).Interface() - - match, err := matcher.Match(valInterface) - if err != nil { - return err - } - - if !match { - if nesting, ok := matcher.(errorsutil.NestingMatcher); ok { - return errorsutil.AggregateError(nesting.Failures()) - } - return errors.New(matcher.FailureMessage(valInterface)) - } - return nil - }() - if err != nil { - errs = append(errs, errorsutil.Nest(fmt.Sprintf(".%#v", key), err)) - } - } - - for key := range m.Keys { - if !keys[key] && !m.IgnoreMissing { - errs = append(errs, fmt.Errorf("missing expected key %s", key)) - } - } - - return errs -} - -func (m *KeysMatcher) FailureMessage(actual interface{}) (message string) { - failures := make([]string, len(m.failures)) - for i := range m.failures { - failures[i] = m.failures[i].Error() - } - return format.Message(reflect.TypeOf(actual).Name(), - fmt.Sprintf("to match keys: {\n%v\n}\n", strings.Join(failures, "\n"))) -} - -func (m *KeysMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return format.Message(actual, "not to match keys") -} - -func (m *KeysMatcher) Failures() []error { - return m.failures -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys_test.go deleted file mode 100644 index b6ba67a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/keys_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package gstruct_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gstruct" -) - -var _ = Describe("Map", func() { - allKeys := map[string]string{"A": "a", "B": "b"} - missingKeys := map[string]string{"A": "a"} - extraKeys := map[string]string{"A": "a", "B": "b", "C": "c"} - emptyKeys := map[string]string{} - - It("should strictly match all keys", func() { - m := MatchAllKeys(Keys{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allKeys).Should(m, "should match all keys") - Expect(missingKeys).ShouldNot(m, "should fail with missing keys") - Expect(extraKeys).ShouldNot(m, "should fail with extra keys") - Expect(emptyKeys).ShouldNot(m, "should fail with empty keys") - - m = MatchAllKeys(Keys{ - "A": Equal("a"), - "B": Equal("fail"), - }) - Expect(allKeys).ShouldNot(m, "should run nested matchers") - }) - - It("should handle empty maps", func() { - m := MatchAllKeys(Keys{}) - Expect(map[string]string{}).Should(m, "should handle empty maps") - Expect(allKeys).ShouldNot(m, "should fail with extra keys") - }) - - It("should ignore missing keys", func() { - m := MatchKeys(IgnoreMissing, Keys{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allKeys).Should(m, "should match all keys") - Expect(missingKeys).Should(m, "should ignore missing keys") - Expect(extraKeys).ShouldNot(m, "should fail with extra keys") - Expect(emptyKeys).Should(m, "should match empty keys") - }) - - It("should ignore extra keys", func() { - m := MatchKeys(IgnoreExtras, Keys{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allKeys).Should(m, "should match all keys") - Expect(missingKeys).ShouldNot(m, "should fail with missing keys") - Expect(extraKeys).Should(m, "should ignore extra keys") - Expect(emptyKeys).ShouldNot(m, "should fail with empty keys") - }) - - It("should ignore missing and extra keys", func() { - m := MatchKeys(IgnoreMissing|IgnoreExtras, Keys{ - "B": Equal("b"), - "A": Equal("a"), - }) - Expect(allKeys).Should(m, "should match all keys") - Expect(missingKeys).Should(m, "should ignore missing keys") - Expect(extraKeys).Should(m, "should ignore extra keys") - Expect(emptyKeys).Should(m, "should match empty keys") - - m = MatchKeys(IgnoreMissing|IgnoreExtras, Keys{ - "A": Equal("a"), - "B": Equal("fail"), - }) - Expect(allKeys).ShouldNot(m, "should run nested matchers") - }) - - It("should produce sensible error messages", func() { - m := MatchAllKeys(Keys{ - "B": Equal("b"), - "A": Equal("a"), - }) - - actual := map[string]string{"A": "b", "C": "c"} - - //Because the order of the constituent errors can't be guaranteed, - //we do a number of checks to make sure everything's included - m.Match(actual) - Expect(m.FailureMessage(actual)).Should(HavePrefix( - "Expected\n : \nto match keys: {\n", - )) - Expect(m.FailureMessage(actual)).Should(ContainSubstring( - ".\"A\":\n Expected\n : b\n to equal\n : a\n", - )) - Expect(m.FailureMessage(actual)).Should(ContainSubstring( - "missing expected key B\n", - )) - Expect(m.FailureMessage(actual)).Should(ContainSubstring( - ".\"C\":\n unexpected key C: map[", - )) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer.go deleted file mode 100644 index cc828a3..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer.go +++ /dev/null @@ -1,58 +0,0 @@ -// untested sections: 3 - -package gstruct - -import ( - "fmt" - "reflect" - - "github.com/onsi/gomega/format" - "github.com/onsi/gomega/types" -) - -//PointTo applies the given matcher to the value pointed to by actual. It fails if the pointer is -//nil. -// actual := 5 -// Expect(&actual).To(PointTo(Equal(5))) -func PointTo(matcher types.GomegaMatcher) types.GomegaMatcher { - return &PointerMatcher{ - Matcher: matcher, - } -} - -type PointerMatcher struct { - Matcher types.GomegaMatcher - - // Failure message. - failure string -} - -func (m *PointerMatcher) Match(actual interface{}) (bool, error) { - val := reflect.ValueOf(actual) - - // return error if actual type is not a pointer - if val.Kind() != reflect.Ptr { - return false, fmt.Errorf("PointerMatcher expects a pointer but we have '%s'", val.Kind()) - } - - if !val.IsValid() || val.IsNil() { - m.failure = format.Message(actual, "not to be ") - return false, nil - } - - // Forward the value. - elem := val.Elem().Interface() - match, err := m.Matcher.Match(elem) - if !match { - m.failure = m.Matcher.FailureMessage(elem) - } - return match, err -} - -func (m *PointerMatcher) FailureMessage(_ interface{}) (message string) { - return m.failure -} - -func (m *PointerMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return m.Matcher.NegatedFailureMessage(actual) -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer_test.go deleted file mode 100644 index 805a92a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/pointer_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package gstruct_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/gstruct" -) - -var _ = Describe("PointTo", func() { - It("should fail when passed nil", func() { - var p *struct{} - Expect(p).Should(BeNil()) - }) - - It("should succeed when passed non-nil pointer", func() { - var s struct{} - Expect(&s).Should(PointTo(Ignore())) - }) - - It("should unwrap the pointee value", func() { - i := 1 - Expect(&i).Should(PointTo(Equal(1))) - Expect(&i).ShouldNot(PointTo(Equal(2))) - }) - - It("should work with nested pointers", func() { - i := 1 - ip := &i - ipp := &ip - Expect(ipp).Should(PointTo(PointTo(Equal(1)))) - Expect(ipp).ShouldNot(PointTo(PointTo(Equal(2)))) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/types.go b/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/types.go deleted file mode 100644 index 48cbbe8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/gstruct/types.go +++ /dev/null @@ -1,15 +0,0 @@ -package gstruct - -//Options is the type for options passed to some matchers. -type Options int - -const ( - //IgnoreExtras tells the matcher to ignore extra elements or fields, rather than triggering a failure. - IgnoreExtras Options = 1 << iota - //IgnoreMissing tells the matcher to ignore missing elements or fields, rather than triggering a failure. - IgnoreMissing - //AllowDuplicates tells the matcher to permit multiple members of the slice to produce the same ID when - //considered by the indentifier function. All members that map to a given key must still match successfully - //with the matcher that is provided for that key. - AllowDuplicates -) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_suite_test.go deleted file mode 100644 index dae47a4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package assertion_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestAssertion(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Assertion Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_test.go deleted file mode 100644 index dff4a03..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/internal/assertion/assertion_test.go +++ /dev/null @@ -1,258 +0,0 @@ -package assertion_test - -import ( - "errors" - - "github.com/onsi/gomega/internal/testingtsupport" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/internal/assertion" - "github.com/onsi/gomega/internal/fakematcher" - "github.com/onsi/gomega/types" -) - -var _ = Describe("Assertion", func() { - var ( - a *assertion.Assertion - failureMessage string - failureCallerSkip int - matcher *fakematcher.FakeMatcher - ) - - input := "The thing I'm testing" - - var fakeFailWrapper = &types.GomegaFailWrapper{ - Fail: func(message string, callerSkip ...int) { - failureMessage = message - if len(callerSkip) == 1 { - failureCallerSkip = callerSkip[0] - } - }, - TWithHelper: testingtsupport.EmptyTWithHelper{}, - } - - BeforeEach(func() { - matcher = &fakematcher.FakeMatcher{} - failureMessage = "" - failureCallerSkip = 0 - a = assertion.New(input, fakeFailWrapper, 1) - }) - - Context("when called", func() { - It("should pass the provided input value to the matcher", func() { - a.Should(matcher) - - Expect(matcher.ReceivedActual).Should(Equal(input)) - matcher.ReceivedActual = "" - - a.ShouldNot(matcher) - - Expect(matcher.ReceivedActual).Should(Equal(input)) - matcher.ReceivedActual = "" - - a.To(matcher) - - Expect(matcher.ReceivedActual).Should(Equal(input)) - matcher.ReceivedActual = "" - - a.ToNot(matcher) - - Expect(matcher.ReceivedActual).Should(Equal(input)) - matcher.ReceivedActual = "" - - a.NotTo(matcher) - - Expect(matcher.ReceivedActual).Should(Equal(input)) - }) - }) - - Context("when the matcher succeeds", func() { - BeforeEach(func() { - matcher.MatchesToReturn = true - matcher.ErrToReturn = nil - }) - - Context("and a positive assertion is being made", func() { - It("should not call the failure callback", func() { - a.Should(matcher) - Expect(failureMessage).Should(Equal("")) - }) - - It("should be true", func() { - Expect(a.Should(matcher)).Should(BeTrue()) - }) - }) - - Context("and a negative assertion is being made", func() { - It("should call the failure callback", func() { - a.ShouldNot(matcher) - Expect(failureMessage).Should(Equal("negative: The thing I'm testing")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - - It("should be false", func() { - Expect(a.ShouldNot(matcher)).Should(BeFalse()) - }) - }) - }) - - Context("when the matcher fails", func() { - BeforeEach(func() { - matcher.MatchesToReturn = false - matcher.ErrToReturn = nil - }) - - Context("and a positive assertion is being made", func() { - It("should call the failure callback", func() { - a.Should(matcher) - Expect(failureMessage).Should(Equal("positive: The thing I'm testing")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - - It("should be false", func() { - Expect(a.Should(matcher)).Should(BeFalse()) - }) - }) - - Context("and a negative assertion is being made", func() { - It("should not call the failure callback", func() { - a.ShouldNot(matcher) - Expect(failureMessage).Should(Equal("")) - }) - - It("should be true", func() { - Expect(a.ShouldNot(matcher)).Should(BeTrue()) - }) - }) - }) - - Context("When reporting a failure", func() { - BeforeEach(func() { - matcher.MatchesToReturn = false - matcher.ErrToReturn = nil - }) - - Context("and there is an optional description", func() { - It("should append the description to the failure message", func() { - a.Should(matcher, "A description") - Expect(failureMessage).Should(Equal("A description\npositive: The thing I'm testing")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - }) - - Context("and there are multiple arguments to the optional description", func() { - It("should append the formatted description to the failure message", func() { - a.Should(matcher, "A description of [%d]", 3) - Expect(failureMessage).Should(Equal("A description of [3]\npositive: The thing I'm testing")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - }) - }) - - Context("When the matcher returns an error", func() { - BeforeEach(func() { - matcher.ErrToReturn = errors.New("Kaboom!") - }) - - Context("and a positive assertion is being made", func() { - It("should call the failure callback", func() { - matcher.MatchesToReturn = true - a.Should(matcher) - Expect(failureMessage).Should(Equal("Kaboom!")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - }) - - Context("and a negative assertion is being made", func() { - It("should call the failure callback", func() { - matcher.MatchesToReturn = false - a.ShouldNot(matcher) - Expect(failureMessage).Should(Equal("Kaboom!")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - }) - - It("should always be false", func() { - Expect(a.Should(matcher)).Should(BeFalse()) - Expect(a.ShouldNot(matcher)).Should(BeFalse()) - }) - }) - - Context("when there are extra parameters", func() { - It("(a simple example)", func() { - Expect(func() (string, int, error) { - return "foo", 0, nil - }()).Should(Equal("foo")) - }) - - Context("when the parameters are all nil or zero", func() { - It("should invoke the matcher", func() { - matcher.MatchesToReturn = true - matcher.ErrToReturn = nil - - var typedNil []string - a = assertion.New(input, fakeFailWrapper, 1, 0, nil, typedNil) - - result := a.Should(matcher) - Expect(result).Should(BeTrue()) - Expect(matcher.ReceivedActual).Should(Equal(input)) - - Expect(failureMessage).Should(BeZero()) - }) - }) - - Context("when any of the parameters are not nil or zero", func() { - It("should call the failure callback", func() { - matcher.MatchesToReturn = false - matcher.ErrToReturn = nil - - a = assertion.New(input, fakeFailWrapper, 1, errors.New("foo")) - result := a.Should(matcher) - Expect(result).Should(BeFalse()) - Expect(matcher.ReceivedActual).Should(BeZero(), "The matcher doesn't even get called") - Expect(failureMessage).Should(ContainSubstring("foo")) - failureMessage = "" - - a = assertion.New(input, fakeFailWrapper, 1, nil, 1) - result = a.ShouldNot(matcher) - Expect(result).Should(BeFalse()) - Expect(failureMessage).Should(ContainSubstring("1")) - failureMessage = "" - - a = assertion.New(input, fakeFailWrapper, 1, nil, 0, []string{"foo"}) - result = a.To(matcher) - Expect(result).Should(BeFalse()) - Expect(failureMessage).Should(ContainSubstring("foo")) - failureMessage = "" - - a = assertion.New(input, fakeFailWrapper, 1, nil, 0, []string{"foo"}) - result = a.ToNot(matcher) - Expect(result).Should(BeFalse()) - Expect(failureMessage).Should(ContainSubstring("foo")) - failureMessage = "" - - a = assertion.New(input, fakeFailWrapper, 1, nil, 0, []string{"foo"}) - result = a.NotTo(matcher) - Expect(result).Should(BeFalse()) - Expect(failureMessage).Should(ContainSubstring("foo")) - Expect(failureCallerSkip).Should(Equal(3)) - }) - }) - }) - - Context("Making an assertion without a registered fail handler", func() { - It("should panic", func() { - defer func() { - e := recover() - RegisterFailHandler(Fail) - if e == nil { - Fail("expected a panic to have occurred") - } - }() - - RegisterFailHandler(nil) - Expect(true).Should(BeTrue()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_suite_test.go deleted file mode 100644 index bdb0c3d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_suite_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package asyncassertion_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - "testing" -) - -func TestAsyncAssertion(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "AsyncAssertion Suite") -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_test.go deleted file mode 100644 index 088d462..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_test.go +++ /dev/null @@ -1,351 +0,0 @@ -package asyncassertion_test - -import ( - "errors" - "time" - - "github.com/onsi/gomega/internal/testingtsupport" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "github.com/onsi/gomega/internal/asyncassertion" - "github.com/onsi/gomega/types" -) - -var _ = Describe("Async Assertion", func() { - var ( - failureMessage string - callerSkip int - ) - - var fakeFailWrapper = &types.GomegaFailWrapper{ - Fail: func(message string, skip ...int) { - failureMessage = message - callerSkip = skip[0] - }, - TWithHelper: testingtsupport.EmptyTWithHelper{}, - } - - BeforeEach(func() { - failureMessage = "" - callerSkip = 0 - }) - - Describe("Eventually", func() { - Context("the positive case", func() { - It("should poll the function and matcher", func() { - counter := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() int { - counter++ - return counter - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.Should(BeNumerically("==", 5)) - Expect(failureMessage).Should(BeZero()) - }) - - It("should continue when the matcher errors", func() { - counter := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() interface{} { - counter++ - if counter == 5 { - return "not-a-number" //this should cause the matcher to error - } - return counter - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.Should(BeNumerically("==", 5), "My description %d", 2) - - Expect(failureMessage).Should(ContainSubstring("Timed out after")) - Expect(failureMessage).Should(ContainSubstring("My description 2")) - Expect(callerSkip).Should(Equal(4)) - }) - - It("should be able to timeout", func() { - counter := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() int { - counter++ - return counter - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.Should(BeNumerically(">", 100), "My description %d", 2) - - Expect(counter).Should(BeNumerically(">", 8)) - Expect(counter).Should(BeNumerically("<=", 10)) - Expect(failureMessage).Should(ContainSubstring("Timed out after")) - Expect(failureMessage).Should(MatchRegexp(`\: \d`), "Should pass the correct value to the matcher message formatter.") - Expect(failureMessage).Should(ContainSubstring("My description 2")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - - Context("the negative case", func() { - It("should poll the function and matcher", func() { - counter := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() int { - counter += 1 - return counter - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.ShouldNot(BeNumerically("<", 3)) - - Expect(counter).Should(Equal(3)) - Expect(failureMessage).Should(BeZero()) - }) - - It("should timeout when the matcher errors", func() { - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() interface{} { - return 0 //this should cause the matcher to error - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.ShouldNot(HaveLen(0), "My description %d", 2) - - Expect(failureMessage).Should(ContainSubstring("Timed out after")) - Expect(failureMessage).Should(ContainSubstring("Error:")) - Expect(failureMessage).Should(ContainSubstring("My description 2")) - Expect(callerSkip).Should(Equal(4)) - }) - - It("should be able to timeout", func() { - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() int { - return 0 - }, fakeFailWrapper, time.Duration(0.1*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.ShouldNot(Equal(0), "My description %d", 2) - - Expect(failureMessage).Should(ContainSubstring("Timed out after")) - Expect(failureMessage).Should(ContainSubstring(": 0"), "Should pass the correct value to the matcher message formatter.") - Expect(failureMessage).Should(ContainSubstring("My description 2")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - - Context("with a function that returns multiple values", func() { - It("should eventually succeed if the additional arguments are nil", func() { - i := 0 - Eventually(func() (int, error) { - i++ - return i, nil - }).Should(Equal(10)) - }) - - It("should eventually timeout if the additional arguments are not nil", func() { - i := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() (int, error) { - i++ - return i, errors.New("bam") - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - a.Should(Equal(2)) - - Expect(failureMessage).Should(ContainSubstring("Timed out after")) - Expect(failureMessage).Should(ContainSubstring("Error:")) - Expect(failureMessage).Should(ContainSubstring("bam")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - - Context("Making an assertion without a registered fail handler", func() { - It("should panic", func() { - defer func() { - e := recover() - RegisterFailHandler(Fail) - if e == nil { - Fail("expected a panic to have occurred") - } - }() - - RegisterFailHandler(nil) - c := make(chan bool, 1) - c <- true - Eventually(c).Should(Receive()) - }) - }) - }) - - Describe("Consistently", func() { - Describe("The positive case", func() { - Context("when the matcher consistently passes for the duration", func() { - It("should pass", func() { - calls := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, func() string { - calls++ - return "foo" - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.Should(Equal("foo")) - Expect(calls).Should(BeNumerically(">", 8)) - Expect(calls).Should(BeNumerically("<=", 10)) - Expect(failureMessage).Should(BeZero()) - }) - }) - - Context("when the matcher fails at some point", func() { - It("should fail", func() { - calls := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, func() interface{} { - calls++ - if calls > 5 { - return "bar" - } - return "foo" - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.Should(Equal("foo")) - Expect(failureMessage).Should(ContainSubstring("to equal")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - - Context("when the matcher errors at some point", func() { - It("should fail", func() { - calls := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, func() interface{} { - calls++ - if calls > 5 { - return 3 - } - return []int{1, 2, 3} - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.Should(HaveLen(3)) - Expect(failureMessage).Should(ContainSubstring("HaveLen matcher expects")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - }) - - Describe("The negative case", func() { - Context("when the matcher consistently passes for the duration", func() { - It("should pass", func() { - c := make(chan bool) - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, c, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.ShouldNot(Receive()) - Expect(failureMessage).Should(BeZero()) - }) - }) - - Context("when the matcher fails at some point", func() { - It("should fail", func() { - c := make(chan bool) - go func() { - time.Sleep(time.Duration(100 * time.Millisecond)) - c <- true - }() - - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, c, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.ShouldNot(Receive()) - Expect(failureMessage).Should(ContainSubstring("not to receive anything")) - }) - }) - - Context("when the matcher errors at some point", func() { - It("should fail", func() { - calls := 0 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeConsistently, func() interface{} { - calls++ - return calls - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - - a.ShouldNot(BeNumerically(">", 5)) - Expect(failureMessage).Should(ContainSubstring("not to be >")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - }) - - Context("with a function that returns multiple values", func() { - It("should consistently succeed if the additional arguments are nil", func() { - i := 2 - Consistently(func() (int, error) { - i++ - return i, nil - }).Should(BeNumerically(">=", 2)) - }) - - It("should eventually timeout if the additional arguments are not nil", func() { - i := 2 - a := asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() (int, error) { - i++ - return i, errors.New("bam") - }, fakeFailWrapper, time.Duration(0.2*float64(time.Second)), time.Duration(0.02*float64(time.Second)), 1) - a.Should(BeNumerically(">=", 2)) - - Expect(failureMessage).Should(ContainSubstring("Error:")) - Expect(failureMessage).Should(ContainSubstring("bam")) - Expect(callerSkip).Should(Equal(4)) - }) - }) - - Context("Making an assertion without a registered fail handler", func() { - It("should panic", func() { - defer func() { - e := recover() - RegisterFailHandler(Fail) - if e == nil { - Fail("expected a panic to have occurred") - } - }() - - RegisterFailHandler(nil) - c := make(chan bool) - Consistently(c).ShouldNot(Receive()) - }) - }) - }) - - Context("when passed a function with the wrong # or arguments & returns", func() { - It("should panic", func() { - Expect(func() { - asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() {}, fakeFailWrapper, 0, 0, 1) - }).Should(Panic()) - - Expect(func() { - asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func(a string) int { return 0 }, fakeFailWrapper, 0, 0, 1) - }).Should(Panic()) - - Expect(func() { - asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() int { return 0 }, fakeFailWrapper, 0, 0, 1) - }).ShouldNot(Panic()) - - Expect(func() { - asyncassertion.New(asyncassertion.AsyncAssertionTypeEventually, func() (int, error) { return 0, nil }, fakeFailWrapper, 0, 0, 1) - }).ShouldNot(Panic()) - }) - }) - - Describe("bailing early", func() { - Context("when actual is a value", func() { - It("Eventually should bail out and fail early if the matcher says to", func() { - c := make(chan bool) - close(c) - - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(c, 0.1).Should(Receive()) - }) - Expect(time.Since(t)).Should(BeNumerically("<", 90*time.Millisecond)) - - Expect(failures).Should(HaveLen(1)) - }) - }) - - Context("when actual is a function", func() { - It("should never bail early", func() { - c := make(chan bool) - close(c) - - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(func() chan bool { - return c - }, 0.1).Should(Receive()) - }) - Expect(time.Since(t)).Should(BeNumerically(">=", 90*time.Millisecond)) - - Expect(failures).Should(HaveLen(1)) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go b/src/imagemagick/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go deleted file mode 100644 index 6e351a7..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go +++ /dev/null @@ -1,23 +0,0 @@ -package fakematcher - -import "fmt" - -type FakeMatcher struct { - ReceivedActual interface{} - MatchesToReturn bool - ErrToReturn error -} - -func (matcher *FakeMatcher) Match(actual interface{}) (bool, error) { - matcher.ReceivedActual = actual - - return matcher.MatchesToReturn, matcher.ErrToReturn -} - -func (matcher *FakeMatcher) FailureMessage(actual interface{}) string { - return fmt.Sprintf("positive: %v", actual) -} - -func (matcher *FakeMatcher) NegatedFailureMessage(actual interface{}) string { - return fmt.Sprintf("negative: %v", actual) -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/internal/testingtsupport/testing_t_support_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/internal/testingtsupport/testing_t_support_test.go deleted file mode 100644 index 8fd8f0a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/internal/testingtsupport/testing_t_support_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package testingtsupport_test - -import ( - "regexp" - "time" - - "github.com/onsi/gomega/internal/testingtsupport" - - . "github.com/onsi/gomega" - - "fmt" - "testing" -) - -func TestTestingT(t *testing.T) { - RegisterTestingT(t) - Ω(true).Should(BeTrue()) -} - -type FakeTWithHelper struct { - LastFatal string -} - -func (f *FakeTWithHelper) Fatalf(format string, args ...interface{}) { - f.LastFatal = fmt.Sprintf(format, args...) -} - -func TestGomegaWithTWithoutHelper(t *testing.T) { - g := NewGomegaWithT(t) - - testingtsupport.StackTracePruneRE = regexp.MustCompile(`\/ginkgo\/`) - - f := &FakeTWithHelper{} - testG := NewGomegaWithT(f) - - testG.Expect("foo").To(Equal("foo")) - g.Expect(f.LastFatal).To(BeZero()) - - testG.Expect("foo").To(Equal("bar")) - g.Expect(f.LastFatal).To(ContainSubstring(": foo")) - g.Expect(f.LastFatal).To(ContainSubstring("testingtsupport_test"), "It should include a stacktrace") - - testG.Eventually("foo2", time.Millisecond).Should(Equal("bar")) - g.Expect(f.LastFatal).To(ContainSubstring(": foo2")) - - testG.Consistently("foo3", time.Millisecond).Should(Equal("bar")) - g.Expect(f.LastFatal).To(ContainSubstring(": foo3")) -} - -type FakeTWithoutHelper struct { - LastFatal string - HelperCount int -} - -func (f *FakeTWithoutHelper) Fatalf(format string, args ...interface{}) { - f.LastFatal = fmt.Sprintf(format, args...) -} - -func (f *FakeTWithoutHelper) Helper() { - f.HelperCount += 1 -} - -func (f *FakeTWithoutHelper) ResetHelper() { - f.HelperCount = 0 -} - -func TestGomegaWithTWithHelper(t *testing.T) { - g := NewGomegaWithT(t) - - f := &FakeTWithoutHelper{} - testG := NewGomegaWithT(f) - - testG.Expect("foo").To(Equal("foo")) - g.Expect(f.LastFatal).To(BeZero()) - g.Expect(f.HelperCount).To(BeNumerically(">", 0)) - f.ResetHelper() - - testG.Expect("foo").To(Equal("bar")) - g.Expect(f.LastFatal).To(ContainSubstring(": foo")) - g.Expect(f.LastFatal).NotTo(ContainSubstring("testingtsupport_test"), "It should _not_ include a stacktrace") - g.Expect(f.HelperCount).To(BeNumerically(">", 0)) - f.ResetHelper() - - testG.Eventually("foo2", time.Millisecond).Should(Equal("bar")) - g.Expect(f.LastFatal).To(ContainSubstring(": foo2")) - g.Expect(f.HelperCount).To(BeNumerically(">", 0)) - f.ResetHelper() - - testG.Consistently("foo3", time.Millisecond).Should(Equal("bar")) - g.Expect(f.LastFatal).To(ContainSubstring(": foo3")) - g.Expect(f.HelperCount).To(BeNumerically(">", 0)) -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/and_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/and_test.go deleted file mode 100644 index acf778c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/and_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" - "github.com/onsi/gomega/types" -) - -// sample data -var ( - // example input - input = "hi" - // some matchers that succeed against the input - true1 = HaveLen(2) - true2 = Equal("hi") - true3 = MatchRegexp("hi") - // some matchers that fail against the input. - false1 = HaveLen(1) - false2 = Equal("hip") - false3 = MatchRegexp("hope") -) - -// verifyFailureMessage expects the matcher to fail with the given input, and verifies the failure message. -func verifyFailureMessage(m types.GomegaMatcher, input string, expectedFailureMsgFragment string) { - Expect(m.Match(input)).To(BeFalse()) - Expect(m.FailureMessage(input)).To(Equal( - "Expected\n : " + input + "\n" + expectedFailureMsgFragment)) -} - -var _ = Describe("AndMatcher", func() { - It("works with positive cases", func() { - Expect(input).To(And()) - Expect(input).To(And(true1)) - Expect(input).To(And(true1, true2)) - Expect(input).To(And(true1, true2, true3)) - - // use alias - Expect(input).To(SatisfyAll(true1, true2, true3)) - }) - - It("works with negative cases", func() { - Expect(input).ToNot(And(false1, false2)) - Expect(input).ToNot(And(true1, true2, false3)) - Expect(input).ToNot(And(true1, false2, false3)) - Expect(input).ToNot(And(false1, true1, true2)) - }) - - Context("failure messages", func() { - Context("when match fails", func() { - It("gives a descriptive message", func() { - verifyFailureMessage(And(false1, true1), input, "to have length 1") - verifyFailureMessage(And(true1, false2), input, "to equal\n : hip") - verifyFailureMessage(And(true1, true2, false3), input, "to match regular expression\n : hope") - }) - }) - - Context("when match succeeds, but expected it to fail", func() { - It("gives a descriptive message", func() { - verifyFailureMessage(Not(And(true1, true2)), input, - `To not satisfy all of these matchers: [%!s(*matchers.HaveLenMatcher=&{2}) %!s(*matchers.EqualMatcher=&{hi})]`) - }) - }) - }) - - Context("MatchMayChangeInTheFuture", func() { - Context("Match returned false", func() { - Context("returns value of the failed matcher", func() { - It("false if failed matcher not going to change", func() { - // 3 matchers: 1st returns true, 2nd returns false and is not going to change, 3rd is never called - m := And(Not(BeNil()), Or(), Equal(1)) - Expect(m.Match("hi")).To(BeFalse()) - Expect(m.(*AndMatcher).MatchMayChangeInTheFuture("hi")).To(BeFalse()) // empty Or() indicates not going to change - }) - It("true if failed matcher indicates it might change", func() { - // 3 matchers: 1st returns true, 2nd returns false and "might" change, 3rd is never called - m := And(Not(BeNil()), Equal(5), Equal(1)) - Expect(m.Match("hi")).To(BeFalse()) - Expect(m.(*AndMatcher).MatchMayChangeInTheFuture("hi")).To(BeTrue()) // Equal(5) indicates it might change - }) - }) - }) - Context("Match returned true", func() { - It("returns true if any of the matchers could change", func() { - // 3 matchers, all return true, and all could change - m := And(Not(BeNil()), Equal("hi"), HaveLen(2)) - Expect(m.Match("hi")).To(BeTrue()) - Expect(m.(*AndMatcher).MatchMayChangeInTheFuture("hi")).To(BeTrue()) // all 3 of these matchers default to 'true' - }) - It("returns false if none of the matchers could change", func() { - // empty And() has the property of always matching, and never can change since there are no sub-matchers that could change - m := And() - Expect(m.Match("anything")).To(BeTrue()) - Expect(m.(*AndMatcher).MatchMayChangeInTheFuture("anything")).To(BeFalse()) - - // And() with 3 sub-matchers that return true, and can't change - m = And(And(), And(), And()) - Expect(m.Match("hi")).To(BeTrue()) - Expect(m.(*AndMatcher).MatchMayChangeInTheFuture("hi")).To(BeFalse()) // the 3 empty And()'s won't change - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher_test.go deleted file mode 100644 index 471a46d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("AssignableToTypeOf", func() { - Context("When asserting assignability between types", func() { - It("should do the right thing", func() { - Expect(0).Should(BeAssignableToTypeOf(0)) - Expect(5).Should(BeAssignableToTypeOf(-1)) - Expect("foo").Should(BeAssignableToTypeOf("bar")) - Expect(struct{ Foo string }{}).Should(BeAssignableToTypeOf(struct{ Foo string }{})) - - Expect(0).ShouldNot(BeAssignableToTypeOf("bar")) - Expect(5).ShouldNot(BeAssignableToTypeOf(struct{ Foo string }{})) - Expect("foo").ShouldNot(BeAssignableToTypeOf(42)) - }) - }) - - Context("When asserting nil values", func() { - It("should error", func() { - success, err := (&AssignableToTypeOfMatcher{Expected: nil}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - - Context("When actual is nil and expected is not nil", func() { - It("should return false without error", func() { - success, err := (&AssignableToTypeOfMatcher{Expected: 17}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).ShouldNot(HaveOccurred()) - }) - }) - - Context("When actual is not nil and expected is nil", func() { - It("should error", func() { - success, err := (&AssignableToTypeOfMatcher{Expected: nil}).Match(17) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_directory_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_directory_test.go deleted file mode 100644 index bc87427..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_directory_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package matchers_test - -import ( - "io/ioutil" - "os" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeADirectoryMatcher", func() { - Context("when passed a string", func() { - It("should do the right thing", func() { - Expect("/dne/test").ShouldNot(BeADirectory()) - - tmpFile, err := ioutil.TempFile("", "gomega-test-tempfile") - Expect(err).ShouldNot(HaveOccurred()) - defer os.Remove(tmpFile.Name()) - Expect(tmpFile.Name()).ShouldNot(BeADirectory()) - - tmpDir, err := ioutil.TempDir("", "gomega-test-tempdir") - Expect(err).ShouldNot(HaveOccurred()) - defer os.Remove(tmpDir) - Expect(tmpDir).Should(BeADirectory()) - }) - }) - - Context("when passed something else", func() { - It("should error", func() { - success, err := (&BeADirectoryMatcher{}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeADirectoryMatcher{}).Match(true) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_regular_file_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_regular_file_test.go deleted file mode 100644 index eae06a0..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_a_regular_file_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package matchers_test - -import ( - "io/ioutil" - "os" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeARegularFileMatcher", func() { - Context("when passed a string", func() { - It("should do the right thing", func() { - Expect("/dne/test").ShouldNot(BeARegularFile()) - - tmpFile, err := ioutil.TempFile("", "gomega-test-tempfile") - Expect(err).ShouldNot(HaveOccurred()) - defer os.Remove(tmpFile.Name()) - Expect(tmpFile.Name()).Should(BeARegularFile()) - - tmpDir, err := ioutil.TempDir("", "gomega-test-tempdir") - Expect(err).ShouldNot(HaveOccurred()) - defer os.Remove(tmpDir) - Expect(tmpDir).ShouldNot(BeARegularFile()) - }) - }) - - Context("when passed something else", func() { - It("should error", func() { - success, err := (&BeARegularFileMatcher{}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeARegularFileMatcher{}).Match(true) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_an_existing_file_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_an_existing_file_test.go deleted file mode 100644 index e28bd0d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_an_existing_file_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package matchers_test - -import ( - "io/ioutil" - "os" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeAnExistingFileMatcher", func() { - Context("when passed a string", func() { - It("should do the right thing", func() { - Expect("/dne/test").ShouldNot(BeAnExistingFile()) - - tmpFile, err := ioutil.TempFile("", "gomega-test-tempfile") - Expect(err).ShouldNot(HaveOccurred()) - defer os.Remove(tmpFile.Name()) - Expect(tmpFile.Name()).Should(BeAnExistingFile()) - - tmpDir, err := ioutil.TempDir("", "gomega-test-tempdir") - Expect(err).ShouldNot(HaveOccurred()) - defer os.Remove(tmpDir) - Expect(tmpDir).Should(BeAnExistingFile()) - }) - }) - - Context("when passed something else", func() { - It("should error", func() { - success, err := (&BeAnExistingFileMatcher{}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeAnExistingFileMatcher{}).Match(true) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_closed_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_closed_matcher_test.go deleted file mode 100644 index c2e49ab..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_closed_matcher_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeClosedMatcher", func() { - Context("when passed a channel", func() { - It("should do the right thing", func() { - openChannel := make(chan bool) - Expect(openChannel).ShouldNot(BeClosed()) - - var openReaderChannel <-chan bool - openReaderChannel = openChannel - Expect(openReaderChannel).ShouldNot(BeClosed()) - - closedChannel := make(chan bool) - close(closedChannel) - - Expect(closedChannel).Should(BeClosed()) - - var closedReaderChannel <-chan bool - closedReaderChannel = closedChannel - Expect(closedReaderChannel).Should(BeClosed()) - }) - }) - - Context("when passed a send-only channel", func() { - It("should error", func() { - openChannel := make(chan bool) - var openWriterChannel chan<- bool - openWriterChannel = openChannel - - success, err := (&BeClosedMatcher{}).Match(openWriterChannel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - closedChannel := make(chan bool) - close(closedChannel) - - var closedWriterChannel chan<- bool - closedWriterChannel = closedChannel - - success, err = (&BeClosedMatcher{}).Match(closedWriterChannel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - }) - }) - - Context("when passed something else", func() { - It("should error", func() { - var nilChannel chan bool - - success, err := (&BeClosedMatcher{}).Match(nilChannel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeClosedMatcher{}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeClosedMatcher{}).Match(7) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher_test.go deleted file mode 100644 index 41df6bc..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_element_of_matcher_test.go +++ /dev/null @@ -1,66 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeElementOf", func() { - Context("when passed a supported type", func() { - It("should do the right thing", func() { - Expect(2).Should(BeElementOf([2]int{1, 2})) - Expect(3).ShouldNot(BeElementOf([2]int{1, 2})) - - Expect(2).Should(BeElementOf([]int{1, 2})) - Expect(3).ShouldNot(BeElementOf([]int{1, 2})) - - Expect(2).Should(BeElementOf(1, 2)) - Expect(3).ShouldNot(BeElementOf(1, 2)) - - Expect("abc").Should(BeElementOf("abc")) - Expect("abc").ShouldNot(BeElementOf("def")) - - Expect("abc").ShouldNot(BeElementOf()) - Expect(7).ShouldNot(BeElementOf(nil)) - - arr := make([]myCustomType, 2) - arr[0] = myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}} - arr[1] = myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "c"}} - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}}).Should(BeElementOf(arr)) - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"b", "c"}}).ShouldNot(BeElementOf(arr)) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should operate succesfully on the passed in value", func() { - var nilSlice []int - Expect(1).ShouldNot(BeElementOf(nilSlice)) - - var nilMap map[int]string - Expect("foo").ShouldNot(BeElementOf(nilMap)) - }) - }) - - Context("when passed an unsupported type", func() { - It("should error", func() { - success, err := (&BeElementOfMatcher{Elements: []interface{}{0}}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeElementOfMatcher{Elements: nil}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - It("builds failure message", func() { - actual := BeElementOf(1, 2).FailureMessage(123) - Expect(actual).To(Equal("Expected\n : 123\nto be an element of\n <[]interface {} | len:2, cap:2>: [1, 2]")) - }) - - It("builds negated failure message", func() { - actual := BeElementOf(1, 2).NegatedFailureMessage(123) - Expect(actual).To(Equal("Expected\n : 123\nnot to be an element of\n <[]interface {} | len:2, cap:2>: [1, 2]")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_empty_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_empty_matcher_test.go deleted file mode 100644 index 132480c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_empty_matcher_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeEmpty", func() { - Context("when passed a supported type", func() { - It("should do the right thing", func() { - Expect("").Should(BeEmpty()) - Expect(" ").ShouldNot(BeEmpty()) - - Expect([0]int{}).Should(BeEmpty()) - Expect([1]int{1}).ShouldNot(BeEmpty()) - - Expect([]int{}).Should(BeEmpty()) - Expect([]int{1}).ShouldNot(BeEmpty()) - - Expect(map[string]int{}).Should(BeEmpty()) - Expect(map[string]int{"a": 1}).ShouldNot(BeEmpty()) - - c := make(chan bool, 1) - Expect(c).Should(BeEmpty()) - c <- true - Expect(c).ShouldNot(BeEmpty()) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should be true", func() { - var nilSlice []int - Expect(nilSlice).Should(BeEmpty()) - - var nilMap map[int]string - Expect(nilMap).Should(BeEmpty()) - }) - }) - - Context("when passed an unsupported type", func() { - It("should error", func() { - success, err := (&BeEmptyMatcher{}).Match(0) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeEmptyMatcher{}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher_test.go deleted file mode 100644 index 4d9d11d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeEquivalentTo", func() { - Context("when asserting that nil is equivalent to nil", func() { - It("should error", func() { - success, err := (&BeEquivalentToMatcher{Expected: nil}).Match(nil) - - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("When asserting on nil", func() { - It("should do the right thing", func() { - Expect("foo").ShouldNot(BeEquivalentTo(nil)) - Expect(nil).ShouldNot(BeEquivalentTo(3)) - Expect([]int{1, 2}).ShouldNot(BeEquivalentTo(nil)) - }) - }) - - Context("When asserting on type aliases", func() { - It("should the right thing", func() { - Expect(StringAlias("foo")).Should(BeEquivalentTo("foo")) - Expect("foo").Should(BeEquivalentTo(StringAlias("foo"))) - Expect(StringAlias("foo")).ShouldNot(BeEquivalentTo("bar")) - Expect("foo").ShouldNot(BeEquivalentTo(StringAlias("bar"))) - }) - }) - - Context("When asserting on numbers", func() { - It("should convert actual to expected and do the right thing", func() { - Expect(5).Should(BeEquivalentTo(5)) - Expect(5.0).Should(BeEquivalentTo(5.0)) - Expect(5).Should(BeEquivalentTo(5.0)) - - Expect(5).ShouldNot(BeEquivalentTo("5")) - Expect(5).ShouldNot(BeEquivalentTo(3)) - - //Here be dragons! - Expect(5.1).Should(BeEquivalentTo(5)) - Expect(5).ShouldNot(BeEquivalentTo(5.1)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_false_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_false_matcher_test.go deleted file mode 100644 index 25e7063..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_false_matcher_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeFalse", func() { - It("should handle true and false correctly", func() { - Expect(true).ShouldNot(BeFalse()) - Expect(false).Should(BeFalse()) - }) - - It("should only support booleans", func() { - success, err := (&BeFalseMatcher{}).Match("foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_identical_to_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_identical_to_test.go deleted file mode 100644 index 7fdd56e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_identical_to_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package matchers_test - -import ( - "errors" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeIdenticalTo", func() { - Context("when asserting that nil equals nil", func() { - It("should error", func() { - success, err := (&BeIdenticalToMatcher{Expected: nil}).Match(nil) - - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - It("should treat the same pointer to a struct as identical", func() { - mySpecialStruct := myCustomType{} - Expect(&mySpecialStruct).Should(BeIdenticalTo(&mySpecialStruct)) - Expect(&myCustomType{}).ShouldNot(BeIdenticalTo(&mySpecialStruct)) - }) - - It("should be strict about types", func() { - Expect(5).ShouldNot(BeIdenticalTo("5")) - Expect(5).ShouldNot(BeIdenticalTo(5.0)) - Expect(5).ShouldNot(BeIdenticalTo(3)) - }) - - It("should treat primtives as identical", func() { - Expect("5").Should(BeIdenticalTo("5")) - Expect("5").ShouldNot(BeIdenticalTo("55")) - - Expect(5.55).Should(BeIdenticalTo(5.55)) - Expect(5.55).ShouldNot(BeIdenticalTo(6.66)) - - Expect(5).Should(BeIdenticalTo(5)) - Expect(5).ShouldNot(BeIdenticalTo(55)) - }) - - It("should treat the same pointers to a slice as identical", func() { - mySlice := []int{1, 2} - Expect(&mySlice).Should(BeIdenticalTo(&mySlice)) - Expect(&mySlice).ShouldNot(BeIdenticalTo(&[]int{1, 2})) - }) - - It("should treat the same pointers to a map as identical", func() { - myMap := map[string]string{"a": "b", "c": "d"} - Expect(&myMap).Should(BeIdenticalTo(&myMap)) - Expect(myMap).ShouldNot(BeIdenticalTo(map[string]string{"a": "b", "c": "d"})) - }) - - It("should treat the same pointers to an error as identical", func() { - myError := errors.New("foo") - Expect(&myError).Should(BeIdenticalTo(&myError)) - Expect(errors.New("foo")).ShouldNot(BeIdenticalTo(errors.New("bar"))) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_nil_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_nil_matcher_test.go deleted file mode 100644 index c35aa3d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_nil_matcher_test.go +++ /dev/null @@ -1,28 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("BeNil", func() { - It("should succeed when passed nil", func() { - Expect(nil).Should(BeNil()) - }) - - It("should succeed when passed a typed nil", func() { - var a []int - Expect(a).Should(BeNil()) - }) - - It("should succeed when passing nil pointer", func() { - var f *struct{} - Expect(f).Should(BeNil()) - }) - - It("should not succeed when not passed nil", func() { - Expect(0).ShouldNot(BeNil()) - Expect(false).ShouldNot(BeNil()) - Expect("").ShouldNot(BeNil()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher_test.go deleted file mode 100644 index a32d2b8..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_numerically_matcher_test.go +++ /dev/null @@ -1,172 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeNumerically", func() { - Context("when passed a number", func() { - It("should support ==", func() { - Expect(uint32(5)).Should(BeNumerically("==", 5)) - Expect(float64(5.0)).Should(BeNumerically("==", 5)) - Expect(int8(5)).Should(BeNumerically("==", 5)) - }) - - It("should not have false positives", func() { - Expect(5.1).ShouldNot(BeNumerically("==", 5)) - Expect(5).ShouldNot(BeNumerically("==", 5.1)) - }) - - It("should support >", func() { - Expect(uint32(5)).Should(BeNumerically(">", 4)) - Expect(float64(5.0)).Should(BeNumerically(">", 4.9)) - Expect(int8(5)).Should(BeNumerically(">", 4)) - - Expect(uint32(5)).ShouldNot(BeNumerically(">", 5)) - Expect(float64(5.0)).ShouldNot(BeNumerically(">", 5.0)) - Expect(int8(5)).ShouldNot(BeNumerically(">", 5)) - }) - - It("should support <", func() { - Expect(uint32(5)).Should(BeNumerically("<", 6)) - Expect(float64(5.0)).Should(BeNumerically("<", 5.1)) - Expect(int8(5)).Should(BeNumerically("<", 6)) - - Expect(uint32(5)).ShouldNot(BeNumerically("<", 5)) - Expect(float64(5.0)).ShouldNot(BeNumerically("<", 5.0)) - Expect(int8(5)).ShouldNot(BeNumerically("<", 5)) - }) - - It("should support >=", func() { - Expect(uint32(5)).Should(BeNumerically(">=", 4)) - Expect(float64(5.0)).Should(BeNumerically(">=", 4.9)) - Expect(int8(5)).Should(BeNumerically(">=", 4)) - - Expect(uint32(5)).Should(BeNumerically(">=", 5)) - Expect(float64(5.0)).Should(BeNumerically(">=", 5.0)) - Expect(int8(5)).Should(BeNumerically(">=", 5)) - - Expect(uint32(5)).ShouldNot(BeNumerically(">=", 6)) - Expect(float64(5.0)).ShouldNot(BeNumerically(">=", 5.1)) - Expect(int8(5)).ShouldNot(BeNumerically(">=", 6)) - }) - - It("should support <=", func() { - Expect(uint32(5)).Should(BeNumerically("<=", 6)) - Expect(float64(5.0)).Should(BeNumerically("<=", 5.1)) - Expect(int8(5)).Should(BeNumerically("<=", 6)) - - Expect(uint32(5)).Should(BeNumerically("<=", 5)) - Expect(float64(5.0)).Should(BeNumerically("<=", 5.0)) - Expect(int8(5)).Should(BeNumerically("<=", 5)) - - Expect(uint32(5)).ShouldNot(BeNumerically("<=", 4)) - Expect(float64(5.0)).ShouldNot(BeNumerically("<=", 4.9)) - Expect(int8(5)).Should(BeNumerically("<=", 5)) - }) - - Context("when passed ~", func() { - Context("when passed a float", func() { - Context("and there is no precision parameter", func() { - It("should default to 1e-8", func() { - Expect(5.00000001).Should(BeNumerically("~", 5.00000002)) - Expect(5.00000001).ShouldNot(BeNumerically("~", 5.0000001)) - }) - - It("should show failure message", func() { - actual := BeNumerically("~", 4.98).FailureMessage(123) - expected := "Expected\n : 123\nto be ~\n : 4.98" - Expect(actual).To(Equal(expected)) - }) - - It("should show negated failure message", func() { - actual := BeNumerically("~", 4.98).NegatedFailureMessage(123) - expected := "Expected\n : 123\nnot to be ~\n : 4.98" - Expect(actual).To(Equal(expected)) - }) - }) - - Context("and there is a precision parameter", func() { - It("should use the precision parameter", func() { - Expect(5.1).Should(BeNumerically("~", 5.19, 0.1)) - Expect(5.1).Should(BeNumerically("~", 5.01, 0.1)) - Expect(5.1).ShouldNot(BeNumerically("~", 5.22, 0.1)) - Expect(5.1).ShouldNot(BeNumerically("~", 4.98, 0.1)) - }) - - It("should show precision in failure message", func() { - actual := BeNumerically("~", 4.98, 0.1).FailureMessage(123) - expected := "Expected\n : 123\nto be within 0.1 of ~\n : 4.98" - Expect(actual).To(Equal(expected)) - }) - - It("should show precision in negated failure message", func() { - actual := BeNumerically("~", 4.98, 0.1).NegatedFailureMessage(123) - expected := "Expected\n : 123\nnot to be within 0.1 of ~\n : 4.98" - Expect(actual).To(Equal(expected)) - }) - }) - }) - - Context("when passed an int/uint", func() { - Context("and there is no precision parameter", func() { - It("should just do strict equality", func() { - Expect(5).Should(BeNumerically("~", 5)) - Expect(5).ShouldNot(BeNumerically("~", 6)) - Expect(uint(5)).ShouldNot(BeNumerically("~", 6)) - }) - }) - - Context("and there is a precision parameter", func() { - It("should use precision paramter", func() { - Expect(5).Should(BeNumerically("~", 6, 2)) - Expect(5).ShouldNot(BeNumerically("~", 8, 2)) - Expect(uint(5)).Should(BeNumerically("~", 6, 1)) - }) - }) - }) - }) - }) - - Context("when passed a non-number", func() { - It("should error", func() { - success, err := (&BeNumericallyMatcher{Comparator: "==", CompareTo: []interface{}{5}}).Match("foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeNumericallyMatcher{Comparator: "=="}).Match(5) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeNumericallyMatcher{Comparator: "~", CompareTo: []interface{}{3.0, "foo"}}).Match(5.0) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeNumericallyMatcher{Comparator: "==", CompareTo: []interface{}{"bar"}}).Match(5) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeNumericallyMatcher{Comparator: "==", CompareTo: []interface{}{"bar"}}).Match("foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeNumericallyMatcher{Comparator: "==", CompareTo: []interface{}{nil}}).Match(0) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeNumericallyMatcher{Comparator: "==", CompareTo: []interface{}{0}}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed an unsupported comparator", func() { - It("should error", func() { - success, err := (&BeNumericallyMatcher{Comparator: "!=", CompareTo: []interface{}{5}}).Match(4) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_sent_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_sent_matcher_test.go deleted file mode 100644 index 68ec728..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_sent_matcher_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package matchers_test - -import ( - "time" - - . "github.com/onsi/gomega/matchers" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("BeSent", func() { - Context("when passed a channel and a matching type", func() { - Context("when the channel is ready to receive", func() { - It("should succeed and send the value down the channel", func() { - c := make(chan string) - d := make(chan string) - go func() { - val := <-c - d <- val - }() - - time.Sleep(10 * time.Millisecond) - - Expect(c).Should(BeSent("foo")) - Eventually(d).Should(Receive(Equal("foo"))) - }) - - It("should succeed (with a buffered channel)", func() { - c := make(chan string, 1) - Expect(c).Should(BeSent("foo")) - Expect(<-c).Should(Equal("foo")) - }) - }) - - Context("when the channel is not ready to receive", func() { - It("should fail and not send down the channel", func() { - c := make(chan string) - Expect(c).ShouldNot(BeSent("foo")) - Consistently(c).ShouldNot(Receive()) - }) - }) - - Context("when the channel is eventually ready to receive", func() { - It("should succeed", func() { - c := make(chan string) - d := make(chan string) - go func() { - time.Sleep(30 * time.Millisecond) - val := <-c - d <- val - }() - - Eventually(c).Should(BeSent("foo")) - Eventually(d).Should(Receive(Equal("foo"))) - }) - }) - - Context("when the channel is closed", func() { - It("should error", func() { - c := make(chan string) - close(c) - success, err := (&BeSentMatcher{Arg: "foo"}).Match(c) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - - It("should short-circuit Eventually", func() { - c := make(chan string) - close(c) - - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(c, 10.0).Should(BeSent("foo")) - }) - Expect(failures).Should(HaveLen(1)) - Expect(time.Since(t)).Should(BeNumerically("<", time.Second)) - }) - }) - }) - - Context("when passed a channel and a non-matching type", func() { - It("should error", func() { - success, err := (&BeSentMatcher{Arg: "foo"}).Match(make(chan int, 1)) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed a receive-only channel", func() { - It("should error", func() { - var c <-chan string - c = make(chan string, 1) - success, err := (&BeSentMatcher{Arg: "foo"}).Match(c) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed a nonchannel", func() { - It("should error", func() { - success, err := (&BeSentMatcher{Arg: "foo"}).Match("bar") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher_test.go deleted file mode 100644 index 95a3a10..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_temporally_matcher_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package matchers_test - -import ( - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeTemporally", func() { - - var t0, t1, t2 time.Time - BeforeEach(func() { - t0 = time.Now() - t1 = t0.Add(time.Second) - t2 = t0.Add(-time.Second) - }) - - Context("When comparing times", func() { - - It("should support ==", func() { - Expect(t0).Should(BeTemporally("==", t0)) - Expect(t1).ShouldNot(BeTemporally("==", t0)) - Expect(t0).ShouldNot(BeTemporally("==", t1)) - Expect(t0).ShouldNot(BeTemporally("==", time.Time{})) - }) - - It("should support >", func() { - Expect(t0).Should(BeTemporally(">", t2)) - Expect(t0).ShouldNot(BeTemporally(">", t0)) - Expect(t2).ShouldNot(BeTemporally(">", t0)) - }) - - It("should support <", func() { - Expect(t0).Should(BeTemporally("<", t1)) - Expect(t0).ShouldNot(BeTemporally("<", t0)) - Expect(t1).ShouldNot(BeTemporally("<", t0)) - }) - - It("should support >=", func() { - Expect(t0).Should(BeTemporally(">=", t2)) - Expect(t0).Should(BeTemporally(">=", t0)) - Expect(t0).ShouldNot(BeTemporally(">=", t1)) - }) - - It("should support <=", func() { - Expect(t0).Should(BeTemporally("<=", t1)) - Expect(t0).Should(BeTemporally("<=", t0)) - Expect(t0).ShouldNot(BeTemporally("<=", t2)) - }) - - Context("when passed ~", func() { - Context("and there is no precision parameter", func() { - BeforeEach(func() { - t1 = t0.Add(time.Millisecond / 2) - t2 = t0.Add(-2 * time.Millisecond) - }) - It("should approximate", func() { - Expect(t0).Should(BeTemporally("~", t0)) - Expect(t0).Should(BeTemporally("~", t1)) - Expect(t0).ShouldNot(BeTemporally("~", t2)) - }) - }) - - Context("and there is a precision parameter", func() { - BeforeEach(func() { - t2 = t0.Add(3 * time.Second) - }) - It("should use precision paramter", func() { - d := 2 * time.Second - Expect(t0).Should(BeTemporally("~", t0, d)) - Expect(t0).Should(BeTemporally("~", t1, d)) - Expect(t0).ShouldNot(BeTemporally("~", t2, d)) - }) - }) - }) - }) - - Context("when passed a non-time", func() { - It("should error", func() { - success, err := (&BeTemporallyMatcher{Comparator: "==", CompareTo: t0}).Match("foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&BeTemporallyMatcher{Comparator: "=="}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed an unsupported comparator", func() { - It("should error", func() { - success, err := (&BeTemporallyMatcher{Comparator: "!=", CompareTo: t0}).Match(t2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_true_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_true_matcher_test.go deleted file mode 100644 index 9eda62c..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_true_matcher_test.go +++ /dev/null @@ -1,20 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("BeTrue", func() { - It("should handle true and false correctly", func() { - Expect(true).Should(BeTrue()) - Expect(false).ShouldNot(BeTrue()) - }) - - It("should only support booleans", func() { - success, err := (&BeTrueMatcher{}).Match("foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go deleted file mode 100644 index c89e103..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("BeZero", func() { - It("succeeds for zero values for its type", func() { - Expect(nil).Should(BeZero()) - - Expect("").Should(BeZero()) - Expect(" ").ShouldNot(BeZero()) - - Expect(0).Should(BeZero()) - Expect(1).ShouldNot(BeZero()) - - Expect(0.0).Should(BeZero()) - Expect(0.1).ShouldNot(BeZero()) - - // Expect([]int{}).Should(BeZero()) - Expect([]int{1}).ShouldNot(BeZero()) - - // Expect(map[string]int{}).Should(BeZero()) - Expect(map[string]int{"a": 1}).ShouldNot(BeZero()) - - Expect(myCustomType{}).Should(BeZero()) - Expect(myCustomType{s: "a"}).ShouldNot(BeZero()) - }) - - It("builds failure message", func() { - actual := BeZero().FailureMessage(123) - Expect(actual).To(Equal("Expected\n : 123\nto be zero-valued")) - }) - - It("builds negated failure message", func() { - actual := BeZero().NegatedFailureMessage(123) - Expect(actual).To(Equal("Expected\n : 123\nnot to be zero-valued")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/consist_of_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/consist_of_test.go deleted file mode 100644 index f6971c4..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/consist_of_test.go +++ /dev/null @@ -1,75 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("ConsistOf", func() { - Context("with a slice", func() { - It("should do the right thing", func() { - Expect([]string{"foo", "bar", "baz"}).Should(ConsistOf("foo", "bar", "baz")) - Expect([]string{"foo", "bar", "baz"}).Should(ConsistOf("foo", "bar", "baz")) - Expect([]string{"foo", "bar", "baz"}).Should(ConsistOf("baz", "bar", "foo")) - Expect([]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("baz", "bar", "foo", "foo")) - Expect([]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("baz", "foo")) - }) - }) - - Context("with an array", func() { - It("should do the right thing", func() { - Expect([3]string{"foo", "bar", "baz"}).Should(ConsistOf("foo", "bar", "baz")) - Expect([3]string{"foo", "bar", "baz"}).Should(ConsistOf("baz", "bar", "foo")) - Expect([3]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("baz", "bar", "foo", "foo")) - Expect([3]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("baz", "foo")) - }) - }) - - Context("with a map", func() { - It("should apply to the values", func() { - Expect(map[int]string{1: "foo", 2: "bar", 3: "baz"}).Should(ConsistOf("foo", "bar", "baz")) - Expect(map[int]string{1: "foo", 2: "bar", 3: "baz"}).Should(ConsistOf("baz", "bar", "foo")) - Expect(map[int]string{1: "foo", 2: "bar", 3: "baz"}).ShouldNot(ConsistOf("baz", "bar", "foo", "foo")) - Expect(map[int]string{1: "foo", 2: "bar", 3: "baz"}).ShouldNot(ConsistOf("baz", "foo")) - }) - - }) - - Context("with anything else", func() { - It("should error", func() { - failures := InterceptGomegaFailures(func() { - Expect("foo").Should(ConsistOf("f", "o", "o")) - }) - - Expect(failures).Should(HaveLen(1)) - }) - }) - - Context("when passed matchers", func() { - It("should pass if the matchers pass", func() { - Expect([]string{"foo", "bar", "baz"}).Should(ConsistOf("foo", MatchRegexp("^ba"), "baz")) - Expect([]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("foo", MatchRegexp("^ba"))) - Expect([]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("foo", MatchRegexp("^ba"), MatchRegexp("foo"))) - Expect([]string{"foo", "bar", "baz"}).Should(ConsistOf("foo", MatchRegexp("^ba"), MatchRegexp("^ba"))) - Expect([]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf("foo", MatchRegexp("^ba"), MatchRegexp("turducken"))) - }) - - It("should not depend on the order of the matchers", func() { - Expect([][]int{{1, 2}, {2}}).Should(ConsistOf(ContainElement(1), ContainElement(2))) - Expect([][]int{{1, 2}, {2}}).Should(ConsistOf(ContainElement(2), ContainElement(1))) - }) - - Context("when a matcher errors", func() { - It("should soldier on", func() { - Expect([]string{"foo", "bar", "baz"}).ShouldNot(ConsistOf(BeFalse(), "foo", "bar")) - Expect([]interface{}{"foo", "bar", false}).Should(ConsistOf(BeFalse(), ContainSubstring("foo"), "bar")) - }) - }) - }) - - Context("when passed exactly one argument, and that argument is a slice", func() { - It("should match against the elements of that argument", func() { - Expect([]string{"foo", "bar", "baz"}).Should(ConsistOf([]string{"foo", "bar", "baz"})) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_element_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_element_matcher_test.go deleted file mode 100644 index 60fb55e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_element_matcher_test.go +++ /dev/null @@ -1,76 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("ContainElement", func() { - Context("when passed a supported type", func() { - Context("and expecting a non-matcher", func() { - It("should do the right thing", func() { - Expect([2]int{1, 2}).Should(ContainElement(2)) - Expect([2]int{1, 2}).ShouldNot(ContainElement(3)) - - Expect([]int{1, 2}).Should(ContainElement(2)) - Expect([]int{1, 2}).ShouldNot(ContainElement(3)) - - Expect(map[string]int{"foo": 1, "bar": 2}).Should(ContainElement(2)) - Expect(map[int]int{3: 1, 4: 2}).ShouldNot(ContainElement(3)) - - arr := make([]myCustomType, 2) - arr[0] = myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}} - arr[1] = myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "c"}} - Expect(arr).Should(ContainElement(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}})) - Expect(arr).ShouldNot(ContainElement(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"b", "c"}})) - }) - }) - - Context("and expecting a matcher", func() { - It("should pass each element through the matcher", func() { - Expect([]int{1, 2, 3}).Should(ContainElement(BeNumerically(">=", 3))) - Expect([]int{1, 2, 3}).ShouldNot(ContainElement(BeNumerically(">", 3))) - Expect(map[string]int{"foo": 1, "bar": 2}).Should(ContainElement(BeNumerically(">=", 2))) - Expect(map[string]int{"foo": 1, "bar": 2}).ShouldNot(ContainElement(BeNumerically(">", 2))) - }) - - It("should power through even if the matcher ever fails", func() { - Expect([]interface{}{1, 2, "3", 4}).Should(ContainElement(BeNumerically(">=", 3))) - }) - - It("should fail if the matcher fails", func() { - actual := []interface{}{1, 2, "3", "4"} - success, err := (&ContainElementMatcher{Element: BeNumerically(">=", 3)}).Match(actual) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should operate succesfully on the passed in value", func() { - var nilSlice []int - Expect(nilSlice).ShouldNot(ContainElement(1)) - - var nilMap map[int]string - Expect(nilMap).ShouldNot(ContainElement("foo")) - }) - }) - - Context("when passed an unsupported type", func() { - It("should error", func() { - success, err := (&ContainElementMatcher{Element: 0}).Match(0) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&ContainElementMatcher{Element: 0}).Match("abc") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&ContainElementMatcher{Element: 0}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher_test.go deleted file mode 100644 index efffb47..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/contain_substring_matcher_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("ContainSubstringMatcher", func() { - Context("when actual is a string", func() { - It("should match against the string", func() { - Expect("Marvelous").Should(ContainSubstring("rve")) - Expect("Marvelous").ShouldNot(ContainSubstring("boo")) - }) - }) - - Context("when the matcher is called with multiple arguments", func() { - It("should pass the string and arguments to sprintf", func() { - Expect("Marvelous3").Should(ContainSubstring("velous%d", 3)) - }) - }) - - Context("when actual is a stringer", func() { - It("should call the stringer and match agains the returned string", func() { - Expect(&myStringer{a: "Abc3"}).Should(ContainSubstring("bc3")) - }) - }) - - Context("when actual is neither a string nor a stringer", func() { - It("should error", func() { - success, err := (&ContainSubstringMatcher{Substr: "2"}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/equal_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/equal_matcher_test.go deleted file mode 100644 index 3ab991e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/equal_matcher_test.go +++ /dev/null @@ -1,80 +0,0 @@ -package matchers_test - -import ( - "errors" - "strings" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("Equal", func() { - Context("when asserting that nil equals nil", func() { - It("should error", func() { - success, err := (&EqualMatcher{Expected: nil}).Match(nil) - - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("When asserting equality between objects", func() { - It("should do the right thing", func() { - Expect(5).Should(Equal(5)) - Expect(5.0).Should(Equal(5.0)) - - Expect(5).ShouldNot(Equal("5")) - Expect(5).ShouldNot(Equal(5.0)) - Expect(5).ShouldNot(Equal(3)) - - Expect("5").Should(Equal("5")) - Expect([]int{1, 2}).Should(Equal([]int{1, 2})) - Expect([]int{1, 2}).ShouldNot(Equal([]int{2, 1})) - Expect([]byte{'f', 'o', 'o'}).Should(Equal([]byte{'f', 'o', 'o'})) - Expect([]byte{'f', 'o', 'o'}).ShouldNot(Equal([]byte{'b', 'a', 'r'})) - Expect(map[string]string{"a": "b", "c": "d"}).Should(Equal(map[string]string{"a": "b", "c": "d"})) - Expect(map[string]string{"a": "b", "c": "d"}).ShouldNot(Equal(map[string]string{"a": "b", "c": "e"})) - Expect(errors.New("foo")).Should(Equal(errors.New("foo"))) - Expect(errors.New("foo")).ShouldNot(Equal(errors.New("bar"))) - - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}}).Should(Equal(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}})) - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}}).ShouldNot(Equal(myCustomType{s: "bar", n: 3, f: 2.0, arr: []string{"a", "b"}})) - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}}).ShouldNot(Equal(myCustomType{s: "foo", n: 2, f: 2.0, arr: []string{"a", "b"}})) - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}}).ShouldNot(Equal(myCustomType{s: "foo", n: 3, f: 3.0, arr: []string{"a", "b"}})) - Expect(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b"}}).ShouldNot(Equal(myCustomType{s: "foo", n: 3, f: 2.0, arr: []string{"a", "b", "c"}})) - }) - }) - - Describe("failure messages", func() { - It("shows the two strings simply when they are short", func() { - subject := EqualMatcher{Expected: "eric"} - - failureMessage := subject.FailureMessage("tim") - Expect(failureMessage).To(BeEquivalentTo(expectedShortStringFailureMessage)) - }) - - It("shows the exact point where two long strings differ", func() { - stringWithB := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - stringWithZ := "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - - subject := EqualMatcher{Expected: stringWithZ} - - failureMessage := subject.FailureMessage(stringWithB) - Expect(failureMessage).To(BeEquivalentTo(expectedLongStringFailureMessage)) - }) - }) -}) - -var expectedShortStringFailureMessage = strings.TrimSpace(` -Expected - : tim -to equal - : eric -`) -var expectedLongStringFailureMessage = strings.TrimSpace(` -Expected - : "...aaaaabaaaaa..." -to equal | - : "...aaaaazaaaaa..." -`) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_cap_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_cap_matcher_test.go deleted file mode 100644 index 8a61f2e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_cap_matcher_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("HaveCap", func() { - Context("when passed a supported type", func() { - It("should do the right thing", func() { - Expect([0]int{}).Should(HaveCap(0)) - Expect([2]int{1}).Should(HaveCap(2)) - - Expect([]int{}).Should(HaveCap(0)) - Expect([]int{1, 2, 3, 4, 5}[:2]).Should(HaveCap(5)) - Expect(make([]int, 0, 5)).Should(HaveCap(5)) - - c := make(chan bool, 3) - Expect(c).Should(HaveCap(3)) - c <- true - c <- true - Expect(c).Should(HaveCap(3)) - - Expect(make(chan bool)).Should(HaveCap(0)) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should operate succesfully on the passed in value", func() { - var nilSlice []int - Expect(nilSlice).Should(HaveCap(0)) - - var nilChan chan int - Expect(nilChan).Should(HaveCap(0)) - }) - }) - - Context("when passed an unsupported type", func() { - It("should error", func() { - success, err := (&HaveCapMatcher{Count: 0}).Match(0) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&HaveCapMatcher{Count: 0}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_matcher_test.go deleted file mode 100644 index 0f1561b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_matcher_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("HaveKey", func() { - var ( - stringKeys map[string]int - intKeys map[int]string - objKeys map[*myCustomType]string - - customA *myCustomType - customB *myCustomType - ) - BeforeEach(func() { - stringKeys = map[string]int{"foo": 2, "bar": 3} - intKeys = map[int]string{2: "foo", 3: "bar"} - - customA = &myCustomType{s: "a", n: 2, f: 2.3, arr: []string{"ice", "cream"}} - customB = &myCustomType{s: "b", n: 4, f: 3.1, arr: []string{"cake"}} - objKeys = map[*myCustomType]string{customA: "aardvark", customB: "kangaroo"} - }) - - Context("when passed a map", func() { - It("should do the right thing", func() { - Expect(stringKeys).Should(HaveKey("foo")) - Expect(stringKeys).ShouldNot(HaveKey("baz")) - - Expect(intKeys).Should(HaveKey(2)) - Expect(intKeys).ShouldNot(HaveKey(4)) - - Expect(objKeys).Should(HaveKey(customA)) - Expect(objKeys).Should(HaveKey(&myCustomType{s: "b", n: 4, f: 3.1, arr: []string{"cake"}})) - Expect(objKeys).ShouldNot(HaveKey(&myCustomType{s: "b", n: 4, f: 3.1, arr: []string{"apple", "pie"}})) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should operate succesfully on the passed in value", func() { - var nilMap map[int]string - Expect(nilMap).ShouldNot(HaveKey("foo")) - }) - }) - - Context("when the passed in key is actually a matcher", func() { - It("should pass each element through the matcher", func() { - Expect(stringKeys).Should(HaveKey(ContainSubstring("oo"))) - Expect(stringKeys).ShouldNot(HaveKey(ContainSubstring("foobar"))) - }) - - It("should fail if the matcher ever fails", func() { - actual := map[int]string{1: "a", 3: "b", 2: "c"} - success, err := (&HaveKeyMatcher{Key: ContainSubstring("ar")}).Match(actual) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed something that is not a map", func() { - It("should error", func() { - success, err := (&HaveKeyMatcher{Key: "foo"}).Match([]string{"foo"}) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&HaveKeyMatcher{Key: "foo"}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher_test.go deleted file mode 100644 index 0a49ec9..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_key_with_value_matcher_test.go +++ /dev/null @@ -1,82 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("HaveKeyWithValue", func() { - var ( - stringKeys map[string]int - intKeys map[int]string - objKeys map[*myCustomType]*myCustomType - - customA *myCustomType - customB *myCustomType - ) - BeforeEach(func() { - stringKeys = map[string]int{"foo": 2, "bar": 3} - intKeys = map[int]string{2: "foo", 3: "bar"} - - customA = &myCustomType{s: "a", n: 2, f: 2.3, arr: []string{"ice", "cream"}} - customB = &myCustomType{s: "b", n: 4, f: 3.1, arr: []string{"cake"}} - objKeys = map[*myCustomType]*myCustomType{customA: customA, customB: customA} - }) - - Context("when passed a map", func() { - It("should do the right thing", func() { - Expect(stringKeys).Should(HaveKeyWithValue("foo", 2)) - Expect(stringKeys).ShouldNot(HaveKeyWithValue("foo", 1)) - Expect(stringKeys).ShouldNot(HaveKeyWithValue("baz", 2)) - Expect(stringKeys).ShouldNot(HaveKeyWithValue("baz", 1)) - - Expect(intKeys).Should(HaveKeyWithValue(2, "foo")) - Expect(intKeys).ShouldNot(HaveKeyWithValue(4, "foo")) - Expect(intKeys).ShouldNot(HaveKeyWithValue(2, "baz")) - - Expect(objKeys).Should(HaveKeyWithValue(customA, customA)) - Expect(objKeys).Should(HaveKeyWithValue(&myCustomType{s: "b", n: 4, f: 3.1, arr: []string{"cake"}}, &myCustomType{s: "a", n: 2, f: 2.3, arr: []string{"ice", "cream"}})) - Expect(objKeys).ShouldNot(HaveKeyWithValue(&myCustomType{s: "b", n: 4, f: 3.1, arr: []string{"apple", "pie"}}, customA)) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should operate succesfully on the passed in value", func() { - var nilMap map[int]string - Expect(nilMap).ShouldNot(HaveKeyWithValue("foo", "bar")) - }) - }) - - Context("when the passed in key or value is actually a matcher", func() { - It("should pass each element through the matcher", func() { - Expect(stringKeys).Should(HaveKeyWithValue(ContainSubstring("oo"), 2)) - Expect(intKeys).Should(HaveKeyWithValue(2, ContainSubstring("oo"))) - Expect(stringKeys).ShouldNot(HaveKeyWithValue(ContainSubstring("foobar"), 2)) - }) - - It("should fail if the matcher ever fails", func() { - actual := map[int]string{1: "a", 3: "b", 2: "c"} - success, err := (&HaveKeyWithValueMatcher{Key: ContainSubstring("ar"), Value: 2}).Match(actual) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - otherActual := map[string]int{"a": 1, "b": 2, "c": 3} - success, err = (&HaveKeyWithValueMatcher{Key: "a", Value: ContainSubstring("1")}).Match(otherActual) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed something that is not a map", func() { - It("should error", func() { - success, err := (&HaveKeyWithValueMatcher{Key: "foo", Value: "bar"}).Match([]string{"foo"}) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&HaveKeyWithValueMatcher{Key: "foo", Value: "bar"}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_len_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_len_matcher_test.go deleted file mode 100644 index c60f638..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_len_matcher_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("HaveLen", func() { - Context("when passed a supported type", func() { - It("should do the right thing", func() { - Expect("").Should(HaveLen(0)) - Expect("AA").Should(HaveLen(2)) - - Expect([0]int{}).Should(HaveLen(0)) - Expect([2]int{1, 2}).Should(HaveLen(2)) - - Expect([]int{}).Should(HaveLen(0)) - Expect([]int{1, 2, 3}).Should(HaveLen(3)) - - Expect(map[string]int{}).Should(HaveLen(0)) - Expect(map[string]int{"a": 1, "b": 2, "c": 3, "d": 4}).Should(HaveLen(4)) - - c := make(chan bool, 3) - Expect(c).Should(HaveLen(0)) - c <- true - c <- true - Expect(c).Should(HaveLen(2)) - }) - }) - - Context("when passed a correctly typed nil", func() { - It("should operate succesfully on the passed in value", func() { - var nilSlice []int - Expect(nilSlice).Should(HaveLen(0)) - - var nilMap map[int]string - Expect(nilMap).Should(HaveLen(0)) - }) - }) - - Context("when passed an unsupported type", func() { - It("should error", func() { - success, err := (&HaveLenMatcher{Count: 0}).Match(0) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&HaveLenMatcher{Count: 0}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher_test.go deleted file mode 100644 index 0ad632e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_occurred_matcher_test.go +++ /dev/null @@ -1,59 +0,0 @@ -package matchers_test - -import ( - "errors" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -type CustomErr struct { - msg string -} - -func (e *CustomErr) Error() string { - return e.msg -} - -var _ = Describe("HaveOccurred", func() { - It("should succeed if matching an error", func() { - Expect(errors.New("Foo")).Should(HaveOccurred()) - }) - - It("should not succeed with nil", func() { - Expect(nil).ShouldNot(HaveOccurred()) - }) - - It("should only support errors and nil", func() { - success, err := (&HaveOccurredMatcher{}).Match("foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&HaveOccurredMatcher{}).Match("") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - - It("doesn't support non-error type", func() { - success, err := (&HaveOccurredMatcher{}).Match(AnyType{}) - Expect(success).Should(BeFalse()) - Expect(err).Should(MatchError("Expected an error-type. Got:\n : {}")) - }) - - It("doesn't support non-error pointer type", func() { - success, err := (&HaveOccurredMatcher{}).Match(&AnyType{}) - Expect(success).Should(BeFalse()) - Expect(err).Should(MatchError(MatchRegexp(`Expected an error-type. Got:\n <*matchers_test.AnyType | 0x[[:xdigit:]]+>: {}`))) - }) - - It("should succeed with pointer types that conform to error interface", func() { - err := &CustomErr{"ohai"} - Expect(err).Should(HaveOccurred()) - }) - - It("should not succeed with nil pointers to types that conform to error interface", func() { - var err *CustomErr = nil - Expect(err).ShouldNot(HaveOccurred()) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_prefix_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_prefix_matcher_test.go deleted file mode 100644 index 5b1f7b6..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_prefix_matcher_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("HavePrefixMatcher", func() { - Context("when actual is a string", func() { - It("should match a string prefix", func() { - Expect("Ab").Should(HavePrefix("A")) - Expect("A").ShouldNot(HavePrefix("Ab")) - }) - }) - - Context("when the matcher is called with multiple arguments", func() { - It("should pass the string and arguments to sprintf", func() { - Expect("C3PO").Should(HavePrefix("C%dP", 3)) - }) - }) - - Context("when actual is a stringer", func() { - It("should call the stringer and match against the returned string", func() { - Expect(&myStringer{a: "Ab"}).Should(HavePrefix("A")) - }) - }) - - Context("when actual is neither a string nor a stringer", func() { - It("should error", func() { - success, err := (&HavePrefixMatcher{Prefix: "2"}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - It("shows failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("foo").To(HavePrefix("bar")) - }) - Expect(failuresMessages[0]).To(Equal("Expected\n : foo\nto have prefix\n : bar")) - }) - - It("shows negated failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("foo").ToNot(HavePrefix("fo")) - }) - Expect(failuresMessages[0]).To(Equal("Expected\n : foo\nnot to have prefix\n : fo")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_suffix_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_suffix_matcher_test.go deleted file mode 100644 index bbdf177..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/have_suffix_matcher_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("HaveSuffixMatcher", func() { - Context("when actual is a string", func() { - It("should match a string suffix", func() { - Expect("Ab").Should(HaveSuffix("b")) - Expect("A").ShouldNot(HaveSuffix("Ab")) - }) - }) - - Context("when the matcher is called with multiple arguments", func() { - It("should pass the string and arguments to sprintf", func() { - Expect("C3PO").Should(HaveSuffix("%dPO", 3)) - }) - }) - - Context("when actual is a stringer", func() { - It("should call the stringer and match against the returned string", func() { - Expect(&myStringer{a: "Ab"}).Should(HaveSuffix("b")) - }) - }) - - Context("when actual is neither a string nor a stringer", func() { - It("should error", func() { - success, err := (&HaveSuffixMatcher{Suffix: "2"}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - It("shows failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("foo").To(HaveSuffix("bar")) - }) - Expect(failuresMessages[0]).To(Equal("Expected\n : foo\nto have suffix\n : bar")) - }) - - It("shows negated failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("foo").ToNot(HaveSuffix("oo")) - }) - Expect(failuresMessages[0]).To(Equal("Expected\n : foo\nnot to have suffix\n : oo")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_error_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_error_matcher_test.go deleted file mode 100644 index 4aba5e0..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_error_matcher_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package matchers_test - -import ( - "errors" - "fmt" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -type CustomError struct { -} - -func (c CustomError) Error() string { - return "an error" -} - -var _ = Describe("MatchErrorMatcher", func() { - Context("When asserting against an error", func() { - It("should succeed when matching with an error", func() { - err := errors.New("an error") - fmtErr := fmt.Errorf("an error") - customErr := CustomError{} - - Expect(err).Should(MatchError(errors.New("an error"))) - Expect(err).ShouldNot(MatchError(errors.New("another error"))) - - Expect(fmtErr).Should(MatchError(errors.New("an error"))) - Expect(customErr).Should(MatchError(CustomError{})) - }) - - It("should succeed when matching with a string", func() { - err := errors.New("an error") - fmtErr := fmt.Errorf("an error") - customErr := CustomError{} - - Expect(err).Should(MatchError("an error")) - Expect(err).ShouldNot(MatchError("another error")) - - Expect(fmtErr).Should(MatchError("an error")) - Expect(customErr).Should(MatchError("an error")) - }) - - Context("when passed a matcher", func() { - It("should pass if the matcher passes against the error string", func() { - err := errors.New("error 123 abc") - - Expect(err).Should(MatchError(MatchRegexp(`\d{3}`))) - }) - - It("should fail if the matcher fails against the error string", func() { - err := errors.New("no digits") - Expect(err).ShouldNot(MatchError(MatchRegexp(`\d`))) - }) - }) - - It("should fail when passed anything else", func() { - actualErr := errors.New("an error") - _, err := (&MatchErrorMatcher{ - Expected: []byte("an error"), - }).Match(actualErr) - Expect(err).Should(HaveOccurred()) - - _, err = (&MatchErrorMatcher{ - Expected: 3, - }).Match(actualErr) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed nil", func() { - It("should fail", func() { - _, err := (&MatchErrorMatcher{ - Expected: "an error", - }).Match(nil) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed a non-error", func() { - It("should fail", func() { - _, err := (&MatchErrorMatcher{ - Expected: "an error", - }).Match("an error") - Expect(err).Should(HaveOccurred()) - - _, err = (&MatchErrorMatcher{ - Expected: "an error", - }).Match(3) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when passed an error that is also a string", func() { - It("should use it as an error", func() { - var e mockErr = "mockErr" - - // this fails if the matcher casts e to a string before comparison - Expect(e).Should(MatchError(e)) - }) - }) - - It("shows failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect(errors.New("foo")).To(MatchError("bar")) - }) - Expect(failuresMessages[0]).To(ContainSubstring("{s: \"foo\"}\nto match error\n : bar")) - }) - - It("shows negated failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect(errors.New("foo")).ToNot(MatchError("foo")) - }) - Expect(failuresMessages[0]).To(ContainSubstring("{s: \"foo\"}\nnot to match error\n : foo")) - }) -}) - -type mockErr string - -func (m mockErr) Error() string { return string(m) } diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_json_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_json_matcher_test.go deleted file mode 100644 index 45a5346..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_json_matcher_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package matchers_test - -import ( - "encoding/json" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("MatchJSONMatcher", func() { - Context("When passed stringifiables", func() { - It("should succeed if the JSON matches", func() { - Expect("{}").Should(MatchJSON("{}")) - Expect(`{"a":1}`).Should(MatchJSON(`{"a":1}`)) - Expect(`{ - "a":1 - }`).Should(MatchJSON(`{"a":1}`)) - Expect(`{"a":1, "b":2}`).Should(MatchJSON(`{"b":2, "a":1}`)) - Expect(`{"a":1}`).ShouldNot(MatchJSON(`{"b":2, "a":1}`)) - - Expect(`{"a":"a", "b":"b"}`).ShouldNot(MatchJSON(`{"a":"a", "b":"b", "c":"c"}`)) - Expect(`{"a":"a", "b":"b", "c":"c"}`).ShouldNot(MatchJSON(`{"a":"a", "b":"b"}`)) - - Expect(`{"a":null, "b":null}`).ShouldNot(MatchJSON(`{"c":"c", "d":"d"}`)) - Expect(`{"a":null, "b":null, "c":null}`).ShouldNot(MatchJSON(`{"a":null, "b":null, "d":null}`)) - }) - - It("should work with byte arrays", func() { - Expect([]byte("{}")).Should(MatchJSON([]byte("{}"))) - Expect("{}").Should(MatchJSON([]byte("{}"))) - Expect([]byte("{}")).Should(MatchJSON("{}")) - }) - - It("should work with json.RawMessage", func() { - Expect([]byte(`{"a": 1}`)).Should(MatchJSON(json.RawMessage(`{"a": 1}`))) - }) - }) - - Context("when a key mismatch is found", func() { - It("reports the first found mismatch", func() { - subject := MatchJSONMatcher{JSONToMatch: `5`} - actual := `7` - subject.Match(actual) - - failureMessage := subject.FailureMessage(`7`) - Expect(failureMessage).ToNot(ContainSubstring("first mismatched key")) - - subject = MatchJSONMatcher{JSONToMatch: `{"a": 1, "b.g": {"c": 2, "1": ["hello", "see ya"]}}`} - actual = `{"a": 1, "b.g": {"c": 2, "1": ["hello", "goodbye"]}}` - subject.Match(actual) - - failureMessage = subject.FailureMessage(actual) - Expect(failureMessage).To(ContainSubstring(`first mismatched key: "b.g"."1"[1]`)) - }) - }) - - Context("when the expected is not valid JSON", func() { - It("should error and explain why", func() { - success, err := (&MatchJSONMatcher{JSONToMatch: `{}`}).Match(`oops`) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("Actual 'oops' should be valid JSON")) - }) - }) - - Context("when the actual is not valid JSON", func() { - It("should error and explain why", func() { - success, err := (&MatchJSONMatcher{JSONToMatch: `oops`}).Match(`{}`) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("Expected 'oops' should be valid JSON")) - }) - }) - - Context("when the expected is neither a string nor a stringer nor a byte array", func() { - It("should error", func() { - success, err := (&MatchJSONMatcher{JSONToMatch: 2}).Match("{}") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchJSONMatcher matcher requires a string, stringer, or []byte. Got expected:\n : 2")) - - success, err = (&MatchJSONMatcher{JSONToMatch: nil}).Match("{}") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchJSONMatcher matcher requires a string, stringer, or []byte. Got expected:\n : nil")) - }) - }) - - Context("when the actual is neither a string nor a stringer nor a byte array", func() { - It("should error", func() { - success, err := (&MatchJSONMatcher{JSONToMatch: "{}"}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchJSONMatcher matcher requires a string, stringer, or []byte. Got actual:\n : 2")) - - success, err = (&MatchJSONMatcher{JSONToMatch: "{}"}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchJSONMatcher matcher requires a string, stringer, or []byte. Got actual:\n : nil")) - }) - }) - - It("shows negated failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("1").ToNot(MatchJSON("1")) - }) - Expect(failuresMessages).To(Equal([]string{"Expected\n : 1\nnot to match JSON of\n : 1"})) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_regexp_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_regexp_matcher_test.go deleted file mode 100644 index f47519e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_regexp_matcher_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("MatchRegexp", func() { - Context("when actual is a string", func() { - It("should match against the string", func() { - Expect(" a2!bla").Should(MatchRegexp(`\d!`)) - Expect(" a2!bla").ShouldNot(MatchRegexp(`[A-Z]`)) - }) - }) - - Context("when actual is a stringer", func() { - It("should call the stringer and match agains the returned string", func() { - Expect(&myStringer{a: "Abc3"}).Should(MatchRegexp(`[A-Z][a-z]+\d`)) - }) - }) - - Context("when the matcher is called with multiple arguments", func() { - It("should pass the string and arguments to sprintf", func() { - Expect(" a23!bla").Should(MatchRegexp(`\d%d!`, 3)) - }) - }) - - Context("when actual is neither a string nor a stringer", func() { - It("should error", func() { - success, err := (&MatchRegexpMatcher{Regexp: `\d`}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when the passed in regexp fails to compile", func() { - It("should error", func() { - success, err := (&MatchRegexpMatcher{Regexp: "("}).Match("Foo") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - It("shows failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("foo").To(MatchRegexp("bar")) - }) - Expect(failuresMessages).To(Equal([]string{"Expected\n : foo\nto match regular expression\n : bar"})) - }) - - It("shows negated failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("foo").ToNot(MatchRegexp("foo")) - }) - Expect(failuresMessages).To(Equal([]string{"Expected\n : foo\nnot to match regular expression\n : foo"})) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_xml_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_xml_matcher_test.go deleted file mode 100644 index 767c0bf..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_xml_matcher_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("MatchXMLMatcher", func() { - - var ( - sample_01 = readFileContents("test_data/xml/sample_01.xml") - sample_02 = readFileContents("test_data/xml/sample_02.xml") - sample_03 = readFileContents("test_data/xml/sample_03.xml") - sample_04 = readFileContents("test_data/xml/sample_04.xml") - sample_05 = readFileContents("test_data/xml/sample_05.xml") - sample_06 = readFileContents("test_data/xml/sample_06.xml") - sample_07 = readFileContents("test_data/xml/sample_07.xml") - sample_08 = readFileContents("test_data/xml/sample_08.xml") - sample_09 = readFileContents("test_data/xml/sample_09.xml") - sample_10 = readFileContents("test_data/xml/sample_10.xml") - sample_11 = readFileContents("test_data/xml/sample_11.xml") - ) - - Context("when passed stringifiables", func() { - It("matches documents regardless of the attribute order", func() { - a := `` - b := `` - Expect(b).Should(MatchXML(a)) - Expect(a).Should(MatchXML(b)) - }) - - It("should succeed if the XML matches", func() { - Expect(sample_01).Should(MatchXML(sample_01)) // same XML - Expect(sample_01).Should(MatchXML(sample_02)) // same XML with blank lines - Expect(sample_01).Should(MatchXML(sample_03)) // same XML with different formatting - Expect(sample_01).ShouldNot(MatchXML(sample_04)) // same structures with different values - Expect(sample_01).ShouldNot(MatchXML(sample_05)) // different structures - Expect(sample_06).ShouldNot(MatchXML(sample_07)) // same xml names with different namespaces - Expect(sample_07).ShouldNot(MatchXML(sample_08)) // same structures with different values - Expect(sample_09).ShouldNot(MatchXML(sample_10)) // same structures with different attribute values - Expect(sample_11).Should(MatchXML(sample_11)) // with non UTF-8 encoding - }) - - It("should work with byte arrays", func() { - Expect([]byte(sample_01)).Should(MatchXML([]byte(sample_01))) - Expect([]byte(sample_01)).Should(MatchXML(sample_01)) - Expect(sample_01).Should(MatchXML([]byte(sample_01))) - }) - }) - - Context("when the expected is not valid XML", func() { - It("should error and explain why", func() { - success, err := (&MatchXMLMatcher{XMLToMatch: sample_01}).Match(`oops`) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("Actual 'oops' should be valid XML")) - }) - }) - - Context("when the actual is not valid XML", func() { - It("should error and explain why", func() { - success, err := (&MatchXMLMatcher{XMLToMatch: `oops`}).Match(sample_01) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("Expected 'oops' should be valid XML")) - }) - }) - - Context("when the expected is neither a string nor a stringer nor a byte array", func() { - It("should error", func() { - success, err := (&MatchXMLMatcher{XMLToMatch: 2}).Match(sample_01) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchXMLMatcher matcher requires a string, stringer, or []byte. Got expected:\n : 2")) - - success, err = (&MatchXMLMatcher{XMLToMatch: nil}).Match(sample_01) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchXMLMatcher matcher requires a string, stringer, or []byte. Got expected:\n : nil")) - }) - }) - - Context("when the actual is neither a string nor a stringer nor a byte array", func() { - It("should error", func() { - success, err := (&MatchXMLMatcher{XMLToMatch: sample_01}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchXMLMatcher matcher requires a string, stringer, or []byte. Got actual:\n : 2")) - - success, err = (&MatchXMLMatcher{XMLToMatch: sample_01}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchXMLMatcher matcher requires a string, stringer, or []byte. Got actual:\n : nil")) - }) - }) - - It("shows failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("").To(MatchXML("")) - }) - Expect(failuresMessages).To(Equal([]string{"Expected\n\nto match XML of\n"})) - }) - - It("shows negated failure message", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect("").ToNot(MatchXML("")) - }) - Expect(failuresMessages).To(Equal([]string{"Expected\n\nnot to match XML of\n"})) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher_test.go deleted file mode 100644 index 1b0044f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/match_yaml_matcher_test.go +++ /dev/null @@ -1,101 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("MatchYAMLMatcher", func() { - Context("When passed stringifiables", func() { - It("should succeed if the YAML matches", func() { - Expect("---").Should(MatchYAML("")) - Expect("a: 1").Should(MatchYAML(`{"a":1}`)) - Expect("a: 1\nb: 2").Should(MatchYAML(`{"b":2, "a":1}`)) - }) - - It("should explain if the YAML does not match when it should", func() { - message := (&MatchYAMLMatcher{YAMLToMatch: "a: 1"}).FailureMessage("b: 2") - Expect(message).To(MatchRegexp(`Expected\s+: b: 2\s+to match YAML of\s+: a: 1`)) - }) - - It("should normalise the expected and actual when explaining if the YAML does not match when it should", func() { - message := (&MatchYAMLMatcher{YAMLToMatch: "a: 'one'"}).FailureMessage("{b: two}") - Expect(message).To(MatchRegexp(`Expected\s+: b: two\s+to match YAML of\s+: a: one`)) - }) - - It("should explain if the YAML matches when it should not", func() { - message := (&MatchYAMLMatcher{YAMLToMatch: "a: 1"}).NegatedFailureMessage("a: 1") - Expect(message).To(MatchRegexp(`Expected\s+: a: 1\s+not to match YAML of\s+: a: 1`)) - }) - - It("should normalise the expected and actual when explaining if the YAML matches when it should not", func() { - message := (&MatchYAMLMatcher{YAMLToMatch: "a: 'one'"}).NegatedFailureMessage("{a: one}") - Expect(message).To(MatchRegexp(`Expected\s+: a: one\s+not to match YAML of\s+: a: one`)) - }) - - It("should fail if the YAML does not match", func() { - Expect("a: 1").ShouldNot(MatchYAML(`{"b":2, "a":1}`)) - }) - - It("should work with byte arrays", func() { - Expect([]byte("a: 1")).Should(MatchYAML([]byte("a: 1"))) - Expect("a: 1").Should(MatchYAML([]byte("a: 1"))) - Expect([]byte("a: 1")).Should(MatchYAML("a: 1")) - }) - }) - - Context("when the expected is not valid YAML", func() { - It("should error and explain why", func() { - success, err := (&MatchYAMLMatcher{YAMLToMatch: ""}).Match("good:\nbad") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("Actual 'good:\nbad' should be valid YAML")) - }) - }) - - Context("when the actual is not valid YAML", func() { - It("should error and explain why", func() { - success, err := (&MatchYAMLMatcher{YAMLToMatch: "good:\nbad"}).Match("") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("Expected 'good:\nbad' should be valid YAML")) - }) - - It("errors when passed directly to Message", func() { - Expect(func() { - matcher := MatchYAMLMatcher{YAMLToMatch: "good"} - matcher.FailureMessage("good:\nbad") - }).To(Panic()) - }) - }) - - Context("when the expected is neither a string nor a stringer nor a byte array", func() { - It("should error", func() { - success, err := (&MatchYAMLMatcher{YAMLToMatch: 2}).Match("") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchYAMLMatcher matcher requires a string, stringer, or []byte. Got expected:\n : 2")) - - success, err = (&MatchYAMLMatcher{YAMLToMatch: nil}).Match("") - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchYAMLMatcher matcher requires a string, stringer, or []byte. Got expected:\n : nil")) - }) - }) - - Context("when the actual is neither a string nor a stringer nor a byte array", func() { - It("should error", func() { - success, err := (&MatchYAMLMatcher{YAMLToMatch: ""}).Match(2) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchYAMLMatcher matcher requires a string, stringer, or []byte. Got actual:\n : 2")) - - success, err = (&MatchYAMLMatcher{YAMLToMatch: ""}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - Expect(err.Error()).Should(ContainSubstring("MatchYAMLMatcher matcher requires a string, stringer, or []byte. Got actual:\n : nil")) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/matcher_tests_suite_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/matcher_tests_suite_test.go deleted file mode 100644 index b5f76c9..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/matcher_tests_suite_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package matchers_test - -import ( - "fmt" - "io/ioutil" - "os" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -type myStringer struct { - a string -} - -func (s *myStringer) String() string { - return s.a -} - -type StringAlias string - -type myCustomType struct { - s string - n int - f float32 - arr []string -} - -func Test(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Gomega Matchers") -} - -func readFileContents(filePath string) []byte { - f := openFile(filePath) - b, err := ioutil.ReadAll(f) - if err != nil { - panic(fmt.Errorf("failed to read file contents: %v", err)) - } - return b -} - -func openFile(filePath string) *os.File { - f, err := os.Open(filePath) - if err != nil { - panic(fmt.Errorf("failed to open file: %v", err)) - } - return f -} diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/not_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/not_test.go deleted file mode 100644 index 06d3ebd..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/not_test.go +++ /dev/null @@ -1,64 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("NotMatcher", func() { - Context("basic examples", func() { - It("works", func() { - Expect(input).To(Not(false1)) - Expect(input).To(Not(Not(true2))) - Expect(input).ToNot(Not(true3)) - Expect(input).ToNot(Not(Not(false1))) - Expect(input).To(Not(Not(Not(false2)))) - }) - - It("fails on error", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect(input).To(Not(Panic())) - }) - Expect(failuresMessages).To(Equal([]string{"PanicMatcher expects a function. Got:\n : hi"})) - }) - }) - - Context("De Morgan's laws", func() { - It("~(A && B) == ~A || ~B", func() { - Expect(input).To(Not(And(false1, false2))) - Expect(input).To(Or(Not(false1), Not(false2))) - }) - It("~(A || B) == ~A && ~B", func() { - Expect(input).To(Not(Or(false1, false2))) - Expect(input).To(And(Not(false1), Not(false2))) - }) - }) - - Context("failure messages are opposite of original matchers' failure messages", func() { - Context("when match fails", func() { - It("gives a descriptive message", func() { - verifyFailureMessage(Not(HaveLen(2)), input, "not to have length 2") - }) - }) - - Context("when match succeeds, but expected it to fail", func() { - It("gives a descriptive message", func() { - verifyFailureMessage(Not(Not(HaveLen(3))), input, "to have length 3") - }) - }) - }) - - Context("MatchMayChangeInTheFuture()", func() { - It("Propagates value from wrapped matcher", func() { - m := Not(Or()) // an empty Or() always returns false, and indicates it cannot change - Expect(m.Match("anything")).To(BeTrue()) - Expect(m.(*NotMatcher).MatchMayChangeInTheFuture("anything")).To(BeFalse()) - }) - It("Defaults to true", func() { - m := Not(Equal(1)) // Equal does not have this method - Expect(m.Match(2)).To(BeTrue()) - Expect(m.(*NotMatcher).MatchMayChangeInTheFuture(2)).To(BeTrue()) // defaults to true - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/or_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/or_test.go deleted file mode 100644 index 1f6dfaf..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/or_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("OrMatcher", func() { - It("works with positive cases", func() { - Expect(input).To(Or(true1)) - Expect(input).To(Or(true1, true2)) - Expect(input).To(Or(true1, false1)) - Expect(input).To(Or(false1, true2)) - Expect(input).To(Or(true1, true2, true3)) - Expect(input).To(Or(true1, true2, false3)) - Expect(input).To(Or(true1, false2, true3)) - Expect(input).To(Or(false1, true2, true3)) - Expect(input).To(Or(true1, false2, false3)) - Expect(input).To(Or(false1, false2, true3)) - - // use alias - Expect(input).To(SatisfyAny(false1, false2, true3)) - }) - - It("stops on errors", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect(input).To(Or(Panic(), true1)) - }) - Expect(failuresMessages).To(Equal([]string{"PanicMatcher expects a function. Got:\n : hi"})) - }) - - It("works with negative cases", func() { - Expect(input).ToNot(Or()) - Expect(input).ToNot(Or(false1)) - Expect(input).ToNot(Or(false1, false2)) - Expect(input).ToNot(Or(false1, false2, false3)) - }) - - Context("failure messages", func() { - Context("when match fails", func() { - It("gives a descriptive message", func() { - verifyFailureMessage(Or(false1, false2), input, - "To satisfy at least one of these matchers: [%!s(*matchers.HaveLenMatcher=&{1}) %!s(*matchers.EqualMatcher=&{hip})]") - }) - }) - - Context("when match succeeds, but expected it to fail", func() { - It("gives a descriptive message", func() { - verifyFailureMessage(Not(Or(true1, true2)), input, `not to have length 2`) - }) - }) - }) - - Context("MatchMayChangeInTheFuture", func() { - Context("Match returned false", func() { - It("returns true if any of the matchers could change", func() { - // 3 matchers, all return false, and all could change - m := Or(BeNil(), Equal("hip"), HaveLen(1)) - Expect(m.Match("hi")).To(BeFalse()) - Expect(m.(*OrMatcher).MatchMayChangeInTheFuture("hi")).To(BeTrue()) // all 3 of these matchers default to 'true' - }) - It("returns false if none of the matchers could change", func() { - // empty Or() has the property of never matching, and never can change since there are no sub-matchers that could change - m := Or() - Expect(m.Match("anything")).To(BeFalse()) - Expect(m.(*OrMatcher).MatchMayChangeInTheFuture("anything")).To(BeFalse()) - - // Or() with 3 sub-matchers that return false, and can't change - m = Or(Or(), Or(), Or()) - Expect(m.Match("hi")).To(BeFalse()) - Expect(m.(*OrMatcher).MatchMayChangeInTheFuture("hi")).To(BeFalse()) // the 3 empty Or()'s won't change - }) - }) - Context("Match returned true", func() { - Context("returns value of the successful matcher", func() { - It("false if successful matcher not going to change", func() { - // 3 matchers: 1st returns false, 2nd returns true and is not going to change, 3rd is never called - m := Or(BeNil(), And(), Equal(1)) - Expect(m.Match("hi")).To(BeTrue()) - Expect(m.(*OrMatcher).MatchMayChangeInTheFuture("hi")).To(BeFalse()) - }) - It("true if successful matcher indicates it might change", func() { - // 3 matchers: 1st returns false, 2nd returns true and "might" change, 3rd is never called - m := Or(Not(BeNil()), Equal("hi"), Equal(1)) - Expect(m.Match("hi")).To(BeTrue()) - Expect(m.(*OrMatcher).MatchMayChangeInTheFuture("hi")).To(BeTrue()) // Equal("hi") indicates it might change - }) - }) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/panic_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/panic_matcher_test.go deleted file mode 100644 index 326bb10..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/panic_matcher_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package matchers_test - -import ( - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("Panic", func() { - Context("when passed something that's not a function that takes zero arguments and returns nothing", func() { - It("should error", func() { - success, err := (&PanicMatcher{}).Match("foo") - Expect(success).To(BeFalse()) - Expect(err).To(HaveOccurred()) - - success, err = (&PanicMatcher{}).Match(nil) - Expect(success).To(BeFalse()) - Expect(err).To(HaveOccurred()) - - success, err = (&PanicMatcher{}).Match(func(foo string) {}) - Expect(success).To(BeFalse()) - Expect(err).To(HaveOccurred()) - - success, err = (&PanicMatcher{}).Match(func() string { return "bar" }) - Expect(success).To(BeFalse()) - Expect(err).To(HaveOccurred()) - }) - }) - - Context("when passed a function of the correct type", func() { - It("should call the function and pass if the function panics", func() { - Expect(func() { panic("ack!") }).To(Panic()) - Expect(func() {}).NotTo(Panic()) - }) - }) - - Context("when assertion fails", func() { - It("prints the object passed to Panic when negative", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect(func() { panic("ack!") }).NotTo(Panic()) - }) - Expect(failuresMessages).To(ConsistOf(ContainSubstring("not to panic, but panicked with\n : ack!"))) - }) - - It("prints simple message when positive", func() { - failuresMessages := InterceptGomegaFailures(func() { - Expect(func() {}).To(Panic()) - }) - Expect(failuresMessages).To(ConsistOf(MatchRegexp("Expected\n\\s+: .+\nto panic"))) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/receive_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/receive_matcher_test.go deleted file mode 100644 index cf04e85..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/receive_matcher_test.go +++ /dev/null @@ -1,304 +0,0 @@ -package matchers_test - -import ( - "time" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -type kungFuActor interface { - DrunkenMaster() bool -} - -type jackie struct { - name string -} - -func (j *jackie) DrunkenMaster() bool { - return true -} - -type someError struct{ s string } - -func (e *someError) Error() string { return e.s } - -var _ = Describe("ReceiveMatcher", func() { - Context("with no argument", func() { - Context("for a buffered channel", func() { - It("should succeed", func() { - channel := make(chan bool, 1) - - Expect(channel).ShouldNot(Receive()) - - channel <- true - - Expect(channel).Should(Receive()) - }) - }) - - Context("for an unbuffered channel", func() { - It("should succeed (eventually)", func() { - channel := make(chan bool) - - Expect(channel).ShouldNot(Receive()) - - go func() { - time.Sleep(10 * time.Millisecond) - channel <- true - }() - - Eventually(channel).Should(Receive()) - }) - }) - }) - - Context("with a pointer argument", func() { - Context("of the correct type", func() { - Context("when the channel has an interface type", func() { - It("should write the value received on the channel to the pointer", func() { - channel := make(chan error, 1) - - var value *someError - - Ω(channel).ShouldNot(Receive(&value)) - Ω(value).Should(BeZero()) - - channel <- &someError{"boooom!"} - - Ω(channel).Should(Receive(&value)) - Ω(value).Should(MatchError("boooom!")) - }) - }) - }) - - Context("of the correct type", func() { - It("should write the value received on the channel to the pointer", func() { - channel := make(chan int, 1) - - var value int - - Expect(channel).ShouldNot(Receive(&value)) - Expect(value).Should(BeZero()) - - channel <- 17 - - Expect(channel).Should(Receive(&value)) - Expect(value).Should(Equal(17)) - }) - }) - - Context("to various types of objects", func() { - It("should work", func() { - //channels of strings - stringChan := make(chan string, 1) - stringChan <- "foo" - - var s string - Expect(stringChan).Should(Receive(&s)) - Expect(s).Should(Equal("foo")) - - //channels of slices - sliceChan := make(chan []bool, 1) - sliceChan <- []bool{true, true, false} - - var sl []bool - Expect(sliceChan).Should(Receive(&sl)) - Expect(sl).Should(Equal([]bool{true, true, false})) - - //channels of channels - chanChan := make(chan chan bool, 1) - c := make(chan bool) - chanChan <- c - - var receivedC chan bool - Expect(chanChan).Should(Receive(&receivedC)) - Expect(receivedC).Should(Equal(c)) - - //channels of interfaces - jackieChan := make(chan kungFuActor, 1) - aJackie := &jackie{name: "Jackie Chan"} - jackieChan <- aJackie - - var theJackie kungFuActor - Expect(jackieChan).Should(Receive(&theJackie)) - Expect(theJackie).Should(Equal(aJackie)) - }) - }) - - Context("of the wrong type", func() { - It("should error", func() { - channel := make(chan int, 1) - channel <- 10 - - var incorrectType bool - - success, err := (&ReceiveMatcher{Arg: &incorrectType}).Match(channel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - var notAPointer int - success, err = (&ReceiveMatcher{Arg: notAPointer}).Match(channel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - }) - - Context("with a matcher", func() { - It("should defer to the underlying matcher", func() { - intChannel := make(chan int, 1) - intChannel <- 3 - Expect(intChannel).Should(Receive(Equal(3))) - - intChannel <- 2 - Expect(intChannel).ShouldNot(Receive(Equal(3))) - - stringChannel := make(chan []string, 1) - stringChannel <- []string{"foo", "bar", "baz"} - Expect(stringChannel).Should(Receive(ContainElement(ContainSubstring("fo")))) - - stringChannel <- []string{"foo", "bar", "baz"} - Expect(stringChannel).ShouldNot(Receive(ContainElement(ContainSubstring("archipelago")))) - }) - - It("should defer to the underlying matcher for the message", func() { - matcher := Receive(Equal(3)) - channel := make(chan int, 1) - channel <- 2 - matcher.Match(channel) - Expect(matcher.FailureMessage(channel)).Should(MatchRegexp(`Expected\s+: 2\s+to equal\s+: 3`)) - - channel <- 3 - matcher.Match(channel) - Expect(matcher.NegatedFailureMessage(channel)).Should(MatchRegexp(`Expected\s+: 3\s+not to equal\s+: 3`)) - }) - - It("should work just fine with Eventually", func() { - stringChannel := make(chan string) - - go func() { - time.Sleep(5 * time.Millisecond) - stringChannel <- "A" - time.Sleep(5 * time.Millisecond) - stringChannel <- "B" - }() - - Eventually(stringChannel).Should(Receive(Equal("B"))) - }) - - Context("if the matcher errors", func() { - It("should error", func() { - channel := make(chan int, 1) - channel <- 3 - success, err := (&ReceiveMatcher{Arg: ContainSubstring("three")}).Match(channel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("if nothing is received", func() { - It("should fail", func() { - channel := make(chan int, 1) - success, err := (&ReceiveMatcher{Arg: Equal(1)}).Match(channel) - Expect(success).Should(BeFalse()) - Expect(err).ShouldNot(HaveOccurred()) - }) - }) - }) - - Context("When actual is a *closed* channel", func() { - Context("for a buffered channel", func() { - It("should work until it hits the end of the buffer", func() { - channel := make(chan bool, 1) - channel <- true - - close(channel) - - Expect(channel).Should(Receive()) - Expect(channel).ShouldNot(Receive()) - }) - }) - - Context("for an unbuffered channel", func() { - It("should always fail", func() { - channel := make(chan bool) - close(channel) - - Expect(channel).ShouldNot(Receive()) - }) - }) - }) - - Context("When actual is a send-only channel", func() { - It("should error", func() { - channel := make(chan bool) - - var writerChannel chan<- bool - writerChannel = channel - - success, err := (&ReceiveMatcher{}).Match(writerChannel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Context("when acutal is a non-channel", func() { - It("should error", func() { - var nilChannel chan bool - - success, err := (&ReceiveMatcher{}).Match(nilChannel) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&ReceiveMatcher{}).Match(nil) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - - success, err = (&ReceiveMatcher{}).Match(3) - Expect(success).Should(BeFalse()) - Expect(err).Should(HaveOccurred()) - }) - }) - - Describe("when used with eventually and a custom matcher", func() { - It("should return the matcher's error when a failing value is received on the channel, instead of the must receive something failure", func() { - failures := InterceptGomegaFailures(func() { - c := make(chan string, 0) - Eventually(c, 0.01).Should(Receive(Equal("hello"))) - }) - Expect(failures[0]).Should(ContainSubstring("When passed a matcher, ReceiveMatcher's channel *must* receive something.")) - - failures = InterceptGomegaFailures(func() { - c := make(chan string, 1) - c <- "hi" - Eventually(c, 0.01).Should(Receive(Equal("hello"))) - }) - Expect(failures[0]).Should(ContainSubstring(": hello")) - }) - }) - - Describe("Bailing early", func() { - It("should bail early when passed a closed channel", func() { - c := make(chan bool) - close(c) - - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(c).Should(Receive()) - }) - Expect(time.Since(t)).Should(BeNumerically("<", 500*time.Millisecond)) - Expect(failures).Should(HaveLen(1)) - }) - - It("should bail early when passed a non-channel", func() { - t := time.Now() - failures := InterceptGomegaFailures(func() { - Eventually(3).Should(Receive()) - }) - Expect(time.Since(t)).Should(BeNumerically("<", 500*time.Millisecond)) - Expect(failures).Should(HaveLen(1)) - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/succeed_matcher_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/succeed_matcher_test.go deleted file mode 100644 index e42dd8a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/succeed_matcher_test.go +++ /dev/null @@ -1,72 +0,0 @@ -package matchers_test - -import ( - "errors" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" - "regexp" -) - -func Erroring() error { - return errors.New("bam") -} - -func NotErroring() error { - return nil -} - -type AnyType struct{} - -func Invalid() *AnyType { - return nil -} - -var _ = Describe("Succeed", func() { - It("should succeed if the function succeeds", func() { - Expect(NotErroring()).Should(Succeed()) - }) - - It("should succeed (in the negated) if the function errored", func() { - Expect(Erroring()).ShouldNot(Succeed()) - }) - - It("should not if passed a non-error", func() { - success, err := (&SucceedMatcher{}).Match(Invalid()) - Expect(success).Should(BeFalse()) - Expect(err).Should(MatchError("Expected an error-type. Got:\n <*matchers_test.AnyType | 0x0>: nil")) - }) - - It("doesn't support non-error type", func() { - success, err := (&SucceedMatcher{}).Match(AnyType{}) - Expect(success).Should(BeFalse()) - Expect(err).Should(MatchError("Expected an error-type. Got:\n : {}")) - }) - - It("doesn't support non-error pointer type", func() { - success, err := (&SucceedMatcher{}).Match(&AnyType{}) - Expect(success).Should(BeFalse()) - Expect(err).Should(MatchError(MatchRegexp(`Expected an error-type. Got:\n <*matchers_test.AnyType | 0x[[:xdigit:]]+>: {}`))) - }) - - It("should not succeed with pointer types that conform to error interface", func() { - err := &CustomErr{"ohai"} - Expect(err).ShouldNot(Succeed()) - }) - - It("should succeed with nil pointers to types that conform to error interface", func() { - var err *CustomErr = nil - Expect(err).Should(Succeed()) - }) - - It("builds failure message", func() { - actual := Succeed().FailureMessage(errors.New("oops")) - actual = regexp.MustCompile(" 0x.*>").ReplaceAllString(actual, " 0x00000000>") - Expect(actual).To(Equal("Expected success, but got an error:\n <*errors.errorString | 0x00000000>: {s: \"oops\"}\n oops")) - }) - - It("builds negated failure message", func() { - actual := Succeed().NegatedFailureMessage(123) - Expect(actual).To(Equal("Expected failure, but got no error.")) - }) -}) diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE deleted file mode 100644 index 8edd817..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/support/goraph/MIT.LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Amit Kumar Gupta - -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 --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_01.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_01.xml deleted file mode 100644 index 90f0a1b..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_01.xml +++ /dev/null @@ -1,6 +0,0 @@ - - Tove - Jani - Reminder - Don't forget me this weekend! - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_02.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_02.xml deleted file mode 100644 index 3863b83..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_02.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - Tove - Jani - Reminder - Don't forget me this weekend! - - diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_03.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_03.xml deleted file mode 100644 index a491c21..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_03.xml +++ /dev/null @@ -1 +0,0 @@ - Tove Jani Reminder Don't forget me this weekend! diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_04.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_04.xml deleted file mode 100644 index dcfd3db..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_04.xml +++ /dev/null @@ -1,6 +0,0 @@ - - Tove - John - Doe - Don't forget me this weekend! - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_05.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_05.xml deleted file mode 100644 index de15a6a..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_05.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - Empire Burlesque - Bob Dylan - USA - Columbia - 10.90 - 1985 - - - Hide your heart - Bonnie Tyler - UK - CBS Records - 9.90 - 1988 - - - Greatest Hits - Dolly Parton - USA - RCA - 9.90 - 1982 - - - Still got the blues - Gary Moore - UK - Virgin records - 10.20 - 1990 - - - Eros - Eros Ramazzotti - EU - BMG - 9.90 - 1997 - - - One night only - Bee Gees - UK - Polydor - 10.90 - 1998 - - - Sylvias Mother - Dr.Hook - UK - CBS - 8.10 - 1973 - - - Maggie May - Rod Stewart - UK - Pickwick - 8.50 - 1990 - - - Romanza - Andrea Bocelli - EU - Polydor - 10.80 - 1996 - - - When a man loves a woman - Percy Sledge - USA - Atlantic - 8.70 - 1987 - - - Black angel - Savage Rose - EU - Mega - 10.90 - 1995 - - - 1999 Grammy Nominees - Many - USA - Grammy - 10.20 - 1999 - - - For the good times - Kenny Rogers - UK - Mucik Master - 8.70 - 1995 - - - Big Willie style - Will Smith - USA - Columbia - 9.90 - 1997 - - - Tupelo Honey - Van Morrison - UK - Polydor - 8.20 - 1971 - - - Soulsville - Jorn Hoel - Norway - WEA - 7.90 - 1996 - - - The very best of - Cat Stevens - UK - Island - 8.90 - 1990 - - - Stop - Sam Brown - UK - A and M - 8.90 - 1988 - - - Bridge of Spies - T'Pau - UK - Siren - 7.90 - 1987 - - - Private Dancer - Tina Turner - UK - Capitol - 8.90 - 1983 - - - Midt om natten - Kim Larsen - EU - Medley - 7.80 - 1983 - - - Pavarotti Gala Concert - Luciano Pavarotti - UK - DECCA - 9.90 - 1991 - - - The dock of the bay - Otis Redding - USA - Stax Records - 7.90 - 1968 - - - Picture book - Simply Red - EU - Elektra - 7.20 - 1985 - - - Red - The Communards - UK - London - 7.80 - 1987 - - - Unchain my heart - Joe Cocker - USA - EMI - 8.20 - 1987 - - diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_06.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_06.xml deleted file mode 100644 index 4ba90fb..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_06.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - -
ApplesBananas
- - African Coffee Table - 80 - 120 -
-
\ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_07.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_07.xml deleted file mode 100644 index 34b9e97..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_07.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Apples - Bananas - - - - African Coffee Table - 80 - 120 - - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_08.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_08.xml deleted file mode 100644 index ccaee4e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_08.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Apples - Oranges - - - - African Coffee Table - 80 - 120 - - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_09.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_09.xml deleted file mode 100644 index 531f84d..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_09.xml +++ /dev/null @@ -1,4 +0,0 @@ - - Foo - Bar - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_10.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_10.xml deleted file mode 100644 index b1e1e1f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_10.xml +++ /dev/null @@ -1,4 +0,0 @@ - - Foo - Bar - \ No newline at end of file diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_11.xml b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_11.xml deleted file mode 100644 index 3132b0f..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/test_data/xml/sample_11.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Tove - Jani - Reminder - Don't forget me this weekend! - diff --git a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/with_transform_test.go b/src/imagemagick/vendor/github.com/onsi/gomega/matchers/with_transform_test.go deleted file mode 100644 index e52bf8e..0000000 --- a/src/imagemagick/vendor/github.com/onsi/gomega/matchers/with_transform_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package matchers_test - -import ( - "errors" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - . "github.com/onsi/gomega/matchers" -) - -var _ = Describe("WithTransformMatcher", func() { - - var plus1 = func(i int) int { return i + 1 } - - Context("Panic if transform function invalid", func() { - panicsWithTransformer := func(transform interface{}) { - ExpectWithOffset(1, func() { WithTransform(transform, nil) }).To(Panic()) - } - It("nil", func() { - panicsWithTransformer(nil) - }) - Context("Invalid number of args, but correct return value count", func() { - It("zero", func() { - panicsWithTransformer(func() int { return 5 }) - }) - It("two", func() { - panicsWithTransformer(func(i, j int) int { return 5 }) - }) - }) - Context("Invalid number of return values, but correct number of arguments", func() { - It("zero", func() { - panicsWithTransformer(func(i int) {}) - }) - It("two", func() { - panicsWithTransformer(func(i int) (int, int) { return 5, 6 }) - }) - }) - }) - - It("works with positive cases", func() { - Expect(1).To(WithTransform(plus1, Equal(2))) - Expect(1).To(WithTransform(plus1, WithTransform(plus1, Equal(3)))) - Expect(1).To(WithTransform(plus1, And(Equal(2), BeNumerically(">", 1)))) - - // transform expects custom type - type S struct { - A int - B string - } - transformer := func(s S) string { return s.B } - Expect(S{1, "hi"}).To(WithTransform(transformer, Equal("hi"))) - - // transform expects interface - errString := func(e error) string { return e.Error() } - Expect(errors.New("abc")).To(WithTransform(errString, Equal("abc"))) - }) - - It("works with negative cases", func() { - Expect(1).ToNot(WithTransform(plus1, Equal(3))) - Expect(1).ToNot(WithTransform(plus1, WithTransform(plus1, Equal(2)))) - }) - - Context("failure messages", func() { - Context("when match fails", func() { - It("gives a descriptive message", func() { - m := WithTransform(plus1, Equal(3)) - Expect(m.Match(1)).To(BeFalse()) - Expect(m.FailureMessage(1)).To(Equal("Expected\n : 2\nto equal\n : 3")) - }) - }) - - Context("when match succeeds, but expected it to fail", func() { - It("gives a descriptive message", func() { - m := Not(WithTransform(plus1, Equal(3))) - Expect(m.Match(2)).To(BeFalse()) - Expect(m.FailureMessage(2)).To(Equal("Expected\n : 3\nnot to equal\n : 3")) - }) - }) - - Context("actual value is incompatible with transform function's argument type", func() { - It("gracefully fails if transform cannot be performed", func() { - m := WithTransform(plus1, Equal(3)) - result, err := m.Match("hi") // give it a string but transform expects int; doesn't panic - Expect(result).To(BeFalse()) - Expect(err).To(MatchError("Transform function expects 'int' but we have 'string'")) - }) - }) - }) - - Context("MatchMayChangeInTheFuture()", func() { - It("Propagates value from wrapped matcher on the transformed value", func() { - m := WithTransform(plus1, Or()) // empty Or() always returns false, and indicates it cannot change - Expect(m.Match(1)).To(BeFalse()) - Expect(m.(*WithTransformMatcher).MatchMayChangeInTheFuture(1)).To(BeFalse()) // empty Or() indicates cannot change - }) - It("Defaults to true", func() { - m := WithTransform(plus1, Equal(2)) // Equal does not have this method - Expect(m.Match(1)).To(BeTrue()) - Expect(m.(*WithTransformMatcher).MatchMayChangeInTheFuture(1)).To(BeTrue()) // defaults to true - }) - }) -}) diff --git a/src/imagemagick/vendor/github.com/tidwall/gjson/gjson_ngae.go b/src/imagemagick/vendor/github.com/tidwall/gjson/gjson_ngae.go deleted file mode 100644 index bc608b5..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/gjson/gjson_ngae.go +++ /dev/null @@ -1,81 +0,0 @@ -//+build !appengine -//+build !js - -package gjson - -import ( - "reflect" - "unsafe" -) - -// getBytes casts the input json bytes to a string and safely returns the -// results as uniquely allocated data. This operation is intended to minimize -// copies and allocations for the large json string->[]byte. -func getBytes(json []byte, path string) Result { - var result Result - if json != nil { - // unsafe cast to string - result = Get(*(*string)(unsafe.Pointer(&json)), path) - // safely get the string headers - rawhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Raw)) - strhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Str)) - // create byte slice headers - rawh := reflect.SliceHeader{Data: rawhi.Data, Len: rawhi.Len} - strh := reflect.SliceHeader{Data: strhi.Data, Len: strhi.Len} - if strh.Data == 0 { - // str is nil - if rawh.Data == 0 { - // raw is nil - result.Raw = "" - } else { - // raw has data, safely copy the slice header to a string - result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) - } - result.Str = "" - } else if rawh.Data == 0 { - // raw is nil - result.Raw = "" - // str has data, safely copy the slice header to a string - result.Str = string(*(*[]byte)(unsafe.Pointer(&strh))) - } else if strh.Data >= rawh.Data && - int(strh.Data)+strh.Len <= int(rawh.Data)+rawh.Len { - // Str is a substring of Raw. - start := int(strh.Data - rawh.Data) - // safely copy the raw slice header - result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) - // substring the raw - result.Str = result.Raw[start : start+strh.Len] - } else { - // safely copy both the raw and str slice headers to strings - result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) - result.Str = string(*(*[]byte)(unsafe.Pointer(&strh))) - } - } - return result -} - -// fillIndex finds the position of Raw data and assigns it to the Index field -// of the resulting value. If the position cannot be found then Index zero is -// used instead. -func fillIndex(json string, c *parseContext) { - if len(c.value.Raw) > 0 && !c.calcd { - jhdr := *(*reflect.StringHeader)(unsafe.Pointer(&json)) - rhdr := *(*reflect.StringHeader)(unsafe.Pointer(&(c.value.Raw))) - c.value.Index = int(rhdr.Data - jhdr.Data) - if c.value.Index < 0 || c.value.Index >= len(json) { - c.value.Index = 0 - } - } -} - -func stringBytes(s string) []byte { - return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ - Data: (*reflect.StringHeader)(unsafe.Pointer(&s)).Data, - Len: len(s), - Cap: len(s), - })) -} - -func bytesString(b []byte) string { - return *(*string)(unsafe.Pointer(&b)) -} diff --git a/src/imagemagick/vendor/github.com/tidwall/gjson/gjson_test.go b/src/imagemagick/vendor/github.com/tidwall/gjson/gjson_test.go deleted file mode 100644 index 4190279..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/gjson/gjson_test.go +++ /dev/null @@ -1,1506 +0,0 @@ -package gjson - -import ( - "bytes" - "encoding/hex" - "encoding/json" - "fmt" - "math/rand" - "reflect" - "strconv" - "strings" - "testing" - "time" - - "github.com/tidwall/pretty" -) - -// TestRandomData is a fuzzing test that throws random data at the Parse -// function looking for panics. -func TestRandomData(t *testing.T) { - var lstr string - defer func() { - if v := recover(); v != nil { - println("'" + hex.EncodeToString([]byte(lstr)) + "'") - println("'" + lstr + "'") - panic(v) - } - }() - rand.Seed(time.Now().UnixNano()) - b := make([]byte, 200) - for i := 0; i < 2000000; i++ { - n, err := rand.Read(b[:rand.Int()%len(b)]) - if err != nil { - t.Fatal(err) - } - lstr = string(b[:n]) - GetBytes([]byte(lstr), "zzzz") - Parse(lstr) - } -} - -func TestRandomValidStrings(t *testing.T) { - rand.Seed(time.Now().UnixNano()) - b := make([]byte, 200) - for i := 0; i < 100000; i++ { - n, err := rand.Read(b[:rand.Int()%len(b)]) - if err != nil { - t.Fatal(err) - } - sm, err := json.Marshal(string(b[:n])) - if err != nil { - t.Fatal(err) - } - var su string - if err := json.Unmarshal([]byte(sm), &su); err != nil { - t.Fatal(err) - } - token := Get(`{"str":`+string(sm)+`}`, "str") - if token.Type != String || token.Str != su { - println("["+token.Raw+"]", "["+token.Str+"]", "["+su+"]", "["+string(sm)+"]") - t.Fatal("string mismatch") - } - } -} - -func TestEmoji(t *testing.T) { - const input = `{"utf8":"Example emoji, KO: \ud83d\udd13, \ud83c\udfc3 OK: \u2764\ufe0f "}` - value := Get(input, "utf8") - var s string - json.Unmarshal([]byte(value.Raw), &s) - if value.String() != s { - t.Fatalf("expected '%v', got '%v'", s, value.String()) - } -} - -func testEscapePath(t *testing.T, json, path, expect string) { - if Get(json, path).String() != expect { - t.Fatalf("expected '%v', got '%v'", expect, Get(json, path).String()) - } -} - -func TestEscapePath(t *testing.T) { - json := `{ - "test":{ - "*":"valZ", - "*v":"val0", - "keyv*":"val1", - "key*v":"val2", - "keyv?":"val3", - "key?v":"val4", - "keyv.":"val5", - "key.v":"val6", - "keyk*":{"key?":"val7"} - } - }` - - testEscapePath(t, json, "test.\\*", "valZ") - testEscapePath(t, json, "test.\\*v", "val0") - testEscapePath(t, json, "test.keyv\\*", "val1") - testEscapePath(t, json, "test.key\\*v", "val2") - testEscapePath(t, json, "test.keyv\\?", "val3") - testEscapePath(t, json, "test.key\\?v", "val4") - testEscapePath(t, json, "test.keyv\\.", "val5") - testEscapePath(t, json, "test.key\\.v", "val6") - testEscapePath(t, json, "test.keyk\\*.key\\?", "val7") -} - -// this json block is poorly formed on purpose. -var basicJSON = `{"age":100, "name":{"here":"B\\\"R"}, - "noop":{"what is a wren?":"a bird"}, - "happy":true,"immortal":false, - "items":[1,2,3,{"tags":[1,2,3],"points":[[1,2],[3,4]]},4,5,6,7], - "arr":["1",2,"3",{"hello":"world"},"4",5], - "vals":[1,2,3,{"sadf":sdf"asdf"}],"name":{"first":"tom","last":null}, - "created":"2014-05-16T08:28:06.989Z", - "loggy":{ - "programmers": [ - { - "firstName": "Brett", - "lastName": "McLaughlin", - "email": "aaaa", - "tag": "good" - }, - { - "firstName": "Jason", - "lastName": "Hunter", - "email": "bbbb", - "tag": "bad" - }, - { - "firstName": "Elliotte", - "lastName": "Harold", - "email": "cccc", - "tag":, "good" - }, - { - "firstName": 1002.3, - "age": 101 - } - ] - }, - "lastly":{"yay":"final"} -}` -var basicJSONB = []byte(basicJSON) - -func TestTimeResult(t *testing.T) { - assert(t, Get(basicJSON, "created").String() == Get(basicJSON, "created").Time().Format(time.RFC3339Nano)) -} - -func TestParseAny(t *testing.T) { - assert(t, Parse("100").Float() == 100) - assert(t, Parse("true").Bool()) - assert(t, Parse("false").Bool() == false) -} - -func TestManyVariousPathCounts(t *testing.T) { - json := `{"a":"a","b":"b","c":"c"}` - counts := []int{3, 4, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 129, 255, 256, 257, 511, 512, 513} - paths := []string{"a", "b", "c"} - expects := []string{"a", "b", "c"} - for _, count := range counts { - var gpaths []string - var gexpects []string - for i := 0; i < count; i++ { - if i < len(paths) { - gpaths = append(gpaths, paths[i]) - gexpects = append(gexpects, expects[i]) - } else { - gpaths = append(gpaths, fmt.Sprintf("not%d", i)) - gexpects = append(gexpects, "null") - } - } - results := GetMany(json, gpaths...) - for i := 0; i < len(paths); i++ { - if results[i].String() != expects[i] { - t.Fatalf("expected '%v', got '%v'", expects[i], results[i].String()) - } - } - } -} -func TestManyRecursion(t *testing.T) { - var json string - var path string - for i := 0; i < 100; i++ { - json += `{"a":` - path += ".a" - } - json += `"b"` - for i := 0; i < 100; i++ { - json += `}` - } - path = path[1:] - assert(t, GetMany(json, path)[0].String() == "b") -} -func TestByteSafety(t *testing.T) { - jsonb := []byte(`{"name":"Janet","age":38}`) - mtok := GetBytes(jsonb, "name") - if mtok.String() != "Janet" { - t.Fatalf("expected %v, got %v", "Jason", mtok.String()) - } - mtok2 := GetBytes(jsonb, "age") - if mtok2.Raw != "38" { - t.Fatalf("expected %v, got %v", "Jason", mtok2.Raw) - } - jsonb[9] = 'T' - jsonb[12] = 'd' - jsonb[13] = 'y' - if mtok.String() != "Janet" { - t.Fatalf("expected %v, got %v", "Jason", mtok.String()) - } -} - -func get(json, path string) Result { - return GetBytes([]byte(json), path) -} - -func TestBasic(t *testing.T) { - var mtok Result - mtok = get(basicJSON, `loggy.programmers.#[tag="good"].firstName`) - if mtok.String() != "Brett" { - t.Fatalf("expected %v, got %v", "Brett", mtok.String()) - } - mtok = get(basicJSON, `loggy.programmers.#[tag="good"]#.firstName`) - if mtok.String() != `["Brett","Elliotte"]` { - t.Fatalf("expected %v, got %v", `["Brett","Elliotte"]`, mtok.String()) - } -} - -func TestIsArrayIsObject(t *testing.T) { - mtok := get(basicJSON, "loggy") - assert(t, mtok.IsObject()) - assert(t, !mtok.IsArray()) - - mtok = get(basicJSON, "loggy.programmers") - assert(t, !mtok.IsObject()) - assert(t, mtok.IsArray()) - - mtok = get(basicJSON, `loggy.programmers.#[tag="good"]#.firstName`) - assert(t, mtok.IsArray()) - - mtok = get(basicJSON, `loggy.programmers.0.firstName`) - assert(t, !mtok.IsObject()) - assert(t, !mtok.IsArray()) -} - -func TestPlus53BitInts(t *testing.T) { - json := `{"IdentityData":{"GameInstanceId":634866135153775564}}` - value := Get(json, "IdentityData.GameInstanceId") - assert(t, value.Uint() == 634866135153775564) - assert(t, value.Int() == 634866135153775564) - assert(t, value.Float() == 634866135153775616) - - json = `{"IdentityData":{"GameInstanceId":634866135153775564.88172}}` - value = Get(json, "IdentityData.GameInstanceId") - assert(t, value.Uint() == 634866135153775616) - assert(t, value.Int() == 634866135153775616) - assert(t, value.Float() == 634866135153775616.88172) - - json = `{ - "min_uint64": 0, - "max_uint64": 18446744073709551615, - "overflow_uint64": 18446744073709551616, - "min_int64": -9223372036854775808, - "max_int64": 9223372036854775807, - "overflow_int64": 9223372036854775808, - "min_uint53": 0, - "max_uint53": 4503599627370495, - "overflow_uint53": 4503599627370496, - "min_int53": -2251799813685248, - "max_int53": 2251799813685247, - "overflow_int53": 2251799813685248 - }` - - assert(t, Get(json, "min_uint53").Uint() == 0) - assert(t, Get(json, "max_uint53").Uint() == 4503599627370495) - assert(t, Get(json, "overflow_uint53").Int() == 4503599627370496) - assert(t, Get(json, "min_int53").Int() == -2251799813685248) - assert(t, Get(json, "max_int53").Int() == 2251799813685247) - assert(t, Get(json, "overflow_int53").Int() == 2251799813685248) - assert(t, Get(json, "min_uint64").Uint() == 0) - assert(t, Get(json, "max_uint64").Uint() == 18446744073709551615) - // this next value overflows the max uint64 by one which will just - // flip the number to zero - assert(t, Get(json, "overflow_uint64").Int() == 0) - assert(t, Get(json, "min_int64").Int() == -9223372036854775808) - assert(t, Get(json, "max_int64").Int() == 9223372036854775807) - // this next value overflows the max int64 by one which will just - // flip the number to the negative sign. - assert(t, Get(json, "overflow_int64").Int() == -9223372036854775808) -} -func TestIssue38(t *testing.T) { - // These should not fail, even though the unicode is invalid. - Get(`["S3O PEDRO DO BUTI\udf93"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93asdf"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93\u"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93\u1"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93\u13"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93\u134"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93\u1345"]`, "0") - Get(`["S3O PEDRO DO BUTI\udf93\u1345asd"]`, "0") -} -func TestTypes(t *testing.T) { - assert(t, (Result{Type: String}).Type.String() == "String") - assert(t, (Result{Type: Number}).Type.String() == "Number") - assert(t, (Result{Type: Null}).Type.String() == "Null") - assert(t, (Result{Type: False}).Type.String() == "False") - assert(t, (Result{Type: True}).Type.String() == "True") - assert(t, (Result{Type: JSON}).Type.String() == "JSON") - assert(t, (Result{Type: 100}).Type.String() == "") - // bool - assert(t, (Result{Type: String, Str: "true"}).Bool()) - assert(t, (Result{Type: True}).Bool()) - assert(t, (Result{Type: False}).Bool() == false) - assert(t, (Result{Type: Number, Num: 1}).Bool()) - // int - assert(t, (Result{Type: String, Str: "1"}).Int() == 1) - assert(t, (Result{Type: True}).Int() == 1) - assert(t, (Result{Type: False}).Int() == 0) - assert(t, (Result{Type: Number, Num: 1}).Int() == 1) - // uint - assert(t, (Result{Type: String, Str: "1"}).Uint() == 1) - assert(t, (Result{Type: True}).Uint() == 1) - assert(t, (Result{Type: False}).Uint() == 0) - assert(t, (Result{Type: Number, Num: 1}).Uint() == 1) - // float - assert(t, (Result{Type: String, Str: "1"}).Float() == 1) - assert(t, (Result{Type: True}).Float() == 1) - assert(t, (Result{Type: False}).Float() == 0) - assert(t, (Result{Type: Number, Num: 1}).Float() == 1) -} -func TestForEach(t *testing.T) { - Result{}.ForEach(nil) - Result{Type: String, Str: "Hello"}.ForEach(func(_, value Result) bool { - assert(t, value.String() == "Hello") - return false - }) - Result{Type: JSON, Raw: "*invalid*"}.ForEach(nil) - - json := ` {"name": {"first": "Janet","last": "Prichard"}, - "asd\nf":"\ud83d\udd13","age": 47}` - var count int - ParseBytes([]byte(json)).ForEach(func(key, value Result) bool { - count++ - return true - }) - assert(t, count == 3) - ParseBytes([]byte(`{"bad`)).ForEach(nil) - ParseBytes([]byte(`{"ok":"bad`)).ForEach(nil) -} -func TestMap(t *testing.T) { - assert(t, len(ParseBytes([]byte(`"asdf"`)).Map()) == 0) - assert(t, ParseBytes([]byte(`{"asdf":"ghjk"`)).Map()["asdf"].String() == "ghjk") - assert(t, len(Result{Type: JSON, Raw: "**invalid**"}.Map()) == 0) - assert(t, Result{Type: JSON, Raw: "**invalid**"}.Value() == nil) - assert(t, Result{Type: JSON, Raw: "{"}.Map() != nil) -} -func TestBasic1(t *testing.T) { - mtok := get(basicJSON, `loggy.programmers`) - var count int - mtok.ForEach(func(key, value Result) bool { - if key.Exists() { - t.Fatalf("expected %v, got %v", false, key.Exists()) - } - count++ - if count == 3 { - return false - } - if count == 1 { - i := 0 - value.ForEach(func(key, value Result) bool { - switch i { - case 0: - if key.String() != "firstName" || value.String() != "Brett" { - t.Fatalf("expected %v/%v got %v/%v", "firstName", "Brett", key.String(), value.String()) - } - case 1: - if key.String() != "lastName" || value.String() != "McLaughlin" { - t.Fatalf("expected %v/%v got %v/%v", "lastName", "McLaughlin", key.String(), value.String()) - } - case 2: - if key.String() != "email" || value.String() != "aaaa" { - t.Fatalf("expected %v/%v got %v/%v", "email", "aaaa", key.String(), value.String()) - } - } - i++ - return true - }) - } - return true - }) - if count != 3 { - t.Fatalf("expected %v, got %v", 3, count) - } -} -func TestBasic2(t *testing.T) { - mtok := get(basicJSON, `loggy.programmers.#[age=101].firstName`) - if mtok.String() != "1002.3" { - t.Fatalf("expected %v, got %v", "1002.3", mtok.String()) - } - mtok = get(basicJSON, `loggy.programmers.#[firstName != "Brett"].firstName`) - if mtok.String() != "Jason" { - t.Fatalf("expected %v, got %v", "Jason", mtok.String()) - } - mtok = get(basicJSON, `loggy.programmers.#[firstName % "Bre*"].email`) - if mtok.String() != "aaaa" { - t.Fatalf("expected %v, got %v", "aaaa", mtok.String()) - } - mtok = get(basicJSON, `loggy.programmers.#[firstName !% "Bre*"].email`) - if mtok.String() != "bbbb" { - t.Fatalf("expected %v, got %v", "bbbb", mtok.String()) - } - mtok = get(basicJSON, `loggy.programmers.#[firstName == "Brett"].email`) - if mtok.String() != "aaaa" { - t.Fatalf("expected %v, got %v", "aaaa", mtok.String()) - } - mtok = get(basicJSON, "loggy") - if mtok.Type != JSON { - t.Fatalf("expected %v, got %v", JSON, mtok.Type) - } - if len(mtok.Map()) != 1 { - t.Fatalf("expected %v, got %v", 1, len(mtok.Map())) - } - programmers := mtok.Map()["programmers"] - if programmers.Array()[1].Map()["firstName"].Str != "Jason" { - t.Fatalf("expected %v, got %v", "Jason", mtok.Map()["programmers"].Array()[1].Map()["firstName"].Str) - } -} -func TestBasic3(t *testing.T) { - var mtok Result - if Parse(basicJSON).Get("loggy.programmers").Get("1").Get("firstName").Str != "Jason" { - t.Fatalf("expected %v, got %v", "Jason", Parse(basicJSON).Get("loggy.programmers").Get("1").Get("firstName").Str) - } - var token Result - if token = Parse("-102"); token.Num != -102 { - t.Fatalf("expected %v, got %v", -102, token.Num) - } - if token = Parse("102"); token.Num != 102 { - t.Fatalf("expected %v, got %v", 102, token.Num) - } - if token = Parse("102.2"); token.Num != 102.2 { - t.Fatalf("expected %v, got %v", 102.2, token.Num) - } - if token = Parse(`"hello"`); token.Str != "hello" { - t.Fatalf("expected %v, got %v", "hello", token.Str) - } - if token = Parse(`"\"he\nllo\""`); token.Str != "\"he\nllo\"" { - t.Fatalf("expected %v, got %v", "\"he\nllo\"", token.Str) - } - mtok = get(basicJSON, "loggy.programmers.#.firstName") - if len(mtok.Array()) != 4 { - t.Fatalf("expected 4, got %v", len(mtok.Array())) - } - for i, ex := range []string{"Brett", "Jason", "Elliotte", "1002.3"} { - if mtok.Array()[i].String() != ex { - t.Fatalf("expected '%v', got '%v'", ex, mtok.Array()[i].String()) - } - } - mtok = get(basicJSON, "loggy.programmers.#.asd") - if mtok.Type != JSON { - t.Fatalf("expected %v, got %v", JSON, mtok.Type) - } - if len(mtok.Array()) != 0 { - t.Fatalf("expected 0, got %v", len(mtok.Array())) - } -} -func TestBasic4(t *testing.T) { - if get(basicJSON, "items.3.tags.#").Num != 3 { - t.Fatalf("expected 3, got %v", get(basicJSON, "items.3.tags.#").Num) - } - if get(basicJSON, "items.3.points.1.#").Num != 2 { - t.Fatalf("expected 2, got %v", get(basicJSON, "items.3.points.1.#").Num) - } - if get(basicJSON, "items.#").Num != 8 { - t.Fatalf("expected 6, got %v", get(basicJSON, "items.#").Num) - } - if get(basicJSON, "vals.#").Num != 4 { - t.Fatalf("expected 4, got %v", get(basicJSON, "vals.#").Num) - } - if !get(basicJSON, "name.last").Exists() { - t.Fatal("expected true, got false") - } - token := get(basicJSON, "name.here") - if token.String() != "B\\\"R" { - t.Fatal("expecting 'B\\\"R'", "got", token.String()) - } - token = get(basicJSON, "arr.#") - if token.String() != "6" { - fmt.Printf("%#v\n", token) - t.Fatal("expecting 6", "got", token.String()) - } - token = get(basicJSON, "arr.3.hello") - if token.String() != "world" { - t.Fatal("expecting 'world'", "got", token.String()) - } - _ = token.Value().(string) - token = get(basicJSON, "name.first") - if token.String() != "tom" { - t.Fatal("expecting 'tom'", "got", token.String()) - } - _ = token.Value().(string) - token = get(basicJSON, "name.last") - if token.String() != "" { - t.Fatal("expecting ''", "got", token.String()) - } - if token.Value() != nil { - t.Fatal("should be nil") - } -} -func TestBasic5(t *testing.T) { - token := get(basicJSON, "age") - if token.String() != "100" { - t.Fatal("expecting '100'", "got", token.String()) - } - _ = token.Value().(float64) - token = get(basicJSON, "happy") - if token.String() != "true" { - t.Fatal("expecting 'true'", "got", token.String()) - } - _ = token.Value().(bool) - token = get(basicJSON, "immortal") - if token.String() != "false" { - t.Fatal("expecting 'false'", "got", token.String()) - } - _ = token.Value().(bool) - token = get(basicJSON, "noop") - if token.String() != `{"what is a wren?":"a bird"}` { - t.Fatal("expecting '"+`{"what is a wren?":"a bird"}`+"'", "got", token.String()) - } - _ = token.Value().(map[string]interface{}) - - if get(basicJSON, "").Value() != nil { - t.Fatal("should be nil") - } - - get(basicJSON, "vals.hello") - - mm := Parse(basicJSON).Value().(map[string]interface{}) - fn := mm["loggy"].(map[string]interface{})["programmers"].([]interface{})[1].(map[string]interface{})["firstName"].(string) - if fn != "Jason" { - t.Fatalf("expecting %v, got %v", "Jason", fn) - } -} -func TestUnicode(t *testing.T) { - var json = `{"key":0,"的情况下解":{"key":1,"的情况":2}}` - if Get(json, "的情况下解.key").Num != 1 { - t.Fatal("fail") - } - if Get(json, "的情况下解.的情况").Num != 2 { - t.Fatal("fail") - } - if Get(json, "的情况下解.çš„?况").Num != 2 { - t.Fatal("fail") - } - if Get(json, "的情况下解.çš„?*").Num != 2 { - t.Fatal("fail") - } - if Get(json, "的情况下解.*?况").Num != 2 { - t.Fatal("fail") - } - if Get(json, "的情?下解.*?况").Num != 2 { - t.Fatal("fail") - } - if Get(json, "的情下解.*?况").Num != 0 { - t.Fatal("fail") - } -} - -func TestUnescape(t *testing.T) { - unescape(string([]byte{'\\', '\\', 0})) - unescape(string([]byte{'\\', '/', '\\', 'b', '\\', 'f'})) -} -func assert(t testing.TB, cond bool) { - if !cond { - panic("assert failed") - } -} -func TestLess(t *testing.T) { - assert(t, !Result{Type: Null}.Less(Result{Type: Null}, true)) - assert(t, Result{Type: Null}.Less(Result{Type: False}, true)) - assert(t, Result{Type: Null}.Less(Result{Type: True}, true)) - assert(t, Result{Type: Null}.Less(Result{Type: JSON}, true)) - assert(t, Result{Type: Null}.Less(Result{Type: Number}, true)) - assert(t, Result{Type: Null}.Less(Result{Type: String}, true)) - assert(t, !Result{Type: False}.Less(Result{Type: Null}, true)) - assert(t, Result{Type: False}.Less(Result{Type: True}, true)) - assert(t, Result{Type: String, Str: "abc"}.Less(Result{Type: String, Str: "bcd"}, true)) - assert(t, Result{Type: String, Str: "ABC"}.Less(Result{Type: String, Str: "abc"}, true)) - assert(t, !Result{Type: String, Str: "ABC"}.Less(Result{Type: String, Str: "abc"}, false)) - assert(t, Result{Type: Number, Num: 123}.Less(Result{Type: Number, Num: 456}, true)) - assert(t, !Result{Type: Number, Num: 456}.Less(Result{Type: Number, Num: 123}, true)) - assert(t, !Result{Type: Number, Num: 456}.Less(Result{Type: Number, Num: 456}, true)) - assert(t, stringLessInsensitive("abcde", "BBCDE")) - assert(t, stringLessInsensitive("abcde", "bBCDE")) - assert(t, stringLessInsensitive("Abcde", "BBCDE")) - assert(t, stringLessInsensitive("Abcde", "bBCDE")) - assert(t, !stringLessInsensitive("bbcde", "aBCDE")) - assert(t, !stringLessInsensitive("bbcde", "ABCDE")) - assert(t, !stringLessInsensitive("Bbcde", "aBCDE")) - assert(t, !stringLessInsensitive("Bbcde", "ABCDE")) - assert(t, !stringLessInsensitive("abcde", "ABCDE")) - assert(t, !stringLessInsensitive("Abcde", "ABCDE")) - assert(t, !stringLessInsensitive("abcde", "ABCDE")) - assert(t, !stringLessInsensitive("ABCDE", "ABCDE")) - assert(t, !stringLessInsensitive("abcde", "abcde")) - assert(t, !stringLessInsensitive("123abcde", "123Abcde")) - assert(t, !stringLessInsensitive("123Abcde", "123Abcde")) - assert(t, !stringLessInsensitive("123Abcde", "123abcde")) - assert(t, !stringLessInsensitive("123abcde", "123abcde")) - assert(t, !stringLessInsensitive("124abcde", "123abcde")) - assert(t, !stringLessInsensitive("124Abcde", "123Abcde")) - assert(t, !stringLessInsensitive("124Abcde", "123abcde")) - assert(t, !stringLessInsensitive("124abcde", "123abcde")) - assert(t, stringLessInsensitive("124abcde", "125abcde")) - assert(t, stringLessInsensitive("124Abcde", "125Abcde")) - assert(t, stringLessInsensitive("124Abcde", "125abcde")) - assert(t, stringLessInsensitive("124abcde", "125abcde")) -} - -func TestIssue6(t *testing.T) { - data := `{ - "code": 0, - "msg": "", - "data": { - "sz002024": { - "qfqday": [ - [ - "2014-01-02", - "8.93", - "9.03", - "9.17", - "8.88", - "621143.00" - ], - [ - "2014-01-03", - "9.03", - "9.30", - "9.47", - "8.98", - "1624438.00" - ] - ] - } - } - }` - - var num []string - for _, v := range Get(data, "data.sz002024.qfqday.0").Array() { - num = append(num, v.String()) - } - if fmt.Sprintf("%v", num) != "[2014-01-02 8.93 9.03 9.17 8.88 621143.00]" { - t.Fatalf("invalid result") - } -} - -var exampleJSON = `{ - "widget": { - "debug": "on", - "window": { - "title": "Sample Konfabulator Widget", - "name": "main_window", - "width": 500, - "height": 500 - }, - "image": { - "src": "Images/Sun.png", - "hOffset": 250, - "vOffset": 250, - "alignment": "center" - }, - "text": { - "data": "Click Here", - "size": 36, - "style": "bold", - "vOffset": 100, - "alignment": "center", - "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" - } - } -}` - -func TestNewParse(t *testing.T) { - //fmt.Printf("%v\n", parse2(exampleJSON, "widget").String()) -} - -func TestUnmarshalMap(t *testing.T) { - var m1 = Parse(exampleJSON).Value().(map[string]interface{}) - var m2 map[string]interface{} - if err := json.Unmarshal([]byte(exampleJSON), &m2); err != nil { - t.Fatal(err) - } - b1, err := json.Marshal(m1) - if err != nil { - t.Fatal(err) - } - b2, err := json.Marshal(m2) - if err != nil { - t.Fatal(err) - } - if bytes.Compare(b1, b2) != 0 { - t.Fatal("b1 != b2") - } -} - -func TestSingleArrayValue(t *testing.T) { - var json = `{"key": "value","key2":[1,2,3,4,"A"]}` - var result = Get(json, "key") - var array = result.Array() - if len(array) != 1 { - t.Fatal("array is empty") - } - if array[0].String() != "value" { - t.Fatalf("got %s, should be %s", array[0].String(), "value") - } - - array = Get(json, "key2.#").Array() - if len(array) != 1 { - t.Fatalf("got '%v', expected '%v'", len(array), 1) - } - - array = Get(json, "key3").Array() - if len(array) != 0 { - t.Fatalf("got '%v', expected '%v'", len(array), 0) - } - -} - -var manyJSON = ` { - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{ - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{ - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{ - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{ - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{ - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{ - "a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"a":{"hello":"world" - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - "position":{"type":"Point","coordinates":[-115.24,33.09]}, - "loves":["world peace"], - "name":{"last":"Anderson","first":"Nancy"}, - "age":31 - "":{"a":"emptya","b":"emptyb"}, - "name.last":"Yellow", - "name.first":"Cat", -}` - -func combine(results []Result) string { - return fmt.Sprintf("%v", results) -} -func TestManyBasic(t *testing.T) { - testWatchForFallback = true - defer func() { - testWatchForFallback = false - }() - testMany := func(shouldFallback bool, expect string, paths ...string) { - results := GetManyBytes( - []byte(manyJSON), - paths..., - ) - if len(results) != len(paths) { - t.Fatalf("expected %v, got %v", len(paths), len(results)) - } - if fmt.Sprintf("%v", results) != expect { - fmt.Printf("%v\n", paths) - t.Fatalf("expected %v, got %v", expect, results) - } - //if testLastWasFallback != shouldFallback { - // t.Fatalf("expected %v, got %v", shouldFallback, testLastWasFallback) - //} - } - testMany(false, "[Point]", "position.type") - testMany(false, `[emptya ["world peace"] 31]`, ".a", "loves", "age") - testMany(false, `[["world peace"]]`, "loves") - testMany(false, `[{"last":"Anderson","first":"Nancy"} Nancy]`, "name", "name.first") - testMany(true, `[]`, strings.Repeat("a.", 40)+"hello") - res := Get(manyJSON, strings.Repeat("a.", 48)+"a") - testMany(true, `[`+res.String()+`]`, strings.Repeat("a.", 48)+"a") - // these should fallback - testMany(true, `[Cat Nancy]`, "name\\.first", "name.first") - testMany(true, `[world]`, strings.Repeat("a.", 70)+"hello") -} -func testMany(t *testing.T, json string, paths, expected []string) { - testManyAny(t, json, paths, expected, true) - testManyAny(t, json, paths, expected, false) -} -func testManyAny(t *testing.T, json string, paths, expected []string, bytes bool) { - var result []Result - for i := 0; i < 2; i++ { - var which string - if i == 0 { - which = "Get" - result = nil - for j := 0; j < len(expected); j++ { - if bytes { - result = append(result, GetBytes([]byte(json), paths[j])) - } else { - result = append(result, Get(json, paths[j])) - } - } - } else if i == 1 { - which = "GetMany" - if bytes { - result = GetManyBytes([]byte(json), paths...) - } else { - result = GetMany(json, paths...) - } - } - for j := 0; j < len(expected); j++ { - if result[j].String() != expected[j] { - t.Fatalf("Using key '%s' for '%s'\nexpected '%v', got '%v'", paths[j], which, expected[j], result[j].String()) - } - } - } -} -func TestIssue20(t *testing.T) { - json := `{ "name": "FirstName", "name1": "FirstName1", "address": "address1", "addressDetails": "address2", }` - paths := []string{"name", "name1", "address", "addressDetails"} - expected := []string{"FirstName", "FirstName1", "address1", "address2"} - t.Run("SingleMany", func(t *testing.T) { testMany(t, json, paths, expected) }) -} - -func TestIssue21(t *testing.T) { - json := `{ "Level1Field1":3, - "Level1Field4":4, - "Level1Field2":{ "Level2Field1":[ "value1", "value2" ], - "Level2Field2":{ "Level3Field1":[ { "key1":"value1" } ] } } }` - paths := []string{"Level1Field1", "Level1Field2.Level2Field1", "Level1Field2.Level2Field2.Level3Field1", "Level1Field4"} - expected := []string{"3", `[ "value1", "value2" ]`, `[ { "key1":"value1" } ]`, "4"} - t.Run("SingleMany", func(t *testing.T) { testMany(t, json, paths, expected) }) -} - -func TestRandomMany(t *testing.T) { - var lstr string - defer func() { - if v := recover(); v != nil { - println("'" + hex.EncodeToString([]byte(lstr)) + "'") - println("'" + lstr + "'") - panic(v) - } - }() - rand.Seed(time.Now().UnixNano()) - b := make([]byte, 512) - for i := 0; i < 50000; i++ { - n, err := rand.Read(b[:rand.Int()%len(b)]) - if err != nil { - t.Fatal(err) - } - lstr = string(b[:n]) - paths := make([]string, rand.Int()%64) - for i := range paths { - var b []byte - n := rand.Int() % 5 - for j := 0; j < n; j++ { - if j > 0 { - b = append(b, '.') - } - nn := rand.Int() % 10 - for k := 0; k < nn; k++ { - b = append(b, 'a'+byte(rand.Int()%26)) - } - } - paths[i] = string(b) - } - GetMany(lstr, paths...) - } -} - -type ComplicatedType struct { - unsettable int - Tagged string `json:"tagged"` - NotTagged bool - Nested struct { - Yellow string `json:"yellow"` - } - NestedTagged struct { - Green string - Map map[string]interface{} - Ints struct { - Int int `json:"int"` - Int8 int8 - Int16 int16 - Int32 int32 - Int64 int64 `json:"int64"` - } - Uints struct { - Uint uint - Uint8 uint8 - Uint16 uint16 - Uint32 uint32 - Uint64 uint64 - } - Floats struct { - Float64 float64 - Float32 float32 - } - Byte byte - Bool bool - } `json:"nestedTagged"` - LeftOut string `json:"-"` - SelfPtr *ComplicatedType - SelfSlice []ComplicatedType - SelfSlicePtr []*ComplicatedType - SelfPtrSlice *[]ComplicatedType - Interface interface{} `json:"interface"` - Array [3]int - Time time.Time `json:"time"` - Binary []byte - NonBinary []byte -} - -var complicatedJSON = ` -{ - "tagged": "OK", - "Tagged": "KO", - "NotTagged": true, - "unsettable": 101, - "Nested": { - "Yellow": "Green", - "yellow": "yellow" - }, - "nestedTagged": { - "Green": "Green", - "Map": { - "this": "that", - "and": "the other thing" - }, - "Ints": { - "Uint": 99, - "Uint16": 16, - "Uint32": 32, - "Uint64": 65 - }, - "Uints": { - "int": -99, - "Int": -98, - "Int16": -16, - "Int32": -32, - "int64": -64, - "Int64": -65 - }, - "Uints": { - "Float32": 32.32, - "Float64": 64.64 - }, - "Byte": 254, - "Bool": true - }, - "LeftOut": "you shouldn't be here", - "SelfPtr": {"tagged":"OK","nestedTagged":{"Ints":{"Uint32":32}}}, - "SelfSlice": [{"tagged":"OK","nestedTagged":{"Ints":{"Uint32":32}}}], - "SelfSlicePtr": [{"tagged":"OK","nestedTagged":{"Ints":{"Uint32":32}}}], - "SelfPtrSlice": [{"tagged":"OK","nestedTagged":{"Ints":{"Uint32":32}}}], - "interface": "Tile38 Rocks!", - "Interface": "Please Download", - "Array": [0,2,3,4,5], - "time": "2017-05-07T13:24:43-07:00", - "Binary": "R0lGODlhPQBEAPeo", - "NonBinary": [9,3,100,115] -} -` - -func TestUnmarshal(t *testing.T) { - var s1 ComplicatedType - var s2 ComplicatedType - if err := json.Unmarshal([]byte(complicatedJSON), &s1); err != nil { - t.Fatal(err) - } - if err := Unmarshal([]byte(complicatedJSON), &s2); err != nil { - t.Fatal(err) - } - if !reflect.DeepEqual(&s1, &s2) { - t.Fatal("not equal") - } - var str string - if err := json.Unmarshal([]byte(Get(complicatedJSON, "LeftOut").Raw), &str); err != nil { - t.Fatal(err) - } - assert(t, str == Get(complicatedJSON, "LeftOut").String()) -} - -func testvalid(t *testing.T, json string, expect bool) { - t.Helper() - _, ok := validpayload([]byte(json), 0) - if ok != expect { - t.Fatal("mismatch") - } -} - -func TestValidBasic(t *testing.T) { - testvalid(t, "0", true) - testvalid(t, "00", false) - testvalid(t, "-00", false) - testvalid(t, "-.", false) - testvalid(t, "0.0", true) - testvalid(t, "10.0", true) - testvalid(t, "10e1", true) - testvalid(t, "10EE", false) - testvalid(t, "10E-", false) - testvalid(t, "10E+", false) - testvalid(t, "10E123", true) - testvalid(t, "10E-123", true) - testvalid(t, "10E-0123", true) - testvalid(t, "", false) - testvalid(t, " ", false) - testvalid(t, "{}", true) - testvalid(t, "{", false) - testvalid(t, "-", false) - testvalid(t, "-1", true) - testvalid(t, "-1.", false) - testvalid(t, "-1.0", true) - testvalid(t, " -1.0", true) - testvalid(t, " -1.0 ", true) - testvalid(t, "-1.0 ", true) - testvalid(t, "-1.0 i", false) - testvalid(t, "-1.0 i", false) - testvalid(t, "true", true) - testvalid(t, " true", true) - testvalid(t, " true ", true) - testvalid(t, " True ", false) - testvalid(t, " tru", false) - testvalid(t, "false", true) - testvalid(t, " false", true) - testvalid(t, " false ", true) - testvalid(t, " False ", false) - testvalid(t, " fals", false) - testvalid(t, "null", true) - testvalid(t, " null", true) - testvalid(t, " null ", true) - testvalid(t, " Null ", false) - testvalid(t, " nul", false) - testvalid(t, " []", true) - testvalid(t, " [true]", true) - testvalid(t, " [ true, null ]", true) - testvalid(t, " [ true,]", false) - testvalid(t, `{"hello":"world"}`, true) - testvalid(t, `{ "hello": "world" }`, true) - testvalid(t, `{ "hello": "world", }`, false) - testvalid(t, `{"a":"b",}`, false) - testvalid(t, `{"a":"b","a"}`, false) - testvalid(t, `{"a":"b","a":}`, false) - testvalid(t, `{"a":"b","a":1}`, true) - testvalid(t, `{"a":"b",2"1":2}`, false) - testvalid(t, `{"a":"b","a": 1, "c":{"hi":"there"} }`, true) - testvalid(t, `{"a":"b","a": 1, "c":{"hi":"there", "easy":["going",{"mixed":"bag"}]} }`, true) - testvalid(t, `""`, true) - testvalid(t, `"`, false) - testvalid(t, `"\n"`, true) - testvalid(t, `"\"`, false) - testvalid(t, `"\\"`, true) - testvalid(t, `"a\\b"`, true) - testvalid(t, `"a\\b\\\"a"`, true) - testvalid(t, `"a\\b\\\uFFAAa"`, true) - testvalid(t, `"a\\b\\\uFFAZa"`, false) - testvalid(t, `"a\\b\\\uFFA"`, false) - testvalid(t, string(complicatedJSON), true) - testvalid(t, string(exampleJSON), true) -} - -var jsonchars = []string{"{", "[", ",", ":", "}", "]", "1", "0", "true", "false", "null", `""`, `"\""`, `"a"`} - -func makeRandomJSONChars(b []byte) { - var bb []byte - for len(bb) < len(b) { - bb = append(bb, jsonchars[rand.Int()%len(jsonchars)]...) - } - copy(b, bb[:len(b)]) -} -func TestValidRandom(t *testing.T) { - rand.Seed(time.Now().UnixNano()) - b := make([]byte, 100000) - start := time.Now() - for time.Since(start) < time.Second*3 { - n := rand.Int() % len(b) - rand.Read(b[:n]) - validpayload(b[:n], 0) - } - - start = time.Now() - for time.Since(start) < time.Second*3 { - n := rand.Int() % len(b) - makeRandomJSONChars(b[:n]) - validpayload(b[:n], 0) - } -} - -func TestGetMany47(t *testing.T) { - json := `{"bar": {"id": 99, "mybar": "my mybar" }, "foo": {"myfoo": [605]}}` - paths := []string{"foo.myfoo", "bar.id", "bar.mybar", "bar.mybarx"} - expected := []string{"[605]", "99", "my mybar", ""} - results := GetMany(json, paths...) - if len(expected) != len(results) { - t.Fatalf("expected %v, got %v", len(expected), len(results)) - } - for i, path := range paths { - if results[i].String() != expected[i] { - t.Fatalf("expected '%v', got '%v' for path '%v'", expected[i], results[i].String(), path) - } - } -} - -func TestGetMany48(t *testing.T) { - json := `{"bar": {"id": 99, "xyz": "my xyz"}, "foo": {"myfoo": [605]}}` - paths := []string{"foo.myfoo", "bar.id", "bar.xyz", "bar.abc"} - expected := []string{"[605]", "99", "my xyz", ""} - results := GetMany(json, paths...) - if len(expected) != len(results) { - t.Fatalf("expected %v, got %v", len(expected), len(results)) - } - for i, path := range paths { - if results[i].String() != expected[i] { - t.Fatalf("expected '%v', got '%v' for path '%v'", expected[i], results[i].String(), path) - } - } -} - -func TestResultRawForLiteral(t *testing.T) { - for _, lit := range []string{"null", "true", "false"} { - result := Parse(lit) - if result.Raw != lit { - t.Fatalf("expected '%v', got '%v'", lit, result.Raw) - } - } -} - -func TestNullArray(t *testing.T) { - n := len(Get(`{"data":null}`, "data").Array()) - if n != 0 { - t.Fatalf("expected '%v', got '%v'", 0, n) - } - n = len(Get(`{}`, "data").Array()) - if n != 0 { - t.Fatalf("expected '%v', got '%v'", 0, n) - } - n = len(Get(`{"data":[]}`, "data").Array()) - if n != 0 { - t.Fatalf("expected '%v', got '%v'", 0, n) - } - n = len(Get(`{"data":[null]}`, "data").Array()) - if n != 1 { - t.Fatalf("expected '%v', got '%v'", 1, n) - } -} - -func TestRandomGetMany(t *testing.T) { - start := time.Now() - for time.Since(start) < time.Second*3 { - testRandomGetMany(t) - } -} -func testRandomGetMany(t *testing.T) { - rand.Seed(time.Now().UnixNano()) - json, keys := randomJSON() - for _, key := range keys { - r := Get(json, key) - if !r.Exists() { - t.Fatal("should exist") - } - } - rkeysi := rand.Perm(len(keys)) - rkeysn := 1 + rand.Int()%32 - if len(rkeysi) > rkeysn { - rkeysi = rkeysi[:rkeysn] - } - var rkeys []string - for i := 0; i < len(rkeysi); i++ { - rkeys = append(rkeys, keys[rkeysi[i]]) - } - mres1 := GetMany(json, rkeys...) - var mres2 []Result - for _, rkey := range rkeys { - mres2 = append(mres2, Get(json, rkey)) - } - if len(mres1) != len(mres2) { - t.Fatalf("expected %d, got %d", len(mres2), len(mres1)) - } - for i := 0; i < len(mres1); i++ { - mres1[i].Index = 0 - mres2[i].Index = 0 - v1 := fmt.Sprintf("%#v", mres1[i]) - v2 := fmt.Sprintf("%#v", mres2[i]) - if v1 != v2 { - t.Fatalf("\nexpected %s\n"+ - " got %s", v2, v1) - } - } -} - -func TestIssue54(t *testing.T) { - var r []Result - json := `{"MarketName":null,"Nounce":6115}` - r = GetMany(json, "Nounce", "Buys", "Sells", "Fills") - if strings.Replace(fmt.Sprintf("%v", r), " ", "", -1) != "[6115]" { - t.Fatalf("expected '%v', got '%v'", "[6115]", strings.Replace(fmt.Sprintf("%v", r), " ", "", -1)) - } - r = GetMany(json, "Nounce", "Buys", "Sells") - if strings.Replace(fmt.Sprintf("%v", r), " ", "", -1) != "[6115]" { - t.Fatalf("expected '%v', got '%v'", "[6115]", strings.Replace(fmt.Sprintf("%v", r), " ", "", -1)) - } - r = GetMany(json, "Nounce") - if strings.Replace(fmt.Sprintf("%v", r), " ", "", -1) != "[6115]" { - t.Fatalf("expected '%v', got '%v'", "[6115]", strings.Replace(fmt.Sprintf("%v", r), " ", "", -1)) - } -} - -func randomString() string { - var key string - N := 1 + rand.Int()%16 - for i := 0; i < N; i++ { - r := rand.Int() % 62 - if r < 10 { - key += string(byte('0' + r)) - } else if r-10 < 26 { - key += string(byte('a' + r - 10)) - } else { - key += string(byte('A' + r - 10 - 26)) - } - } - return `"` + key + `"` -} -func randomBool() string { - switch rand.Int() % 2 { - default: - return "false" - case 1: - return "true" - } -} -func randomNumber() string { - return strconv.FormatInt(int64(rand.Int()%1000000), 10) -} - -func randomObjectOrArray(keys []string, prefix string, array bool, depth int) (string, []string) { - N := 5 + rand.Int()%5 - var json string - if array { - json = "[" - } else { - json = "{" - } - for i := 0; i < N; i++ { - if i > 0 { - json += "," - } - var pkey string - if array { - pkey = prefix + "." + strconv.FormatInt(int64(i), 10) - } else { - key := randomString() - pkey = prefix + "." + key[1:len(key)-1] - json += key + `:` - } - keys = append(keys, pkey[1:]) - var kind int - if depth == 5 { - kind = rand.Int() % 4 - } else { - kind = rand.Int() % 6 - } - switch kind { - case 0: - json += randomString() - case 1: - json += randomBool() - case 2: - json += "null" - case 3: - json += randomNumber() - case 4: - var njson string - njson, keys = randomObjectOrArray(keys, pkey, true, depth+1) - json += njson - case 5: - var njson string - njson, keys = randomObjectOrArray(keys, pkey, false, depth+1) - json += njson - } - - } - if array { - json += "]" - } else { - json += "}" - } - return json, keys -} - -func randomJSON() (json string, keys []string) { - return randomObjectOrArray(nil, "", false, 0) -} - -func TestIssue55(t *testing.T) { - json := `{"one": {"two": 2, "three": 3}, "four": 4, "five": 5}` - results := GetMany(json, "four", "five", "one.two", "one.six") - expected := []string{"4", "5", "2", ""} - for i, r := range results { - if r.String() != expected[i] { - t.Fatalf("expected %v, got %v", expected[i], r.String()) - } - } -} -func TestIssue58(t *testing.T) { - json := `{"data":[{"uid": 1},{"uid": 2}]}` - res := Get(json, `data.#[uid!=1]`).Raw - if res != `{"uid": 2}` { - t.Fatalf("expected '%v', got '%v'", `{"uid": 1}`, res) - } -} - -func TestObjectGrouping(t *testing.T) { - json := ` -[ - true, - {"name":"tom"}, - false, - {"name":"janet"}, - null -] -` - res := Get(json, "#.name") - if res.String() != `["tom","janet"]` { - t.Fatalf("expected '%v', got '%v'", `["tom","janet"]`, res.String()) - } -} - -func TestJSONLines(t *testing.T) { - json := ` -true -false -{"name":"tom"} -[1,2,3,4,5] -{"name":"janet"} -null -12930.1203 - ` - paths := []string{"..#", "..0", "..2.name", "..#.name", "..6", "..7"} - ress := []string{"7", "true", "tom", `["tom","janet"]`, "12930.1203", ""} - for i, path := range paths { - res := Get(json, path) - if res.String() != ress[i] { - t.Fatalf("expected '%v', got '%v'", ress[i], res.String()) - } - } - - json = ` -{"name": "Gilbert", "wins": [["straight", "7♣"], ["one pair", "10♥"]]} -{"name": "Alexa", "wins": [["two pair", "4â™ "], ["two pair", "9â™ "]]} -{"name": "May", "wins": []} -{"name": "Deloise", "wins": [["three of a kind", "5♣"]]} -` - - var i int - lines := strings.Split(strings.TrimSpace(json), "\n") - ForEachLine(json, func(line Result) bool { - if line.Raw != lines[i] { - t.Fatalf("expected '%v', got '%v'", lines[i], line.Raw) - } - i++ - return true - }) - if i != 4 { - t.Fatalf("expected '%v', got '%v'", 4, i) - } - -} - -func TestNumUint64String(t *testing.T) { - var i int64 = 9007199254740993 //2^53 + 1 - j := fmt.Sprintf(`{"data": [ %d, "hello" ] }`, i) - res := Get(j, "data.0") - if res.String() != "9007199254740993" { - t.Fatalf("expected '%v', got '%v'", "9007199254740993", res.String()) - } -} - -func TestNumInt64String(t *testing.T) { - var i int64 = -9007199254740993 - j := fmt.Sprintf(`{"data":[ "hello", %d ]}`, i) - res := Get(j, "data.1") - if res.String() != "-9007199254740993" { - t.Fatalf("expected '%v', got '%v'", "-9007199254740993", res.String()) - } -} - -func TestNumBigString(t *testing.T) { - i := "900719925474099301239109123101" // very big - j := fmt.Sprintf(`{"data":[ "hello", "%s" ]}`, i) - res := Get(j, "data.1") - if res.String() != "900719925474099301239109123101" { - t.Fatalf("expected '%v', got '%v'", "900719925474099301239109123101", res.String()) - } -} - -func TestNumFloatString(t *testing.T) { - var i int64 = -9007199254740993 - j := fmt.Sprintf(`{"data":[ "hello", %d ]}`, i) //No quotes around value!! - res := Get(j, "data.1") - if res.String() != "-9007199254740993" { - t.Fatalf("expected '%v', got '%v'", "-9007199254740993", res.String()) - } -} - -func TestDuplicateKeys(t *testing.T) { - // this is vaild json according to the JSON spec - var json = `{"name": "Alex","name": "Peter"}` - if Parse(json).Get("name").String() != - Parse(json).Map()["name"].String() { - t.Fatalf("expected '%v', got '%v'", - Parse(json).Get("name").String(), - Parse(json).Map()["name"].String(), - ) - } - if !Valid(json) { - t.Fatal("should be valid") - } -} - -func TestArrayValues(t *testing.T) { - var json = `{"array": ["PERSON1","PERSON2",0],}` - values := Get(json, "array").Array() - var output string - for i, val := range values { - if i > 0 { - output += "\n" - } - output += fmt.Sprintf("%#v", val) - } - expect := strings.Join([]string{ - `gjson.Result{Type:3, Raw:"\"PERSON1\"", Str:"PERSON1", Num:0, Index:0}`, - `gjson.Result{Type:3, Raw:"\"PERSON2\"", Str:"PERSON2", Num:0, Index:0}`, - `gjson.Result{Type:2, Raw:"0", Str:"", Num:0, Index:0}`, - }, "\n") - if output != expect { - t.Fatalf("expected '%v', got '%v'", expect, output) - } - -} - -func BenchmarkValid(b *testing.B) { - for i := 0; i < b.N; i++ { - Valid(complicatedJSON) - } -} - -func BenchmarkValidBytes(b *testing.B) { - complicatedJSON := []byte(complicatedJSON) - for i := 0; i < b.N; i++ { - ValidBytes(complicatedJSON) - } -} - -func BenchmarkGoStdlibValidBytes(b *testing.B) { - complicatedJSON := []byte(complicatedJSON) - for i := 0; i < b.N; i++ { - json.Valid(complicatedJSON) - } -} - -func TestModifier(t *testing.T) { - json := `{"other":{"hello":"world"},"arr":[1,2,3,4,5,6]}` - opts := *pretty.DefaultOptions - opts.SortKeys = true - exp := string(pretty.PrettyOptions([]byte(json), &opts)) - res := Get(json, `@pretty:{"sortKeys":true}`).String() - if res != exp { - t.Fatalf("expected '%v', got '%v'", exp, res) - } - res = Get(res, "@pretty|@reverse|@ugly").String() - if res != json { - t.Fatalf("expected '%v', got '%v'", json, res) - } - res = Get(res, "@pretty|@reverse|arr|@reverse|2").String() - if res != "4" { - t.Fatalf("expected '%v', got '%v'", "4", res) - } - AddModifier("case", func(json, arg string) string { - if arg == "upper" { - return strings.ToUpper(json) - } - if arg == "lower" { - return strings.ToLower(json) - } - return json - }) - res = Get(json, "other|@case:upper").String() - if res != `{"HELLO":"WORLD"}` { - t.Fatalf("expected '%v', got '%v'", `{"HELLO":"WORLD"}`, res) - } -} - -func TestChaining(t *testing.T) { - json := `{ - "friends": [ - {"first": "Dale", "last": "Murphy", "age": 44}, - {"first": "Roger", "last": "Craig", "age": 68}, - {"first": "Jane", "last": "Murphy", "age": 47} - ] - }` - res := Get(json, "friends|0|first").String() - if res != "Dale" { - t.Fatalf("expected '%v', got '%v'", "Dale", res) - } - res = Get(json, "friends|@reverse|0|age").String() - if res != "47" { - t.Fatalf("expected '%v', got '%v'", "47", res) - } - -} diff --git a/src/imagemagick/vendor/github.com/tidwall/match/match_test.go b/src/imagemagick/vendor/github.com/tidwall/match/match_test.go deleted file mode 100644 index 1f45458..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/match/match_test.go +++ /dev/null @@ -1,429 +0,0 @@ -package match - -import ( - "fmt" - "math/rand" - "testing" - "time" - "unicode/utf8" -) - -func TestMatch(t *testing.T) { - if !Match("hello world", "hello world") { - t.Fatal("fail") - } - if Match("hello world", "jello world") { - t.Fatal("fail") - } - if !Match("hello world", "hello*") { - t.Fatal("fail") - } - if Match("hello world", "jello*") { - t.Fatal("fail") - } - if !Match("hello world", "hello?world") { - t.Fatal("fail") - } - if Match("hello world", "jello?world") { - t.Fatal("fail") - } - if !Match("hello world", "he*o?world") { - t.Fatal("fail") - } - if !Match("hello world", "he*o?wor*") { - t.Fatal("fail") - } - if !Match("hello world", "he*o?*r*") { - t.Fatal("fail") - } - if !Match("的情况下解æžä¸€ä¸ª", "*") { - t.Fatal("fail") - } - if !Match("的情况下解æžä¸€ä¸ª", "*况下*") { - t.Fatal("fail") - } - if !Match("的情况下解æžä¸€ä¸ª", "*况?*") { - t.Fatal("fail") - } - if !Match("的情况下解æžä¸€ä¸ª", "的情况?解æžä¸€ä¸ª") { - t.Fatal("fail") - } -} - -// TestWildcardMatch - Tests validate the logic of wild card matching. -// `WildcardMatch` supports '*' and '?' wildcards. -// Sample usage: In resource matching for folder policy validation. -func TestWildcardMatch(t *testing.T) { - testCases := []struct { - pattern string - text string - matched bool - }{ - // Test case - 1. - // Test case with pattern containing key name with a prefix. Should accept the same text without a "*". - { - pattern: "my-folder/oo*", - text: "my-folder/oo", - matched: true, - }, - // Test case - 2. - // Test case with "*" at the end of the pattern. - { - pattern: "my-folder/In*", - text: "my-folder/India/Karnataka/", - matched: true, - }, - // Test case - 3. - // Test case with prefixes shuffled. - // This should fail. - { - pattern: "my-folder/In*", - text: "my-folder/Karnataka/India/", - matched: false, - }, - // Test case - 4. - // Test case with text expanded to the wildcards in the pattern. - { - pattern: "my-folder/In*/Ka*/Ban", - text: "my-folder/India/Karnataka/Ban", - matched: true, - }, - // Test case - 5. - // Test case with the keyname part is repeated as prefix several times. - // This is valid. - { - pattern: "my-folder/In*/Ka*/Ban", - text: "my-folder/India/Karnataka/Ban/Ban/Ban/Ban/Ban", - matched: true, - }, - // Test case - 6. - // Test case to validate that `*` can be expanded into multiple prefixes. - { - pattern: "my-folder/In*/Ka*/Ban", - text: "my-folder/India/Karnataka/Area1/Area2/Area3/Ban", - matched: true, - }, - // Test case - 7. - // Test case to validate that `*` can be expanded into multiple prefixes. - { - pattern: "my-folder/In*/Ka*/Ban", - text: "my-folder/India/State1/State2/Karnataka/Area1/Area2/Area3/Ban", - matched: true, - }, - // Test case - 8. - // Test case where the keyname part of the pattern is expanded in the text. - { - pattern: "my-folder/In*/Ka*/Ban", - text: "my-folder/India/Karnataka/Bangalore", - matched: false, - }, - // Test case - 9. - // Test case with prefixes and wildcard expanded for all "*". - { - pattern: "my-folder/In*/Ka*/Ban*", - text: "my-folder/India/Karnataka/Bangalore", - matched: true, - }, - // Test case - 10. - // Test case with keyname part being a wildcard in the pattern. - {pattern: "my-folder/*", - text: "my-folder/India", - matched: true, - }, - // Test case - 11. - { - pattern: "my-folder/oo*", - text: "my-folder/odo", - matched: false, - }, - - // Test case with pattern containing wildcard '?'. - // Test case - 12. - // "my-folder?/" matches "my-folder1/", "my-folder2/", "my-folder3" etc... - // doesn't match "myfolder/". - { - pattern: "my-folder?/abc*", - text: "myfolder/abc", - matched: false, - }, - // Test case - 13. - { - pattern: "my-folder?/abc*", - text: "my-folder1/abc", - matched: true, - }, - // Test case - 14. - { - pattern: "my-?-folder/abc*", - text: "my--folder/abc", - matched: false, - }, - // Test case - 15. - { - pattern: "my-?-folder/abc*", - text: "my-1-folder/abc", - matched: true, - }, - // Test case - 16. - { - pattern: "my-?-folder/abc*", - text: "my-k-folder/abc", - matched: true, - }, - // Test case - 17. - { - pattern: "my??folder/abc*", - text: "myfolder/abc", - matched: false, - }, - // Test case - 18. - { - pattern: "my??folder/abc*", - text: "my4afolder/abc", - matched: true, - }, - // Test case - 19. - { - pattern: "my-folder?abc*", - text: "my-folder/abc", - matched: true, - }, - // Test case 20-21. - // '?' matches '/' too. (works with s3). - // This is because the namespace is considered flat. - // "abc?efg" matches both "abcdefg" and "abc/efg". - { - pattern: "my-folder/abc?efg", - text: "my-folder/abcdefg", - matched: true, - }, - { - pattern: "my-folder/abc?efg", - text: "my-folder/abc/efg", - matched: true, - }, - // Test case - 22. - { - pattern: "my-folder/abc????", - text: "my-folder/abc", - matched: false, - }, - // Test case - 23. - { - pattern: "my-folder/abc????", - text: "my-folder/abcde", - matched: false, - }, - // Test case - 24. - { - pattern: "my-folder/abc????", - text: "my-folder/abcdefg", - matched: true, - }, - // Test case 25-26. - // test case with no '*'. - { - pattern: "my-folder/abc?", - text: "my-folder/abc", - matched: false, - }, - { - pattern: "my-folder/abc?", - text: "my-folder/abcd", - matched: true, - }, - { - pattern: "my-folder/abc?", - text: "my-folder/abcde", - matched: false, - }, - // Test case 27. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnop", - matched: false, - }, - // Test case 28. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnopqrst/mnopqr", - matched: true, - }, - // Test case 29. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnopqrst/mnopqrs", - matched: true, - }, - // Test case 30. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnop", - matched: false, - }, - // Test case 31. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnopq", - matched: true, - }, - // Test case 32. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnopqr", - matched: true, - }, - // Test case 33. - { - pattern: "my-folder/mnop*?and", - text: "my-folder/mnopqand", - matched: true, - }, - // Test case 34. - { - pattern: "my-folder/mnop*?and", - text: "my-folder/mnopand", - matched: false, - }, - // Test case 35. - { - pattern: "my-folder/mnop*?and", - text: "my-folder/mnopqand", - matched: true, - }, - // Test case 36. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mn", - matched: false, - }, - // Test case 37. - { - pattern: "my-folder/mnop*?", - text: "my-folder/mnopqrst/mnopqrs", - matched: true, - }, - // Test case 38. - { - pattern: "my-folder/mnop*??", - text: "my-folder/mnopqrst", - matched: true, - }, - // Test case 39. - { - pattern: "my-folder/mnop*qrst", - text: "my-folder/mnopabcdegqrst", - matched: true, - }, - // Test case 40. - { - pattern: "my-folder/mnop*?and", - text: "my-folder/mnopqand", - matched: true, - }, - // Test case 41. - { - pattern: "my-folder/mnop*?and", - text: "my-folder/mnopand", - matched: false, - }, - // Test case 42. - { - pattern: "my-folder/mnop*?and?", - text: "my-folder/mnopqanda", - matched: true, - }, - // Test case 43. - { - pattern: "my-folder/mnop*?and", - text: "my-folder/mnopqanda", - matched: false, - }, - // Test case 44. - - { - pattern: "my-?-folder/abc*", - text: "my-folder/mnopqanda", - matched: false, - }, - } - // Iterating over the test cases, call the function under test and asert the output. - for i, testCase := range testCases { - actualResult := Match(testCase.text, testCase.pattern) - if testCase.matched != actualResult { - t.Errorf("Test %d: Expected the result to be `%v`, but instead found it to be `%v`", i+1, testCase.matched, actualResult) - } - } -} -func TestRandomInput(t *testing.T) { - rand.Seed(time.Now().UnixNano()) - b1 := make([]byte, 100) - b2 := make([]byte, 100) - for i := 0; i < 1000000; i++ { - if _, err := rand.Read(b1); err != nil { - t.Fatal(err) - } - if _, err := rand.Read(b2); err != nil { - t.Fatal(err) - } - Match(string(b1), string(b2)) - } -} -func testAllowable(pattern, exmin, exmax string) error { - min, max := Allowable(pattern) - if min != exmin || max != exmax { - return fmt.Errorf("expected '%v'/'%v', got '%v'/'%v'", - exmin, exmax, min, max) - } - return nil -} -func TestAllowable(t *testing.T) { - if err := testAllowable("hell*", "hell", "helm"); err != nil { - t.Fatal(err) - } - if err := testAllowable("hell?", "hell"+string(0), "hell"+string(utf8.MaxRune)); err != nil { - t.Fatal(err) - } - if err := testAllowable("h解æžell*", "h解æžell", "h解æželm"); err != nil { - t.Fatal(err) - } - if err := testAllowable("h解*ell*", "h解", "h觤"); err != nil { - t.Fatal(err) - } -} - -func TestIsPattern(t *testing.T) { - patterns := []string{ - "*", "hello*", "hello*world", "*world", - "?", "hello?", "hello?world", "?world", - } - nonPatterns := []string{ - "", "hello", - } - for _, pattern := range patterns { - if !IsPattern(pattern) { - t.Fatalf("expected true") - } - } - - for _, s := range nonPatterns { - if IsPattern(s) { - t.Fatalf("expected false") - } - } -} -func BenchmarkAscii(t *testing.B) { - for i := 0; i < t.N; i++ { - if !Match("hello", "hello") { - t.Fatal("fail") - } - } -} - -func BenchmarkUnicode(t *testing.B) { - for i := 0; i < t.N; i++ { - if !Match("h情llo", "h情llo") { - t.Fatal("fail") - } - } -} diff --git a/src/imagemagick/vendor/github.com/tidwall/pretty/.travis.yml b/src/imagemagick/vendor/github.com/tidwall/pretty/.travis.yml deleted file mode 100644 index 4f2ee4d..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/pretty/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -language: go diff --git a/src/imagemagick/vendor/github.com/tidwall/pretty/LICENSE b/src/imagemagick/vendor/github.com/tidwall/pretty/LICENSE deleted file mode 100644 index 993b83f..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/pretty/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Josh Baker - -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 --git a/src/imagemagick/vendor/github.com/tidwall/pretty/README.md b/src/imagemagick/vendor/github.com/tidwall/pretty/README.md deleted file mode 100644 index d2b8864..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/pretty/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# Pretty -[![Build Status](https://img.shields.io/travis/tidwall/pretty.svg?style=flat-square)](https://travis-ci.org/tidwall/prettty) -[![Coverage Status](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat-square)](http://gocover.io/github.com/tidwall/pretty) -[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/tidwall/pretty) - - -Pretty is a Go package that provides [fast](#performance) methods for formatting JSON for human readability, or to compact JSON for smaller payloads. - -Getting Started -=============== - -## Installing - -To start using Pretty, install Go and run `go get`: - -```sh -$ go get -u github.com/tidwall/pretty -``` - -This will retrieve the library. - -## Pretty - -Using this example: - -```json -{"name": {"first":"Tom","last":"Anderson"}, "age":37, -"children": ["Sara","Alex","Jack"], -"fav.movie": "Deer Hunter", "friends": [ - {"first": "Janet", "last": "Murphy", "age": 44} - ]} -``` - -The following code: -```go -result = pretty.Pretty(example) -``` - -Will format the json to: - -```json -{ - "name": { - "first": "Tom", - "last": "Anderson" - }, - "age": 37, - "children": ["Sara", "Alex", "Jack"], - "fav.movie": "Deer Hunter", - "friends": [ - { - "first": "Janet", - "last": "Murphy", - "age": 44 - } - ] -} -``` - -## Color - -Color will colorize the json for outputing to the screen. - -```json -result = pretty.Color(json, nil) -``` - -Will add color to the result for printing to the terminal. -The second param is used for a customizing the style, and passing nil will use the default `pretty.TerminalStyle`. - -## Ugly - -The following code: -```go -result = pretty.Ugly(example) -``` - -Will format the json to: - -```json -{"name":{"first":"Tom","last":"Anderson"},"age":37,"children":["Sara","Alex","Jack"],"fav.movie":"Deer Hunter","friends":[{"first":"Janet","last":"Murphy","age":44}]}``` -``` - - -## Customized output - -There's a `PrettyOptions(json, opts)` function which allows for customizing the output with the following options: - -```go -type Options struct { - // Width is an max column width for single line arrays - // Default is 80 - Width int - // Prefix is a prefix for all lines - // Default is an empty string - Prefix string - // Indent is the nested indentation - // Default is two spaces - Indent string - // SortKeys will sort the keys alphabetically - // Default is false - SortKeys bool -} -``` -## Performance - -Benchmarks of Pretty alongside the builtin `encoding/json` Indent/Compact methods. -``` -BenchmarkPretty-8 1000000 1283 ns/op 720 B/op 2 allocs/op -BenchmarkUgly-8 3000000 426 ns/op 240 B/op 1 allocs/op -BenchmarkUglyInPlace-8 5000000 340 ns/op 0 B/op 0 allocs/op -BenchmarkJSONIndent-8 300000 4628 ns/op 1069 B/op 4 allocs/op -BenchmarkJSONCompact-8 1000000 2469 ns/op 758 B/op 4 allocs/op -``` - -*These benchmarks were run on a MacBook Pro 15" 2.8 GHz Intel Core i7 using Go 1.7.* - -## Contact -Josh Baker [@tidwall](http://twitter.com/tidwall) - -## License - -Pretty source code is available under the MIT [License](/LICENSE). - diff --git a/src/imagemagick/vendor/github.com/tidwall/pretty/pretty.go b/src/imagemagick/vendor/github.com/tidwall/pretty/pretty.go deleted file mode 100644 index 0a922d0..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/pretty/pretty.go +++ /dev/null @@ -1,432 +0,0 @@ -package pretty - -import ( - "sort" -) - -// Options is Pretty options -type Options struct { - // Width is an max column width for single line arrays - // Default is 80 - Width int - // Prefix is a prefix for all lines - // Default is an empty string - Prefix string - // Indent is the nested indentation - // Default is two spaces - Indent string - // SortKeys will sort the keys alphabetically - // Default is false - SortKeys bool -} - -// DefaultOptions is the default options for pretty formats. -var DefaultOptions = &Options{Width: 80, Prefix: "", Indent: " ", SortKeys: false} - -// Pretty converts the input json into a more human readable format where each -// element is on it's own line with clear indentation. -func Pretty(json []byte) []byte { return PrettyOptions(json, nil) } - -// PrettyOptions is like Pretty but with customized options. -func PrettyOptions(json []byte, opts *Options) []byte { - if opts == nil { - opts = DefaultOptions - } - buf := make([]byte, 0, len(json)) - if len(opts.Prefix) != 0 { - buf = append(buf, opts.Prefix...) - } - buf, _, _, _ = appendPrettyAny(buf, json, 0, true, - opts.Width, opts.Prefix, opts.Indent, opts.SortKeys, - 0, 0, -1) - if len(buf) > 0 { - buf = append(buf, '\n') - } - return buf -} - -// Ugly removes insignificant space characters from the input json byte slice -// and returns the compacted result. -func Ugly(json []byte) []byte { - buf := make([]byte, 0, len(json)) - return ugly(buf, json) -} - -// UglyInPlace removes insignificant space characters from the input json -// byte slice and returns the compacted result. This method reuses the -// input json buffer to avoid allocations. Do not use the original bytes -// slice upon return. -func UglyInPlace(json []byte) []byte { return ugly(json, json) } - -func ugly(dst, src []byte) []byte { - dst = dst[:0] - for i := 0; i < len(src); i++ { - if src[i] > ' ' { - dst = append(dst, src[i]) - if src[i] == '"' { - for i = i + 1; i < len(src); i++ { - dst = append(dst, src[i]) - if src[i] == '"' { - j := i - 1 - for ; ; j-- { - if src[j] != '\\' { - break - } - } - if (j-i)%2 != 0 { - break - } - } - } - } - } - } - return dst -} - -func appendPrettyAny(buf, json []byte, i int, pretty bool, width int, prefix, indent string, sortkeys bool, tabs, nl, max int) ([]byte, int, int, bool) { - for ; i < len(json); i++ { - if json[i] <= ' ' { - continue - } - if json[i] == '"' { - return appendPrettyString(buf, json, i, nl) - } - if (json[i] >= '0' && json[i] <= '9') || json[i] == '-' { - return appendPrettyNumber(buf, json, i, nl) - } - if json[i] == '{' { - return appendPrettyObject(buf, json, i, '{', '}', pretty, width, prefix, indent, sortkeys, tabs, nl, max) - } - if json[i] == '[' { - return appendPrettyObject(buf, json, i, '[', ']', pretty, width, prefix, indent, sortkeys, tabs, nl, max) - } - switch json[i] { - case 't': - return append(buf, 't', 'r', 'u', 'e'), i + 4, nl, true - case 'f': - return append(buf, 'f', 'a', 'l', 's', 'e'), i + 5, nl, true - case 'n': - return append(buf, 'n', 'u', 'l', 'l'), i + 4, nl, true - } - } - return buf, i, nl, true -} - -type pair struct { - kstart, kend int - vstart, vend int -} - -type byKey struct { - sorted bool - json []byte - pairs []pair -} - -func (arr *byKey) Len() int { - return len(arr.pairs) -} -func (arr *byKey) Less(i, j int) bool { - key1 := arr.json[arr.pairs[i].kstart+1 : arr.pairs[i].kend-1] - key2 := arr.json[arr.pairs[j].kstart+1 : arr.pairs[j].kend-1] - return string(key1) < string(key2) -} -func (arr *byKey) Swap(i, j int) { - arr.pairs[i], arr.pairs[j] = arr.pairs[j], arr.pairs[i] - arr.sorted = true -} - -func appendPrettyObject(buf, json []byte, i int, open, close byte, pretty bool, width int, prefix, indent string, sortkeys bool, tabs, nl, max int) ([]byte, int, int, bool) { - var ok bool - if width > 0 { - if pretty && open == '[' && max == -1 { - // here we try to create a single line array - max := width - (len(buf) - nl) - if max > 3 { - s1, s2 := len(buf), i - buf, i, _, ok = appendPrettyObject(buf, json, i, '[', ']', false, width, prefix, "", sortkeys, 0, 0, max) - if ok && len(buf)-s1 <= max { - return buf, i, nl, true - } - buf = buf[:s1] - i = s2 - } - } else if max != -1 && open == '{' { - return buf, i, nl, false - } - } - buf = append(buf, open) - i++ - var pairs []pair - if open == '{' && sortkeys { - pairs = make([]pair, 0, 8) - } - var n int - for ; i < len(json); i++ { - if json[i] <= ' ' { - continue - } - if json[i] == close { - if pretty { - if open == '{' && sortkeys { - buf = sortPairs(json, buf, pairs) - } - if n > 0 { - nl = len(buf) - buf = append(buf, '\n') - } - if buf[len(buf)-1] != open { - buf = appendTabs(buf, prefix, indent, tabs) - } - } - buf = append(buf, close) - return buf, i + 1, nl, open != '{' - } - if open == '[' || json[i] == '"' { - if n > 0 { - buf = append(buf, ',') - if width != -1 && open == '[' { - buf = append(buf, ' ') - } - } - var p pair - if pretty { - nl = len(buf) - buf = append(buf, '\n') - if open == '{' && sortkeys { - p.kstart = i - p.vstart = len(buf) - } - buf = appendTabs(buf, prefix, indent, tabs+1) - } - if open == '{' { - buf, i, nl, _ = appendPrettyString(buf, json, i, nl) - if sortkeys { - p.kend = i - } - buf = append(buf, ':') - if pretty { - buf = append(buf, ' ') - } - } - buf, i, nl, ok = appendPrettyAny(buf, json, i, pretty, width, prefix, indent, sortkeys, tabs+1, nl, max) - if max != -1 && !ok { - return buf, i, nl, false - } - if pretty && open == '{' && sortkeys { - p.vend = len(buf) - if p.kstart > p.kend || p.vstart > p.vend { - // bad data. disable sorting - sortkeys = false - } else { - pairs = append(pairs, p) - } - } - i-- - n++ - } - } - return buf, i, nl, open != '{' -} -func sortPairs(json, buf []byte, pairs []pair) []byte { - if len(pairs) == 0 { - return buf - } - vstart := pairs[0].vstart - vend := pairs[len(pairs)-1].vend - arr := byKey{false, json, pairs} - sort.Sort(&arr) - if !arr.sorted { - return buf - } - nbuf := make([]byte, 0, vend-vstart) - for i, p := range pairs { - nbuf = append(nbuf, buf[p.vstart:p.vend]...) - if i < len(pairs)-1 { - nbuf = append(nbuf, ',') - nbuf = append(nbuf, '\n') - } - } - return append(buf[:vstart], nbuf...) -} - -func appendPrettyString(buf, json []byte, i, nl int) ([]byte, int, int, bool) { - s := i - i++ - for ; i < len(json); i++ { - if json[i] == '"' { - var sc int - for j := i - 1; j > s; j-- { - if json[j] == '\\' { - sc++ - } else { - break - } - } - if sc%2 == 1 { - continue - } - i++ - break - } - } - return append(buf, json[s:i]...), i, nl, true -} - -func appendPrettyNumber(buf, json []byte, i, nl int) ([]byte, int, int, bool) { - s := i - i++ - for ; i < len(json); i++ { - if json[i] <= ' ' || json[i] == ',' || json[i] == ':' || json[i] == ']' || json[i] == '}' { - break - } - } - return append(buf, json[s:i]...), i, nl, true -} - -func appendTabs(buf []byte, prefix, indent string, tabs int) []byte { - if len(prefix) != 0 { - buf = append(buf, prefix...) - } - if len(indent) == 2 && indent[0] == ' ' && indent[1] == ' ' { - for i := 0; i < tabs; i++ { - buf = append(buf, ' ', ' ') - } - } else { - for i := 0; i < tabs; i++ { - buf = append(buf, indent...) - } - } - return buf -} - -// Style is the color style -type Style struct { - Key, String, Number [2]string - True, False, Null [2]string - Append func(dst []byte, c byte) []byte -} - -func hexp(p byte) byte { - switch { - case p < 10: - return p + '0' - default: - return (p - 10) + 'a' - } -} - -// TerminalStyle is for terminals -var TerminalStyle = &Style{ - Key: [2]string{"\x1B[94m", "\x1B[0m"}, - String: [2]string{"\x1B[92m", "\x1B[0m"}, - Number: [2]string{"\x1B[93m", "\x1B[0m"}, - True: [2]string{"\x1B[96m", "\x1B[0m"}, - False: [2]string{"\x1B[96m", "\x1B[0m"}, - Null: [2]string{"\x1B[91m", "\x1B[0m"}, - Append: func(dst []byte, c byte) []byte { - if c < ' ' && (c != '\r' && c != '\n' && c != '\t' && c != '\v') { - dst = append(dst, "\\u00"...) - dst = append(dst, hexp((c>>4)&0xF)) - return append(dst, hexp((c)&0xF)) - } - return append(dst, c) - }, -} - -// Color will colorize the json. The style parma is used for customizing -// the colors. Passing nil to the style param will use the default -// TerminalStyle. -func Color(src []byte, style *Style) []byte { - if style == nil { - style = TerminalStyle - } - apnd := style.Append - if apnd == nil { - apnd = func(dst []byte, c byte) []byte { - return append(dst, c) - } - } - type stackt struct { - kind byte - key bool - } - var dst []byte - var stack []stackt - for i := 0; i < len(src); i++ { - if src[i] == '"' { - key := len(stack) > 0 && stack[len(stack)-1].key - if key { - dst = append(dst, style.Key[0]...) - } else { - dst = append(dst, style.String[0]...) - } - dst = apnd(dst, '"') - for i = i + 1; i < len(src); i++ { - dst = apnd(dst, src[i]) - if src[i] == '"' { - j := i - 1 - for ; ; j-- { - if src[j] != '\\' { - break - } - } - if (j-i)%2 != 0 { - break - } - } - } - if key { - dst = append(dst, style.Key[1]...) - } else { - dst = append(dst, style.String[1]...) - } - } else if src[i] == '{' || src[i] == '[' { - stack = append(stack, stackt{src[i], src[i] == '{'}) - dst = apnd(dst, src[i]) - } else if (src[i] == '}' || src[i] == ']') && len(stack) > 0 { - stack = stack[:len(stack)-1] - dst = apnd(dst, src[i]) - } else if (src[i] == ':' || src[i] == ',') && len(stack) > 0 && stack[len(stack)-1].kind == '{' { - stack[len(stack)-1].key = !stack[len(stack)-1].key - dst = apnd(dst, src[i]) - } else { - var kind byte - if (src[i] >= '0' && src[i] <= '9') || src[i] == '-' { - kind = '0' - dst = append(dst, style.Number[0]...) - } else if src[i] == 't' { - kind = 't' - dst = append(dst, style.True[0]...) - } else if src[i] == 'f' { - kind = 'f' - dst = append(dst, style.False[0]...) - } else if src[i] == 'n' { - kind = 'n' - dst = append(dst, style.Null[0]...) - } else { - dst = apnd(dst, src[i]) - } - if kind != 0 { - for ; i < len(src); i++ { - if src[i] <= ' ' || src[i] == ',' || src[i] == ':' || src[i] == ']' || src[i] == '}' { - i-- - break - } - dst = apnd(dst, src[i]) - } - if kind == '0' { - dst = append(dst, style.Number[1]...) - } else if kind == 't' { - dst = append(dst, style.True[1]...) - } else if kind == 'f' { - dst = append(dst, style.False[1]...) - } else if kind == 'n' { - dst = append(dst, style.Null[1]...) - } - } - } - } - return dst -} diff --git a/src/imagemagick/vendor/github.com/tidwall/pretty/pretty_test.go b/src/imagemagick/vendor/github.com/tidwall/pretty/pretty_test.go deleted file mode 100644 index b9602b2..0000000 --- a/src/imagemagick/vendor/github.com/tidwall/pretty/pretty_test.go +++ /dev/null @@ -1,432 +0,0 @@ -package pretty - -import ( - "bytes" - gojson "encoding/json" - "fmt" - "math/rand" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func j(json interface{}) string { - var v interface{} - if err := gojson.Unmarshal([]byte(fmt.Sprintf("%s", json)), &v); err != nil { - fmt.Printf(">>%s<<\n", json) - panic(err) - } - data, err := gojson.Marshal(v) - if err != nil { - panic(err) - } - return string(data) -} - -var example1 = []byte(` -{ - "name": { - "last": "Sanders", - "first": "Janet" - }, - "children": [ - "Andy", "Carol", "Mike" - ], - "values": [ - 10.10, true, false, null, "hello", {} - ], - "values2": {}, - "values3": [], - "deep": {"deep":{"deep":[1,2,3,4,5]}} -} -`) - -var example2 = `[ 0, 10, 10.10, true, false, null, "hello \" "]` - -func TestPretty(t *testing.T) { - pretty := Pretty(Ugly(Pretty([]byte(example1)))) - assert.Equal(t, j(pretty), j(pretty)) - assert.Equal(t, j(example1), j(pretty)) - pretty = Pretty(Ugly(Pretty([]byte(example2)))) - assert.Equal(t, j(pretty), j(pretty)) - assert.Equal(t, j(example2), j(pretty)) - pretty = Pretty([]byte(" ")) - assert.Equal(t, "", string(pretty)) - opts := *DefaultOptions - opts.SortKeys = true - pretty = PrettyOptions(Ugly(Pretty([]byte(example2))), &opts) - assert.Equal(t, j(pretty), j(pretty)) - assert.Equal(t, j(example2), j(pretty)) -} - -func TestUgly(t *testing.T) { - ugly := Ugly([]byte(example1)) - var buf bytes.Buffer - err := gojson.Compact(&buf, []byte(example1)) - assert.Equal(t, nil, err) - assert.Equal(t, buf.Bytes(), ugly) - ugly = UglyInPlace(ugly) - assert.Equal(t, nil, err) - assert.Equal(t, buf.Bytes(), ugly) -} - -func TestRandom(t *testing.T) { - rand.Seed(time.Now().UnixNano()) - for i := 0; i < 100000; i++ { - b := make([]byte, 1024) - rand.Read(b) - Pretty(b) - Ugly(b) - } -} -func TestBig(t *testing.T) { - json := `[ - { - "_id": "58d19e070f4898817162964a", - "index": "", - "guid": "65d46c3e-9d3a-4bfe-bab2-252f36a53c6b", - "isActive": false, - "balance": "$1,064.00", - "picture": "http://placehold.it/32x32", - "age": 37, - "eyeColor": "brown", - "name": "Chan Orr", - "gender": "male", - "company": "SURETECH", - "email": "chanorr@suretech.com", - "phone": "+1 (808) 496-3754", - "address": "792 Bushwick Place, Glenbrook, Vermont, 9893", - "about": "Amet consequat eu enim laboris cillum ad laboris in quis laboris reprehenderit. Eu deserunt occaecat dolore eu veniam non dolore et magna ex incididunt. Ea dolor laboris ex officia culpa laborum amet adipisicing laboris tempor magna elit mollit ad. Tempor ex aliqua mollit enim laboris sunt fugiat. Sint sunt ex est non dolore consectetur culpa ullamco id dolor nulla labore. Sunt duis fugiat cupidatat sunt deserunt qui aute elit consequat sint cupidatat. Consequat ullamco aliqua nulla velit tempor aute.\r\n", - "registered": "2014-08-04T04:09:10 +07:00", - "latitude": 80.707807, - "longitude": 18.857548, - "tags": [ - "consectetur", - "est", - "cupidatat", - "nisi", - "incididunt", - "aliqua", - "ullamco" - ], - "friends": [ - { - "id": 0, - "name": "Little Edwards" - }, - { - "id": 1, - "name": "Gay Johns" - }, - { - "id": 2, - "name": "Hoover Noble" - } - ], - "greeting": "Hello, Chan Orr! You have 3 unread messages.", - "favoriteFruit": "banana" - }, - { - "_id": "58d19e07c2119248f8fa11ff", - "index": "", - "guid": "b362f0a0-d1ed-4b94-9d6b-213712620a20", - "isActive": false, - "balance": "$1,321.26", - "picture": "http://placehold.it/32x32", - "age": 28, - "eyeColor": "blue", - "name": "Molly Hyde", - "gender": "female", - "company": "QUALITEX", - "email": "mollyhyde@qualitex.com", - "phone": "+1 (849) 455-2934", - "address": "440 Visitation Place, Bridgetown, Palau, 5053", - "about": "Ipsum reprehenderit nulla est nostrud ad incididunt officia in commodo id esse id. Ullamco ullamco commodo mollit ut id cupidatat veniam nostrud minim duis qui sit. Occaecat esse nostrud velit qui non dolor proident. Ipsum ipsum anim non mollit minim voluptate amet irure in. Sunt commodo occaecat aute ullamco sunt fugiat laboris culpa Lorem anim. Aliquip tempor excepteur labore aute deserunt consectetur incididunt aute eu est ullamco consectetur excepteur. Sunt sint consequat cupidatat nisi exercitation minim enim occaecat esse ex amet ex non.\r\n", - "registered": "2014-09-12T08:51:11 +07:00", - "latitude": 15.867177, - "longitude": 165.862595, - "tags": [ - "enim", - "sint", - "elit", - "laborum", - "elit", - "cupidatat", - "ipsum" - ], - "friends": [ - { - "id": 0, - "name": "Holmes Hurley" - }, - { - "id": 1, - "name": "Rhoda Spencer" - }, - { - "id": 2, - "name": "Tommie Gallegos" - } - ], - "greeting": "Hello, Molly Hyde! You have 10 unread messages.", - "favoriteFruit": "banana" - }, - { - "_id": "58d19e07fc27eedd9159d710", - "index": "", - "guid": "1d343fd3-44f7-4246-a5e6-a9297afb3146", - "isActive": false, - "balance": "$1,459.65", - "picture": "http://placehold.it/32x32", - "age": 26, - "eyeColor": "brown", - "name": "Jaime Kennedy", - "gender": "female", - "company": "RECRITUBE", - "email": "jaimekennedy@recritube.com", - "phone": "+1 (983) 483-3522", - "address": "997 Vanderveer Street, Alamo, Marshall Islands, 4767", - "about": "Qui consequat veniam ex enim excepteur aliqua dolor duis Lorem deserunt. Lorem occaecat laboris quis nisi Lorem aute exercitation consectetur officia velit aliqua aliquip commodo. Tempor irure ad ipsum aliquip. Incididunt mollit aute cillum non magna duis officia anim laboris deserunt voluptate.\r\n", - "registered": "2015-08-31T06:51:25 +07:00", - "latitude": -7.486839, - "longitude": 57.659287, - "tags": [ - "veniam", - "aliqua", - "aute", - "amet", - "laborum", - "quis", - "sint" - ], - "friends": [ - { - "id": 0, - "name": "Brown Christensen" - }, - { - "id": 1, - "name": "Robyn Whitehead" - }, - { - "id": 2, - "name": "Dolly Weaver" - } - ], - "greeting": "Hello, Jaime Kennedy! You have 3 unread messages.", - "favoriteFruit": "banana" - }, - { - "_id": "58d19e0783c362da4b71240d", - "index": "", - "guid": "dbe60229-60d2-4879-82f3-d9aca0baaf6f", - "isActive": false, - "balance": "$3,221.63", - "picture": "http://placehold.it/32x32", - "age": 32, - "eyeColor": "green", - "name": "Cherie Vinson", - "gender": "female", - "company": "SLAX", - "email": "cherievinson@slax.com", - "phone": "+1 (905) 474-3132", - "address": "563 Macdougal Street, Navarre, New York, 8733", - "about": "Ad laborum et magna quis veniam duis magna consectetur mollit in minim non officia aliquip. Ullamco dolor qui consectetur adipisicing. Incididunt ad ad incididunt duis velit laboris. Reprehenderit ullamco magna quis exercitation excepteur nisi labore pariatur laborum consequat eu laboris amet velit. Et dolore aliqua proident sunt dolore incididunt dolore fugiat ipsum tempor occaecat.\r\n", - "registered": "2015-03-19T08:48:47 +07:00", - "latitude": -56.480034, - "longitude": -59.894094, - "tags": [ - "irure", - "commodo", - "quis", - "cillum", - "quis", - "nulla", - "irure" - ], - "friends": [ - { - "id": 0, - "name": "Danielle Mullins" - }, - { - "id": 1, - "name": "Maxine Peters" - }, - { - "id": 2, - "name": "Francine James" - } - ], - "greeting": "Hello, Cherie Vinson! You have 1 unread messages.", - "favoriteFruit": "apple" - }, - { - "_id": "58d19e07b8f1ea8e3451870d", - "index": "", - "guid": "91fd9527-770c-4006-a0ed-64ca0d819199", - "isActive": true, - "balance": "$2,387.38", - "picture": "http://placehold.it/32x32", - "age": 37, - "eyeColor": "blue", - "name": "Glenna Hanson", - "gender": "female", - "company": "ACUMENTOR", - "email": "glennahanson@acumentor.com", - "phone": "+1 (965) 564-3926", - "address": "323 Seigel Street, Rosedale, Florida, 2700", - "about": "Commodo id ex velit nulla incididunt occaecat aliquip ullamco consequat est. Esse officia adipisicing magna et et incididunt sit deserunt ex mollit id. Laborum proident sit sit duis proident cillum irure aliquip et commodo.\r\n", - "registered": "2014-06-29T02:48:04 +07:00", - "latitude": -6.141759, - "longitude": 155.991532, - "tags": [ - "amet", - "pariatur", - "culpa", - "eu", - "commodo", - "magna", - "excepteur" - ], - "friends": [ - { - "id": 0, - "name": "Blanchard Blackburn" - }, - { - "id": 1, - "name": "Ayers Guy" - }, - { - "id": 2, - "name": "Powers Salinas" - } - ], - "greeting": "Hello, Glenna Hanson! You have 4 unread messages.", - "favoriteFruit": "strawberry" - }, - { - "_id": "58d19e07f1ad063dac8b72dc", - "index": "", - "guid": "9b8c6cef-cfcd-4e6d-85e4-fe2e6920ec31", - "isActive": true, - "balance": "$1,828.58", - "picture": "http://placehold.it/32x32", - "age": 29, - "eyeColor": "green", - "name": "Hays Shields", - "gender": "male", - "company": "ISOLOGICA", - "email": "haysshields@isologica.com", - "phone": "+1 (882) 469-3201", - "address": "574 Columbus Place, Singer, Georgia, 8716", - "about": "Consectetur et adipisicing ad quis incididunt qui labore et ex elit esse. Ad elit officia ullamco dolor reprehenderit. Sunt nisi ullamco mollit incididunt consectetur nostrud anim adipisicing ullamco aliqua eiusmod ad. Et excepteur voluptate adipisicing velit id quis duis Lorem id deserunt esse irure Lorem. Est irure sint Lorem aliqua adipisicing velit irure Lorem. Ex in culpa laborum nostrud esse eu laboris velit. Anim excepteur ex ipsum amet nostrud cillum.\r\n", - "registered": "2014-02-10T07:17:14 +07:00", - "latitude": -66.354543, - "longitude": 138.400461, - "tags": [ - "mollit", - "labore", - "id", - "labore", - "dolor", - "in", - "elit" - ], - "friends": [ - { - "id": 0, - "name": "Mendoza Craig" - }, - { - "id": 1, - "name": "Rowena Carey" - }, - { - "id": 2, - "name": "Barry Francis" - } - ], - "greeting": "Hello, Hays Shields! You have 10 unread messages.", - "favoriteFruit": "strawberry" - } -]` - - opts := *DefaultOptions - opts.SortKeys = true - jsonb := PrettyOptions(Ugly([]byte(json)), &opts) - assert.Equal(t, j(jsonb), j(json)) -} - -func TestColor(t *testing.T) { - res := Color(Pretty([]byte(` -{"hello":"world","what":123, -"arr":["1","2",1,2,true,false,null], -"obj":{"key1":null,"ar`+"\x1B[36m"+`Cyanr2":[1,2,3,"123","456"]}} - `)), nil) - if string(res) != `{ - "hello": "world", - "what": 123, - "arr": ["1", "2", 1, 2, true, false, null], - "obj": { - "key1": null, - "ar\u001b[36mCyanr2": [1, 2, 3, "123", "456"] - } -} -` { - t.Fatal("invalid output") - } -} - -func BenchmarkPretty(t *testing.B) { - t.ReportAllocs() - t.ResetTimer() - for i := 0; i < t.N; i++ { - Pretty(example1) - } -} - -func BenchmarkPrettySortKeys(t *testing.B) { - opts := *DefaultOptions - opts.SortKeys = true - t.ReportAllocs() - t.ResetTimer() - for i := 0; i < t.N; i++ { - PrettyOptions(example1, &opts) - } -} -func BenchmarkUgly(t *testing.B) { - t.ReportAllocs() - t.ResetTimer() - for i := 0; i < t.N; i++ { - Ugly(example1) - } -} - -func BenchmarkUglyInPlace(t *testing.B) { - example2 := []byte(string(example1)) - t.ReportAllocs() - t.ResetTimer() - for i := 0; i < t.N; i++ { - UglyInPlace(example2) - } -} -func BenchmarkJSONIndent(t *testing.B) { - var dst bytes.Buffer - t.ReportAllocs() - t.ResetTimer() - for i := 0; i < t.N; i++ { - gojson.Indent(&dst, example1, "", " ") - } -} - -func BenchmarkJSONCompact(t *testing.B) { - var dst bytes.Buffer - t.ReportAllocs() - t.ResetTimer() - for i := 0; i < t.N; i++ { - gojson.Compact(&dst, example1) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/.gitattributes b/src/imagemagick/vendor/golang.org/x/net/.gitattributes deleted file mode 100644 index d2f212e..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/.gitattributes +++ /dev/null @@ -1,10 +0,0 @@ -# Treat all files in this repo as binary, with no git magic updating -# line endings. Windows users contributing to Go will need to use a -# modern version of git and editors capable of LF line endings. -# -# We'll prevent accidental CRLF line endings from entering the repo -# via the git-review gofmt checks. -# -# See golang.org/issue/9281 - -* -text diff --git a/src/imagemagick/vendor/golang.org/x/net/.gitignore b/src/imagemagick/vendor/golang.org/x/net/.gitignore deleted file mode 100644 index 8339fd6..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Add no patterns to .hgignore except for files generated by the build. -last-change diff --git a/src/imagemagick/vendor/golang.org/x/net/CONTRIBUTING.md b/src/imagemagick/vendor/golang.org/x/net/CONTRIBUTING.md deleted file mode 100644 index d0485e8..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# Contributing to Go - -Go is an open source project. - -It is the work of hundreds of contributors. We appreciate your help! - -## Filing issues - -When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: - -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? - -General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. -The gophers there will answer or ask you to file an issue if you've tripped over a bug. - -## Contributing code - -Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) -before sending patches. - -Unless otherwise noted, the Go source files are distributed under -the BSD-style license found in the LICENSE file. diff --git a/src/imagemagick/vendor/golang.org/x/net/README.md b/src/imagemagick/vendor/golang.org/x/net/README.md deleted file mode 100644 index 00a9b6e..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Go Networking - -This repository holds supplementary Go networking libraries. - -## Download/Install - -The easiest way to install is to run `go get -u golang.org/x/net`. You can -also manually git clone the repository to `$GOPATH/src/golang.org/x/net`. - -## Report Issues / Send Patches - -This repository uses Gerrit for code changes. To learn how to submit -changes to this repository, see https://golang.org/doc/contribute.html. -The main issue tracker for the net repository is located at -https://github.com/golang/go/issues. Prefix your issue with "x/net:" in the -subject line, so it is easy to find. diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/asm.go b/src/imagemagick/vendor/golang.org/x/net/bpf/asm.go deleted file mode 100644 index 15e21b1..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/asm.go +++ /dev/null @@ -1,41 +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 bpf - -import "fmt" - -// Assemble converts insts into raw instructions suitable for loading -// into a BPF virtual machine. -// -// Currently, no optimization is attempted, the assembled program flow -// is exactly as provided. -func Assemble(insts []Instruction) ([]RawInstruction, error) { - ret := make([]RawInstruction, len(insts)) - var err error - for i, inst := range insts { - ret[i], err = inst.Assemble() - if err != nil { - return nil, fmt.Errorf("assembling instruction %d: %s", i+1, err) - } - } - return ret, nil -} - -// Disassemble attempts to parse raw back into -// Instructions. Unrecognized RawInstructions are assumed to be an -// extension not implemented by this package, and are passed through -// unchanged to the output. The allDecoded value reports whether insts -// contains no RawInstructions. -func Disassemble(raw []RawInstruction) (insts []Instruction, allDecoded bool) { - insts = make([]Instruction, len(raw)) - allDecoded = true - for i, r := range raw { - insts[i] = r.Disassemble() - if _, ok := insts[i].(RawInstruction); ok { - allDecoded = false - } - } - return insts, allDecoded -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/constants.go b/src/imagemagick/vendor/golang.org/x/net/bpf/constants.go deleted file mode 100644 index 12f3ee8..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/constants.go +++ /dev/null @@ -1,222 +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 bpf - -// A Register is a register of the BPF virtual machine. -type Register uint16 - -const ( - // RegA is the accumulator register. RegA is always the - // destination register of ALU operations. - RegA Register = iota - // RegX is the indirection register, used by LoadIndirect - // operations. - RegX -) - -// An ALUOp is an arithmetic or logic operation. -type ALUOp uint16 - -// ALU binary operation types. -const ( - ALUOpAdd ALUOp = iota << 4 - ALUOpSub - ALUOpMul - ALUOpDiv - ALUOpOr - ALUOpAnd - ALUOpShiftLeft - ALUOpShiftRight - aluOpNeg // Not exported because it's the only unary ALU operation, and gets its own instruction type. - ALUOpMod - ALUOpXor -) - -// A JumpTest is a comparison operator used in conditional jumps. -type JumpTest uint16 - -// Supported operators for conditional jumps. -// K can be RegX for JumpIfX -const ( - // K == A - JumpEqual JumpTest = iota - // K != A - JumpNotEqual - // K > A - JumpGreaterThan - // K < A - JumpLessThan - // K >= A - JumpGreaterOrEqual - // K <= A - JumpLessOrEqual - // K & A != 0 - JumpBitsSet - // K & A == 0 - JumpBitsNotSet -) - -// An Extension is a function call provided by the kernel that -// performs advanced operations that are expensive or impossible -// within the BPF virtual machine. -// -// Extensions are only implemented by the Linux kernel. -// -// TODO: should we prune this list? Some of these extensions seem -// either broken or near-impossible to use correctly, whereas other -// (len, random, ifindex) are quite useful. -type Extension int - -// Extension functions available in the Linux kernel. -const ( - // extOffset is the negative maximum number of instructions used - // to load instructions by overloading the K argument. - extOffset = -0x1000 - // ExtLen returns the length of the packet. - ExtLen Extension = 1 - // ExtProto returns the packet's L3 protocol type. - ExtProto Extension = 0 - // ExtType returns the packet's type (skb->pkt_type in the kernel) - // - // TODO: better documentation. How nice an API do we want to - // provide for these esoteric extensions? - ExtType Extension = 4 - // ExtPayloadOffset returns the offset of the packet payload, or - // the first protocol header that the kernel does not know how to - // parse. - ExtPayloadOffset Extension = 52 - // ExtInterfaceIndex returns the index of the interface on which - // the packet was received. - ExtInterfaceIndex Extension = 8 - // ExtNetlinkAttr returns the netlink attribute of type X at - // offset A. - ExtNetlinkAttr Extension = 12 - // ExtNetlinkAttrNested returns the nested netlink attribute of - // type X at offset A. - ExtNetlinkAttrNested Extension = 16 - // ExtMark returns the packet's mark value. - ExtMark Extension = 20 - // ExtQueue returns the packet's assigned hardware queue. - ExtQueue Extension = 24 - // ExtLinkLayerType returns the packet's hardware address type - // (e.g. Ethernet, Infiniband). - ExtLinkLayerType Extension = 28 - // ExtRXHash returns the packets receive hash. - // - // TODO: figure out what this rxhash actually is. - ExtRXHash Extension = 32 - // ExtCPUID returns the ID of the CPU processing the current - // packet. - ExtCPUID Extension = 36 - // ExtVLANTag returns the packet's VLAN tag. - ExtVLANTag Extension = 44 - // ExtVLANTagPresent returns non-zero if the packet has a VLAN - // tag. - // - // TODO: I think this might be a lie: it reads bit 0x1000 of the - // VLAN header, which changed meaning in recent revisions of the - // spec - this extension may now return meaningless information. - ExtVLANTagPresent Extension = 48 - // ExtVLANProto returns 0x8100 if the frame has a VLAN header, - // 0x88a8 if the frame has a "Q-in-Q" double VLAN header, or some - // other value if no VLAN information is present. - ExtVLANProto Extension = 60 - // ExtRand returns a uniformly random uint32. - ExtRand Extension = 56 -) - -// The following gives names to various bit patterns used in opcode construction. - -const ( - opMaskCls uint16 = 0x7 - // opClsLoad masks - opMaskLoadDest = 0x01 - opMaskLoadWidth = 0x18 - opMaskLoadMode = 0xe0 - // opClsALU & opClsJump - opMaskOperand = 0x08 - opMaskOperator = 0xf0 -) - -const ( - // +---------------+-----------------+---+---+---+ - // | AddrMode (3b) | LoadWidth (2b) | 0 | 0 | 0 | - // +---------------+-----------------+---+---+---+ - opClsLoadA uint16 = iota - // +---------------+-----------------+---+---+---+ - // | AddrMode (3b) | LoadWidth (2b) | 0 | 0 | 1 | - // +---------------+-----------------+---+---+---+ - opClsLoadX - // +---+---+---+---+---+---+---+---+ - // | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | - // +---+---+---+---+---+---+---+---+ - opClsStoreA - // +---+---+---+---+---+---+---+---+ - // | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | - // +---+---+---+---+---+---+---+---+ - opClsStoreX - // +---------------+-----------------+---+---+---+ - // | Operator (4b) | OperandSrc (1b) | 1 | 0 | 0 | - // +---------------+-----------------+---+---+---+ - opClsALU - // +-----------------------------+---+---+---+---+ - // | TestOperator (4b) | 0 | 1 | 0 | 1 | - // +-----------------------------+---+---+---+---+ - opClsJump - // +---+-------------------------+---+---+---+---+ - // | 0 | 0 | 0 | RetSrc (1b) | 0 | 1 | 1 | 0 | - // +---+-------------------------+---+---+---+---+ - opClsReturn - // +---+-------------------------+---+---+---+---+ - // | 0 | 0 | 0 | TXAorTAX (1b) | 0 | 1 | 1 | 1 | - // +---+-------------------------+---+---+---+---+ - opClsMisc -) - -const ( - opAddrModeImmediate uint16 = iota << 5 - opAddrModeAbsolute - opAddrModeIndirect - opAddrModeScratch - opAddrModePacketLen // actually an extension, not an addressing mode. - opAddrModeMemShift -) - -const ( - opLoadWidth4 uint16 = iota << 3 - opLoadWidth2 - opLoadWidth1 -) - -// Operand for ALU and Jump instructions -type opOperand uint16 - -// Supported operand sources. -const ( - opOperandConstant opOperand = iota << 3 - opOperandX -) - -// An jumpOp is a conditional jump condition. -type jumpOp uint16 - -// Supported jump conditions. -const ( - opJumpAlways jumpOp = iota << 4 - opJumpEqual - opJumpGT - opJumpGE - opJumpSet -) - -const ( - opRetSrcConstant uint16 = iota << 4 - opRetSrcA -) - -const ( - opMiscTAX = 0x00 - opMiscTXA = 0x80 -) diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/doc.go b/src/imagemagick/vendor/golang.org/x/net/bpf/doc.go deleted file mode 100644 index ae62feb..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/doc.go +++ /dev/null @@ -1,82 +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 bpf implements marshaling and unmarshaling of programs for the -Berkeley Packet Filter virtual machine, and provides a Go implementation -of the virtual machine. - -BPF's main use is to specify a packet filter for network taps, so that -the kernel doesn't have to expensively copy every packet it sees to -userspace. However, it's been repurposed to other areas where running -user code in-kernel is needed. For example, Linux's seccomp uses BPF -to apply security policies to system calls. For simplicity, this -documentation refers only to packets, but other uses of BPF have their -own data payloads. - -BPF programs run in a restricted virtual machine. It has almost no -access to kernel functions, and while conditional branches are -allowed, they can only jump forwards, to guarantee that there are no -infinite loops. - -The virtual machine - -The BPF VM is an accumulator machine. Its main register, called -register A, is an implicit source and destination in all arithmetic -and logic operations. The machine also has 16 scratch registers for -temporary storage, and an indirection register (register X) for -indirect memory access. All registers are 32 bits wide. - -Each run of a BPF program is given one packet, which is placed in the -VM's read-only "main memory". LoadAbsolute and LoadIndirect -instructions can fetch up to 32 bits at a time into register A for -examination. - -The goal of a BPF program is to produce and return a verdict (uint32), -which tells the kernel what to do with the packet. In the context of -packet filtering, the returned value is the number of bytes of the -packet to forward to userspace, or 0 to ignore the packet. Other -contexts like seccomp define their own return values. - -In order to simplify programs, attempts to read past the end of the -packet terminate the program execution with a verdict of 0 (ignore -packet). This means that the vast majority of BPF programs don't need -to do any explicit bounds checking. - -In addition to the bytes of the packet, some BPF programs have access -to extensions, which are essentially calls to kernel utility -functions. Currently, the only extensions supported by this package -are the Linux packet filter extensions. - -Examples - -This packet filter selects all ARP packets. - - bpf.Assemble([]bpf.Instruction{ - // Load "EtherType" field from the ethernet header. - bpf.LoadAbsolute{Off: 12, Size: 2}, - // Skip over the next instruction if EtherType is not ARP. - bpf.JumpIf{Cond: bpf.JumpNotEqual, Val: 0x0806, SkipTrue: 1}, - // Verdict is "send up to 4k of the packet to userspace." - bpf.RetConstant{Val: 4096}, - // Verdict is "ignore packet." - bpf.RetConstant{Val: 0}, - }) - -This packet filter captures a random 1% sample of traffic. - - bpf.Assemble([]bpf.Instruction{ - // Get a 32-bit random number from the Linux kernel. - bpf.LoadExtension{Num: bpf.ExtRand}, - // 1% dice roll? - bpf.JumpIf{Cond: bpf.JumpLessThan, Val: 2^32/100, SkipFalse: 1}, - // Capture. - bpf.RetConstant{Val: 4096}, - // Ignore. - bpf.RetConstant{Val: 0}, - }) - -*/ -package bpf // import "golang.org/x/net/bpf" diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/instructions.go b/src/imagemagick/vendor/golang.org/x/net/bpf/instructions.go deleted file mode 100644 index 3cffcaa..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/instructions.go +++ /dev/null @@ -1,726 +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 bpf - -import "fmt" - -// An Instruction is one instruction executed by the BPF virtual -// machine. -type Instruction interface { - // Assemble assembles the Instruction into a RawInstruction. - Assemble() (RawInstruction, error) -} - -// A RawInstruction is a raw BPF virtual machine instruction. -type RawInstruction struct { - // Operation to execute. - Op uint16 - // For conditional jump instructions, the number of instructions - // to skip if the condition is true/false. - Jt uint8 - Jf uint8 - // Constant parameter. The meaning depends on the Op. - K uint32 -} - -// Assemble implements the Instruction Assemble method. -func (ri RawInstruction) Assemble() (RawInstruction, error) { return ri, nil } - -// Disassemble parses ri into an Instruction and returns it. If ri is -// not recognized by this package, ri itself is returned. -func (ri RawInstruction) Disassemble() Instruction { - switch ri.Op & opMaskCls { - case opClsLoadA, opClsLoadX: - reg := Register(ri.Op & opMaskLoadDest) - sz := 0 - switch ri.Op & opMaskLoadWidth { - case opLoadWidth4: - sz = 4 - case opLoadWidth2: - sz = 2 - case opLoadWidth1: - sz = 1 - default: - return ri - } - switch ri.Op & opMaskLoadMode { - case opAddrModeImmediate: - if sz != 4 { - return ri - } - return LoadConstant{Dst: reg, Val: ri.K} - case opAddrModeScratch: - if sz != 4 || ri.K > 15 { - return ri - } - return LoadScratch{Dst: reg, N: int(ri.K)} - case opAddrModeAbsolute: - if ri.K > extOffset+0xffffffff { - return LoadExtension{Num: Extension(-extOffset + ri.K)} - } - return LoadAbsolute{Size: sz, Off: ri.K} - case opAddrModeIndirect: - return LoadIndirect{Size: sz, Off: ri.K} - case opAddrModePacketLen: - if sz != 4 { - return ri - } - return LoadExtension{Num: ExtLen} - case opAddrModeMemShift: - return LoadMemShift{Off: ri.K} - default: - return ri - } - - case opClsStoreA: - if ri.Op != opClsStoreA || ri.K > 15 { - return ri - } - return StoreScratch{Src: RegA, N: int(ri.K)} - - case opClsStoreX: - if ri.Op != opClsStoreX || ri.K > 15 { - return ri - } - return StoreScratch{Src: RegX, N: int(ri.K)} - - case opClsALU: - switch op := ALUOp(ri.Op & opMaskOperator); op { - case ALUOpAdd, ALUOpSub, ALUOpMul, ALUOpDiv, ALUOpOr, ALUOpAnd, ALUOpShiftLeft, ALUOpShiftRight, ALUOpMod, ALUOpXor: - switch operand := opOperand(ri.Op & opMaskOperand); operand { - case opOperandX: - return ALUOpX{Op: op} - case opOperandConstant: - return ALUOpConstant{Op: op, Val: ri.K} - default: - return ri - } - case aluOpNeg: - return NegateA{} - default: - return ri - } - - case opClsJump: - switch op := jumpOp(ri.Op & opMaskOperator); op { - case opJumpAlways: - return Jump{Skip: ri.K} - case opJumpEqual, opJumpGT, opJumpGE, opJumpSet: - cond, skipTrue, skipFalse := jumpOpToTest(op, ri.Jt, ri.Jf) - switch operand := opOperand(ri.Op & opMaskOperand); operand { - case opOperandX: - return JumpIfX{Cond: cond, SkipTrue: skipTrue, SkipFalse: skipFalse} - case opOperandConstant: - return JumpIf{Cond: cond, Val: ri.K, SkipTrue: skipTrue, SkipFalse: skipFalse} - default: - return ri - } - default: - return ri - } - - case opClsReturn: - switch ri.Op { - case opClsReturn | opRetSrcA: - return RetA{} - case opClsReturn | opRetSrcConstant: - return RetConstant{Val: ri.K} - default: - return ri - } - - case opClsMisc: - switch ri.Op { - case opClsMisc | opMiscTAX: - return TAX{} - case opClsMisc | opMiscTXA: - return TXA{} - default: - return ri - } - - default: - panic("unreachable") // switch is exhaustive on the bit pattern - } -} - -func jumpOpToTest(op jumpOp, skipTrue uint8, skipFalse uint8) (JumpTest, uint8, uint8) { - var test JumpTest - - // Decode "fake" jump conditions that don't appear in machine code - // Ensures the Assemble -> Disassemble stage recreates the same instructions - // See https://github.com/golang/go/issues/18470 - if skipTrue == 0 { - switch op { - case opJumpEqual: - test = JumpNotEqual - case opJumpGT: - test = JumpLessOrEqual - case opJumpGE: - test = JumpLessThan - case opJumpSet: - test = JumpBitsNotSet - } - - return test, skipFalse, 0 - } - - switch op { - case opJumpEqual: - test = JumpEqual - case opJumpGT: - test = JumpGreaterThan - case opJumpGE: - test = JumpGreaterOrEqual - case opJumpSet: - test = JumpBitsSet - } - - return test, skipTrue, skipFalse -} - -// LoadConstant loads Val into register Dst. -type LoadConstant struct { - Dst Register - Val uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadConstant) Assemble() (RawInstruction, error) { - return assembleLoad(a.Dst, 4, opAddrModeImmediate, a.Val) -} - -// String returns the instruction in assembler notation. -func (a LoadConstant) String() string { - switch a.Dst { - case RegA: - return fmt.Sprintf("ld #%d", a.Val) - case RegX: - return fmt.Sprintf("ldx #%d", a.Val) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadScratch loads scratch[N] into register Dst. -type LoadScratch struct { - Dst Register - N int // 0-15 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadScratch) Assemble() (RawInstruction, error) { - if a.N < 0 || a.N > 15 { - return RawInstruction{}, fmt.Errorf("invalid scratch slot %d", a.N) - } - return assembleLoad(a.Dst, 4, opAddrModeScratch, uint32(a.N)) -} - -// String returns the instruction in assembler notation. -func (a LoadScratch) String() string { - switch a.Dst { - case RegA: - return fmt.Sprintf("ld M[%d]", a.N) - case RegX: - return fmt.Sprintf("ldx M[%d]", a.N) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadAbsolute loads packet[Off:Off+Size] as an integer value into -// register A. -type LoadAbsolute struct { - Off uint32 - Size int // 1, 2 or 4 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadAbsolute) Assemble() (RawInstruction, error) { - return assembleLoad(RegA, a.Size, opAddrModeAbsolute, a.Off) -} - -// String returns the instruction in assembler notation. -func (a LoadAbsolute) String() string { - switch a.Size { - case 1: // byte - return fmt.Sprintf("ldb [%d]", a.Off) - case 2: // half word - return fmt.Sprintf("ldh [%d]", a.Off) - case 4: // word - if a.Off > extOffset+0xffffffff { - return LoadExtension{Num: Extension(a.Off + 0x1000)}.String() - } - return fmt.Sprintf("ld [%d]", a.Off) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadIndirect loads packet[X+Off:X+Off+Size] as an integer value -// into register A. -type LoadIndirect struct { - Off uint32 - Size int // 1, 2 or 4 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadIndirect) Assemble() (RawInstruction, error) { - return assembleLoad(RegA, a.Size, opAddrModeIndirect, a.Off) -} - -// String returns the instruction in assembler notation. -func (a LoadIndirect) String() string { - switch a.Size { - case 1: // byte - return fmt.Sprintf("ldb [x + %d]", a.Off) - case 2: // half word - return fmt.Sprintf("ldh [x + %d]", a.Off) - case 4: // word - return fmt.Sprintf("ld [x + %d]", a.Off) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// LoadMemShift multiplies the first 4 bits of the byte at packet[Off] -// by 4 and stores the result in register X. -// -// This instruction is mainly useful to load into X the length of an -// IPv4 packet header in a single instruction, rather than have to do -// the arithmetic on the header's first byte by hand. -type LoadMemShift struct { - Off uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a LoadMemShift) Assemble() (RawInstruction, error) { - return assembleLoad(RegX, 1, opAddrModeMemShift, a.Off) -} - -// String returns the instruction in assembler notation. -func (a LoadMemShift) String() string { - return fmt.Sprintf("ldx 4*([%d]&0xf)", a.Off) -} - -// LoadExtension invokes a linux-specific extension and stores the -// result in register A. -type LoadExtension struct { - Num Extension -} - -// Assemble implements the Instruction Assemble method. -func (a LoadExtension) Assemble() (RawInstruction, error) { - if a.Num == ExtLen { - return assembleLoad(RegA, 4, opAddrModePacketLen, 0) - } - return assembleLoad(RegA, 4, opAddrModeAbsolute, uint32(extOffset+a.Num)) -} - -// String returns the instruction in assembler notation. -func (a LoadExtension) String() string { - switch a.Num { - case ExtLen: - return "ld #len" - case ExtProto: - return "ld #proto" - case ExtType: - return "ld #type" - case ExtPayloadOffset: - return "ld #poff" - case ExtInterfaceIndex: - return "ld #ifidx" - case ExtNetlinkAttr: - return "ld #nla" - case ExtNetlinkAttrNested: - return "ld #nlan" - case ExtMark: - return "ld #mark" - case ExtQueue: - return "ld #queue" - case ExtLinkLayerType: - return "ld #hatype" - case ExtRXHash: - return "ld #rxhash" - case ExtCPUID: - return "ld #cpu" - case ExtVLANTag: - return "ld #vlan_tci" - case ExtVLANTagPresent: - return "ld #vlan_avail" - case ExtVLANProto: - return "ld #vlan_tpid" - case ExtRand: - return "ld #rand" - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// StoreScratch stores register Src into scratch[N]. -type StoreScratch struct { - Src Register - N int // 0-15 -} - -// Assemble implements the Instruction Assemble method. -func (a StoreScratch) Assemble() (RawInstruction, error) { - if a.N < 0 || a.N > 15 { - return RawInstruction{}, fmt.Errorf("invalid scratch slot %d", a.N) - } - var op uint16 - switch a.Src { - case RegA: - op = opClsStoreA - case RegX: - op = opClsStoreX - default: - return RawInstruction{}, fmt.Errorf("invalid source register %v", a.Src) - } - - return RawInstruction{ - Op: op, - K: uint32(a.N), - }, nil -} - -// String returns the instruction in assembler notation. -func (a StoreScratch) String() string { - switch a.Src { - case RegA: - return fmt.Sprintf("st M[%d]", a.N) - case RegX: - return fmt.Sprintf("stx M[%d]", a.N) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// ALUOpConstant executes A = A Val. -type ALUOpConstant struct { - Op ALUOp - Val uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a ALUOpConstant) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsALU | uint16(opOperandConstant) | uint16(a.Op), - K: a.Val, - }, nil -} - -// String returns the instruction in assembler notation. -func (a ALUOpConstant) String() string { - switch a.Op { - case ALUOpAdd: - return fmt.Sprintf("add #%d", a.Val) - case ALUOpSub: - return fmt.Sprintf("sub #%d", a.Val) - case ALUOpMul: - return fmt.Sprintf("mul #%d", a.Val) - case ALUOpDiv: - return fmt.Sprintf("div #%d", a.Val) - case ALUOpMod: - return fmt.Sprintf("mod #%d", a.Val) - case ALUOpAnd: - return fmt.Sprintf("and #%d", a.Val) - case ALUOpOr: - return fmt.Sprintf("or #%d", a.Val) - case ALUOpXor: - return fmt.Sprintf("xor #%d", a.Val) - case ALUOpShiftLeft: - return fmt.Sprintf("lsh #%d", a.Val) - case ALUOpShiftRight: - return fmt.Sprintf("rsh #%d", a.Val) - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// ALUOpX executes A = A X -type ALUOpX struct { - Op ALUOp -} - -// Assemble implements the Instruction Assemble method. -func (a ALUOpX) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsALU | uint16(opOperandX) | uint16(a.Op), - }, nil -} - -// String returns the instruction in assembler notation. -func (a ALUOpX) String() string { - switch a.Op { - case ALUOpAdd: - return "add x" - case ALUOpSub: - return "sub x" - case ALUOpMul: - return "mul x" - case ALUOpDiv: - return "div x" - case ALUOpMod: - return "mod x" - case ALUOpAnd: - return "and x" - case ALUOpOr: - return "or x" - case ALUOpXor: - return "xor x" - case ALUOpShiftLeft: - return "lsh x" - case ALUOpShiftRight: - return "rsh x" - default: - return fmt.Sprintf("unknown instruction: %#v", a) - } -} - -// NegateA executes A = -A. -type NegateA struct{} - -// Assemble implements the Instruction Assemble method. -func (a NegateA) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsALU | uint16(aluOpNeg), - }, nil -} - -// String returns the instruction in assembler notation. -func (a NegateA) String() string { - return fmt.Sprintf("neg") -} - -// Jump skips the following Skip instructions in the program. -type Jump struct { - Skip uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a Jump) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsJump | uint16(opJumpAlways), - K: a.Skip, - }, nil -} - -// String returns the instruction in assembler notation. -func (a Jump) String() string { - return fmt.Sprintf("ja %d", a.Skip) -} - -// JumpIf skips the following Skip instructions in the program if A -// Val is true. -type JumpIf struct { - Cond JumpTest - Val uint32 - SkipTrue uint8 - SkipFalse uint8 -} - -// Assemble implements the Instruction Assemble method. -func (a JumpIf) Assemble() (RawInstruction, error) { - return jumpToRaw(a.Cond, opOperandConstant, a.Val, a.SkipTrue, a.SkipFalse) -} - -// String returns the instruction in assembler notation. -func (a JumpIf) String() string { - return jumpToString(a.Cond, fmt.Sprintf("#%d", a.Val), a.SkipTrue, a.SkipFalse) -} - -// JumpIfX skips the following Skip instructions in the program if A -// X is true. -type JumpIfX struct { - Cond JumpTest - SkipTrue uint8 - SkipFalse uint8 -} - -// Assemble implements the Instruction Assemble method. -func (a JumpIfX) Assemble() (RawInstruction, error) { - return jumpToRaw(a.Cond, opOperandX, 0, a.SkipTrue, a.SkipFalse) -} - -// String returns the instruction in assembler notation. -func (a JumpIfX) String() string { - return jumpToString(a.Cond, "x", a.SkipTrue, a.SkipFalse) -} - -// jumpToRaw assembles a jump instruction into a RawInstruction -func jumpToRaw(test JumpTest, operand opOperand, k uint32, skipTrue, skipFalse uint8) (RawInstruction, error) { - var ( - cond jumpOp - flip bool - ) - switch test { - case JumpEqual: - cond = opJumpEqual - case JumpNotEqual: - cond, flip = opJumpEqual, true - case JumpGreaterThan: - cond = opJumpGT - case JumpLessThan: - cond, flip = opJumpGE, true - case JumpGreaterOrEqual: - cond = opJumpGE - case JumpLessOrEqual: - cond, flip = opJumpGT, true - case JumpBitsSet: - cond = opJumpSet - case JumpBitsNotSet: - cond, flip = opJumpSet, true - default: - return RawInstruction{}, fmt.Errorf("unknown JumpTest %v", test) - } - jt, jf := skipTrue, skipFalse - if flip { - jt, jf = jf, jt - } - return RawInstruction{ - Op: opClsJump | uint16(cond) | uint16(operand), - Jt: jt, - Jf: jf, - K: k, - }, nil -} - -// jumpToString converts a jump instruction to assembler notation -func jumpToString(cond JumpTest, operand string, skipTrue, skipFalse uint8) string { - switch cond { - // K == A - case JumpEqual: - return conditionalJump(operand, skipTrue, skipFalse, "jeq", "jneq") - // K != A - case JumpNotEqual: - return fmt.Sprintf("jneq %s,%d", operand, skipTrue) - // K > A - case JumpGreaterThan: - return conditionalJump(operand, skipTrue, skipFalse, "jgt", "jle") - // K < A - case JumpLessThan: - return fmt.Sprintf("jlt %s,%d", operand, skipTrue) - // K >= A - case JumpGreaterOrEqual: - return conditionalJump(operand, skipTrue, skipFalse, "jge", "jlt") - // K <= A - case JumpLessOrEqual: - return fmt.Sprintf("jle %s,%d", operand, skipTrue) - // K & A != 0 - case JumpBitsSet: - if skipFalse > 0 { - return fmt.Sprintf("jset %s,%d,%d", operand, skipTrue, skipFalse) - } - return fmt.Sprintf("jset %s,%d", operand, skipTrue) - // K & A == 0, there is no assembler instruction for JumpBitNotSet, use JumpBitSet and invert skips - case JumpBitsNotSet: - return jumpToString(JumpBitsSet, operand, skipFalse, skipTrue) - default: - return fmt.Sprintf("unknown JumpTest %#v", cond) - } -} - -func conditionalJump(operand string, skipTrue, skipFalse uint8, positiveJump, negativeJump string) string { - if skipTrue > 0 { - if skipFalse > 0 { - return fmt.Sprintf("%s %s,%d,%d", positiveJump, operand, skipTrue, skipFalse) - } - return fmt.Sprintf("%s %s,%d", positiveJump, operand, skipTrue) - } - return fmt.Sprintf("%s %s,%d", negativeJump, operand, skipFalse) -} - -// RetA exits the BPF program, returning the value of register A. -type RetA struct{} - -// Assemble implements the Instruction Assemble method. -func (a RetA) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsReturn | opRetSrcA, - }, nil -} - -// String returns the instruction in assembler notation. -func (a RetA) String() string { - return fmt.Sprintf("ret a") -} - -// RetConstant exits the BPF program, returning a constant value. -type RetConstant struct { - Val uint32 -} - -// Assemble implements the Instruction Assemble method. -func (a RetConstant) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsReturn | opRetSrcConstant, - K: a.Val, - }, nil -} - -// String returns the instruction in assembler notation. -func (a RetConstant) String() string { - return fmt.Sprintf("ret #%d", a.Val) -} - -// TXA copies the value of register X to register A. -type TXA struct{} - -// Assemble implements the Instruction Assemble method. -func (a TXA) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsMisc | opMiscTXA, - }, nil -} - -// String returns the instruction in assembler notation. -func (a TXA) String() string { - return fmt.Sprintf("txa") -} - -// TAX copies the value of register A to register X. -type TAX struct{} - -// Assemble implements the Instruction Assemble method. -func (a TAX) Assemble() (RawInstruction, error) { - return RawInstruction{ - Op: opClsMisc | opMiscTAX, - }, nil -} - -// String returns the instruction in assembler notation. -func (a TAX) String() string { - return fmt.Sprintf("tax") -} - -func assembleLoad(dst Register, loadSize int, mode uint16, k uint32) (RawInstruction, error) { - var ( - cls uint16 - sz uint16 - ) - switch dst { - case RegA: - cls = opClsLoadA - case RegX: - cls = opClsLoadX - default: - return RawInstruction{}, fmt.Errorf("invalid target register %v", dst) - } - switch loadSize { - case 1: - sz = opLoadWidth1 - case 2: - sz = opLoadWidth2 - case 4: - sz = opLoadWidth4 - default: - return RawInstruction{}, fmt.Errorf("invalid load byte length %d", sz) - } - return RawInstruction{ - Op: cls | sz | mode, - K: k, - }, nil -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/instructions_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/instructions_test.go deleted file mode 100644 index 69b25c5..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/instructions_test.go +++ /dev/null @@ -1,593 +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 bpf - -import ( - "fmt" - "io/ioutil" - "reflect" - "strconv" - "strings" - "testing" -) - -// This is a direct translation of the program in -// testdata/all_instructions.txt. -var allInstructions = []Instruction{ - LoadConstant{Dst: RegA, Val: 42}, - LoadConstant{Dst: RegX, Val: 42}, - - LoadScratch{Dst: RegA, N: 3}, - LoadScratch{Dst: RegX, N: 3}, - - LoadAbsolute{Off: 42, Size: 1}, - LoadAbsolute{Off: 42, Size: 2}, - LoadAbsolute{Off: 42, Size: 4}, - - LoadIndirect{Off: 42, Size: 1}, - LoadIndirect{Off: 42, Size: 2}, - LoadIndirect{Off: 42, Size: 4}, - - LoadMemShift{Off: 42}, - - LoadExtension{Num: ExtLen}, - LoadExtension{Num: ExtProto}, - LoadExtension{Num: ExtType}, - LoadExtension{Num: ExtRand}, - - StoreScratch{Src: RegA, N: 3}, - StoreScratch{Src: RegX, N: 3}, - - ALUOpConstant{Op: ALUOpAdd, Val: 42}, - ALUOpConstant{Op: ALUOpSub, Val: 42}, - ALUOpConstant{Op: ALUOpMul, Val: 42}, - ALUOpConstant{Op: ALUOpDiv, Val: 42}, - ALUOpConstant{Op: ALUOpOr, Val: 42}, - ALUOpConstant{Op: ALUOpAnd, Val: 42}, - ALUOpConstant{Op: ALUOpShiftLeft, Val: 42}, - ALUOpConstant{Op: ALUOpShiftRight, Val: 42}, - ALUOpConstant{Op: ALUOpMod, Val: 42}, - ALUOpConstant{Op: ALUOpXor, Val: 42}, - - ALUOpX{Op: ALUOpAdd}, - ALUOpX{Op: ALUOpSub}, - ALUOpX{Op: ALUOpMul}, - ALUOpX{Op: ALUOpDiv}, - ALUOpX{Op: ALUOpOr}, - ALUOpX{Op: ALUOpAnd}, - ALUOpX{Op: ALUOpShiftLeft}, - ALUOpX{Op: ALUOpShiftRight}, - ALUOpX{Op: ALUOpMod}, - ALUOpX{Op: ALUOpXor}, - - NegateA{}, - - Jump{Skip: 17}, - JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 15, SkipFalse: 16}, - JumpIf{Cond: JumpNotEqual, Val: 42, SkipTrue: 15}, - JumpIf{Cond: JumpLessThan, Val: 42, SkipTrue: 14}, - JumpIf{Cond: JumpLessOrEqual, Val: 42, SkipTrue: 13}, - JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 11, SkipFalse: 12}, - JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 10, SkipFalse: 11}, - JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 9, SkipFalse: 10}, - - JumpIfX{Cond: JumpEqual, SkipTrue: 8, SkipFalse: 9}, - JumpIfX{Cond: JumpNotEqual, SkipTrue: 8}, - JumpIfX{Cond: JumpLessThan, SkipTrue: 7}, - JumpIfX{Cond: JumpLessOrEqual, SkipTrue: 6}, - JumpIfX{Cond: JumpGreaterThan, SkipTrue: 4, SkipFalse: 5}, - JumpIfX{Cond: JumpGreaterOrEqual, SkipTrue: 3, SkipFalse: 4}, - JumpIfX{Cond: JumpBitsSet, SkipTrue: 2, SkipFalse: 3}, - - TAX{}, - TXA{}, - - RetA{}, - RetConstant{Val: 42}, -} -var allInstructionsExpected = "testdata/all_instructions.bpf" - -// Check that we produce the same output as the canonical bpf_asm -// linux kernel tool. -func TestInterop(t *testing.T) { - out, err := Assemble(allInstructions) - if err != nil { - t.Fatalf("assembly of allInstructions program failed: %s", err) - } - t.Logf("Assembled program is %d instructions long", len(out)) - - bs, err := ioutil.ReadFile(allInstructionsExpected) - if err != nil { - t.Fatalf("reading %s: %s", allInstructionsExpected, err) - } - // First statement is the number of statements, last statement is - // empty. We just ignore both and rely on slice length. - stmts := strings.Split(string(bs), ",") - if len(stmts)-2 != len(out) { - t.Fatalf("test program lengths don't match: %s has %d, Go implementation has %d", allInstructionsExpected, len(stmts)-2, len(allInstructions)) - } - - for i, stmt := range stmts[1 : len(stmts)-2] { - nums := strings.Split(stmt, " ") - if len(nums) != 4 { - t.Fatalf("malformed instruction %d in %s: %s", i+1, allInstructionsExpected, stmt) - } - - actual := out[i] - - op, err := strconv.ParseUint(nums[0], 10, 16) - if err != nil { - t.Fatalf("malformed opcode %s in instruction %d of %s", nums[0], i+1, allInstructionsExpected) - } - if actual.Op != uint16(op) { - t.Errorf("opcode mismatch on instruction %d (%#v): got 0x%02x, want 0x%02x", i+1, allInstructions[i], actual.Op, op) - } - - jt, err := strconv.ParseUint(nums[1], 10, 8) - if err != nil { - t.Fatalf("malformed jt offset %s in instruction %d of %s", nums[1], i+1, allInstructionsExpected) - } - if actual.Jt != uint8(jt) { - t.Errorf("jt mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.Jt, jt) - } - - jf, err := strconv.ParseUint(nums[2], 10, 8) - if err != nil { - t.Fatalf("malformed jf offset %s in instruction %d of %s", nums[2], i+1, allInstructionsExpected) - } - if actual.Jf != uint8(jf) { - t.Errorf("jf mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.Jf, jf) - } - - k, err := strconv.ParseUint(nums[3], 10, 32) - if err != nil { - t.Fatalf("malformed constant %s in instruction %d of %s", nums[3], i+1, allInstructionsExpected) - } - if actual.K != uint32(k) { - t.Errorf("constant mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.K, k) - } - } -} - -// Check that assembly and disassembly match each other. -func TestAsmDisasm(t *testing.T) { - prog1, err := Assemble(allInstructions) - if err != nil { - t.Fatalf("assembly of allInstructions program failed: %s", err) - } - t.Logf("Assembled program is %d instructions long", len(prog1)) - - got, allDecoded := Disassemble(prog1) - if !allDecoded { - t.Errorf("Disassemble(Assemble(allInstructions)) produced unrecognized instructions:") - for i, inst := range got { - if r, ok := inst.(RawInstruction); ok { - t.Logf(" insn %d, %#v --> %#v", i+1, allInstructions[i], r) - } - } - } - - if len(allInstructions) != len(got) { - t.Fatalf("disassembly changed program size: %d insns before, %d insns after", len(allInstructions), len(got)) - } - if !reflect.DeepEqual(allInstructions, got) { - t.Errorf("program mutated by disassembly:") - for i := range got { - if !reflect.DeepEqual(allInstructions[i], got[i]) { - t.Logf(" insn %d, s: %#v, p1: %#v, got: %#v", i+1, allInstructions[i], prog1[i], got[i]) - } - } - } -} - -type InvalidInstruction struct{} - -func (a InvalidInstruction) Assemble() (RawInstruction, error) { - return RawInstruction{}, fmt.Errorf("Invalid Instruction") -} - -func (a InvalidInstruction) String() string { - return fmt.Sprintf("unknown instruction: %#v", a) -} - -func TestString(t *testing.T) { - testCases := []struct { - instruction Instruction - assembler string - }{ - { - instruction: LoadConstant{Dst: RegA, Val: 42}, - assembler: "ld #42", - }, - { - instruction: LoadConstant{Dst: RegX, Val: 42}, - assembler: "ldx #42", - }, - { - instruction: LoadConstant{Dst: 0xffff, Val: 42}, - assembler: "unknown instruction: bpf.LoadConstant{Dst:0xffff, Val:0x2a}", - }, - { - instruction: LoadScratch{Dst: RegA, N: 3}, - assembler: "ld M[3]", - }, - { - instruction: LoadScratch{Dst: RegX, N: 3}, - assembler: "ldx M[3]", - }, - { - instruction: LoadScratch{Dst: 0xffff, N: 3}, - assembler: "unknown instruction: bpf.LoadScratch{Dst:0xffff, N:3}", - }, - { - instruction: LoadAbsolute{Off: 42, Size: 1}, - assembler: "ldb [42]", - }, - { - instruction: LoadAbsolute{Off: 42, Size: 2}, - assembler: "ldh [42]", - }, - { - instruction: LoadAbsolute{Off: 42, Size: 4}, - assembler: "ld [42]", - }, - { - instruction: LoadAbsolute{Off: 42, Size: -1}, - assembler: "unknown instruction: bpf.LoadAbsolute{Off:0x2a, Size:-1}", - }, - { - instruction: LoadIndirect{Off: 42, Size: 1}, - assembler: "ldb [x + 42]", - }, - { - instruction: LoadIndirect{Off: 42, Size: 2}, - assembler: "ldh [x + 42]", - }, - { - instruction: LoadIndirect{Off: 42, Size: 4}, - assembler: "ld [x + 42]", - }, - { - instruction: LoadIndirect{Off: 42, Size: -1}, - assembler: "unknown instruction: bpf.LoadIndirect{Off:0x2a, Size:-1}", - }, - { - instruction: LoadMemShift{Off: 42}, - assembler: "ldx 4*([42]&0xf)", - }, - { - instruction: LoadExtension{Num: ExtLen}, - assembler: "ld #len", - }, - { - instruction: LoadExtension{Num: ExtProto}, - assembler: "ld #proto", - }, - { - instruction: LoadExtension{Num: ExtType}, - assembler: "ld #type", - }, - { - instruction: LoadExtension{Num: ExtPayloadOffset}, - assembler: "ld #poff", - }, - { - instruction: LoadExtension{Num: ExtInterfaceIndex}, - assembler: "ld #ifidx", - }, - { - instruction: LoadExtension{Num: ExtNetlinkAttr}, - assembler: "ld #nla", - }, - { - instruction: LoadExtension{Num: ExtNetlinkAttrNested}, - assembler: "ld #nlan", - }, - { - instruction: LoadExtension{Num: ExtMark}, - assembler: "ld #mark", - }, - { - instruction: LoadExtension{Num: ExtQueue}, - assembler: "ld #queue", - }, - { - instruction: LoadExtension{Num: ExtLinkLayerType}, - assembler: "ld #hatype", - }, - { - instruction: LoadExtension{Num: ExtRXHash}, - assembler: "ld #rxhash", - }, - { - instruction: LoadExtension{Num: ExtCPUID}, - assembler: "ld #cpu", - }, - { - instruction: LoadExtension{Num: ExtVLANTag}, - assembler: "ld #vlan_tci", - }, - { - instruction: LoadExtension{Num: ExtVLANTagPresent}, - assembler: "ld #vlan_avail", - }, - { - instruction: LoadExtension{Num: ExtVLANProto}, - assembler: "ld #vlan_tpid", - }, - { - instruction: LoadExtension{Num: ExtRand}, - assembler: "ld #rand", - }, - { - instruction: LoadAbsolute{Off: 0xfffff038, Size: 4}, - assembler: "ld #rand", - }, - { - instruction: LoadExtension{Num: 0xfff}, - assembler: "unknown instruction: bpf.LoadExtension{Num:4095}", - }, - { - instruction: StoreScratch{Src: RegA, N: 3}, - assembler: "st M[3]", - }, - { - instruction: StoreScratch{Src: RegX, N: 3}, - assembler: "stx M[3]", - }, - { - instruction: StoreScratch{Src: 0xffff, N: 3}, - assembler: "unknown instruction: bpf.StoreScratch{Src:0xffff, N:3}", - }, - { - instruction: ALUOpConstant{Op: ALUOpAdd, Val: 42}, - assembler: "add #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpSub, Val: 42}, - assembler: "sub #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpMul, Val: 42}, - assembler: "mul #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpDiv, Val: 42}, - assembler: "div #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpOr, Val: 42}, - assembler: "or #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpAnd, Val: 42}, - assembler: "and #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpShiftLeft, Val: 42}, - assembler: "lsh #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpShiftRight, Val: 42}, - assembler: "rsh #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpMod, Val: 42}, - assembler: "mod #42", - }, - { - instruction: ALUOpConstant{Op: ALUOpXor, Val: 42}, - assembler: "xor #42", - }, - { - instruction: ALUOpConstant{Op: 0xffff, Val: 42}, - assembler: "unknown instruction: bpf.ALUOpConstant{Op:0xffff, Val:0x2a}", - }, - { - instruction: ALUOpX{Op: ALUOpAdd}, - assembler: "add x", - }, - { - instruction: ALUOpX{Op: ALUOpSub}, - assembler: "sub x", - }, - { - instruction: ALUOpX{Op: ALUOpMul}, - assembler: "mul x", - }, - { - instruction: ALUOpX{Op: ALUOpDiv}, - assembler: "div x", - }, - { - instruction: ALUOpX{Op: ALUOpOr}, - assembler: "or x", - }, - { - instruction: ALUOpX{Op: ALUOpAnd}, - assembler: "and x", - }, - { - instruction: ALUOpX{Op: ALUOpShiftLeft}, - assembler: "lsh x", - }, - { - instruction: ALUOpX{Op: ALUOpShiftRight}, - assembler: "rsh x", - }, - { - instruction: ALUOpX{Op: ALUOpMod}, - assembler: "mod x", - }, - { - instruction: ALUOpX{Op: ALUOpXor}, - assembler: "xor x", - }, - { - instruction: ALUOpX{Op: 0xffff}, - assembler: "unknown instruction: bpf.ALUOpX{Op:0xffff}", - }, - { - instruction: NegateA{}, - assembler: "neg", - }, - { - instruction: Jump{Skip: 10}, - assembler: "ja 10", - }, - { - instruction: JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 8, SkipFalse: 9}, - assembler: "jeq #42,8,9", - }, - { - instruction: JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 8}, - assembler: "jeq #42,8", - }, - { - instruction: JumpIf{Cond: JumpEqual, Val: 42, SkipFalse: 8}, - assembler: "jneq #42,8", - }, - { - instruction: JumpIf{Cond: JumpNotEqual, Val: 42, SkipTrue: 8}, - assembler: "jneq #42,8", - }, - { - instruction: JumpIf{Cond: JumpLessThan, Val: 42, SkipTrue: 7}, - assembler: "jlt #42,7", - }, - { - instruction: JumpIf{Cond: JumpLessOrEqual, Val: 42, SkipTrue: 6}, - assembler: "jle #42,6", - }, - { - instruction: JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 4, SkipFalse: 5}, - assembler: "jgt #42,4,5", - }, - { - instruction: JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 4}, - assembler: "jgt #42,4", - }, - { - instruction: JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 3, SkipFalse: 4}, - assembler: "jge #42,3,4", - }, - { - instruction: JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 3}, - assembler: "jge #42,3", - }, - { - instruction: JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset #42,2,3", - }, - { - instruction: JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 2}, - assembler: "jset #42,2", - }, - { - instruction: JumpIf{Cond: JumpBitsNotSet, Val: 42, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset #42,3,2", - }, - { - instruction: JumpIf{Cond: JumpBitsNotSet, Val: 42, SkipTrue: 2}, - assembler: "jset #42,0,2", - }, - { - instruction: JumpIf{Cond: 0xffff, Val: 42, SkipTrue: 1, SkipFalse: 2}, - assembler: "unknown JumpTest 0xffff", - }, - { - instruction: JumpIfX{Cond: JumpEqual, SkipTrue: 8, SkipFalse: 9}, - assembler: "jeq x,8,9", - }, - { - instruction: JumpIfX{Cond: JumpEqual, SkipTrue: 8}, - assembler: "jeq x,8", - }, - { - instruction: JumpIfX{Cond: JumpEqual, SkipFalse: 8}, - assembler: "jneq x,8", - }, - { - instruction: JumpIfX{Cond: JumpNotEqual, SkipTrue: 8}, - assembler: "jneq x,8", - }, - { - instruction: JumpIfX{Cond: JumpLessThan, SkipTrue: 7}, - assembler: "jlt x,7", - }, - { - instruction: JumpIfX{Cond: JumpLessOrEqual, SkipTrue: 6}, - assembler: "jle x,6", - }, - { - instruction: JumpIfX{Cond: JumpGreaterThan, SkipTrue: 4, SkipFalse: 5}, - assembler: "jgt x,4,5", - }, - { - instruction: JumpIfX{Cond: JumpGreaterThan, SkipTrue: 4}, - assembler: "jgt x,4", - }, - { - instruction: JumpIfX{Cond: JumpGreaterOrEqual, SkipTrue: 3, SkipFalse: 4}, - assembler: "jge x,3,4", - }, - { - instruction: JumpIfX{Cond: JumpGreaterOrEqual, SkipTrue: 3}, - assembler: "jge x,3", - }, - { - instruction: JumpIfX{Cond: JumpBitsSet, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset x,2,3", - }, - { - instruction: JumpIfX{Cond: JumpBitsSet, SkipTrue: 2}, - assembler: "jset x,2", - }, - { - instruction: JumpIfX{Cond: JumpBitsNotSet, SkipTrue: 2, SkipFalse: 3}, - assembler: "jset x,3,2", - }, - { - instruction: JumpIfX{Cond: JumpBitsNotSet, SkipTrue: 2}, - assembler: "jset x,0,2", - }, - { - instruction: JumpIfX{Cond: 0xffff, SkipTrue: 1, SkipFalse: 2}, - assembler: "unknown JumpTest 0xffff", - }, - { - instruction: TAX{}, - assembler: "tax", - }, - { - instruction: TXA{}, - assembler: "txa", - }, - { - instruction: RetA{}, - assembler: "ret a", - }, - { - instruction: RetConstant{Val: 42}, - assembler: "ret #42", - }, - // Invalid instruction - { - instruction: InvalidInstruction{}, - assembler: "unknown instruction: bpf.InvalidInstruction{}", - }, - } - - for _, testCase := range testCases { - if input, ok := testCase.instruction.(fmt.Stringer); ok { - got := input.String() - if got != testCase.assembler { - t.Errorf("String did not return expected assembler notation, expected: %s, got: %s", testCase.assembler, got) - } - } else { - t.Errorf("Instruction %#v is not a fmt.Stringer", testCase.instruction) - } - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/setter.go b/src/imagemagick/vendor/golang.org/x/net/bpf/setter.go deleted file mode 100644 index 43e35f0..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/setter.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 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 bpf - -// A Setter is a type which can attach a compiled BPF filter to itself. -type Setter interface { - SetBPF(filter []RawInstruction) error -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf b/src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf deleted file mode 100644 index 929eb25..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf +++ /dev/null @@ -1 +0,0 @@ -57,0 0 0 42,1 0 0 42,96 0 0 3,97 0 0 3,48 0 0 42,40 0 0 42,32 0 0 42,80 0 0 42,72 0 0 42,64 0 0 42,177 0 0 42,128 0 0 0,32 0 0 4294963200,32 0 0 4294963204,32 0 0 4294963256,2 0 0 3,3 0 0 3,4 0 0 42,20 0 0 42,36 0 0 42,52 0 0 42,68 0 0 42,84 0 0 42,100 0 0 42,116 0 0 42,148 0 0 42,164 0 0 42,12 0 0 0,28 0 0 0,44 0 0 0,60 0 0 0,76 0 0 0,92 0 0 0,108 0 0 0,124 0 0 0,156 0 0 0,172 0 0 0,132 0 0 0,5 0 0 17,21 15 16 42,21 0 15 42,53 0 14 42,37 0 13 42,37 11 12 42,53 10 11 42,69 9 10 42,29 8 9 0,29 0 8 0,61 0 7 0,45 0 6 0,45 4 5 0,61 3 4 0,77 2 3 0,7 0 0 0,135 0 0 0,22 0 0 0,6 0 0 42, diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.txt b/src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.txt deleted file mode 100644 index 8e4d758..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/testdata/all_instructions.txt +++ /dev/null @@ -1,88 +0,0 @@ -# This filter is compiled to all_instructions.bpf by the `bpf_asm` -# tool, which can be found in the linux kernel source tree under -# tools/bpf. - -# Load immediate -ld #42 -ldx #42 - -# Load scratch -ld M[3] -ldx M[3] - -# Load absolute -ldb [42] -ldh [42] -ld [42] - -# Load indirect -ldb [x + 42] -ldh [x + 42] -ld [x + 42] - -# Load IPv4 header length -ldx 4*([42]&0xf) - -# Run extension function -ld #len -ld #proto -ld #type -ld #rand - -# Store scratch -st M[3] -stx M[3] - -# A constant -add #42 -sub #42 -mul #42 -div #42 -or #42 -and #42 -lsh #42 -rsh #42 -mod #42 -xor #42 - -# A X -add x -sub x -mul x -div x -or x -and x -lsh x -rsh x -mod x -xor x - -# !A -neg - -# Jump A constant -ja end -jeq #42,prev,end -jne #42,end -jlt #42,end -jle #42,end -jgt #42,prev,end -jge #42,prev,end -jset #42,prev,end - -# Jump A X -jeq x,prev,end -jne x,end -jlt x,end -jle x,end -jgt x,prev,end -jge x,prev,end -jset x,prev,end - -# Register transfers -tax -txa - -# Returns -prev: ret a -end: ret #42 diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm.go deleted file mode 100644 index 73f57f1..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm.go +++ /dev/null @@ -1,150 +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 bpf - -import ( - "errors" - "fmt" -) - -// A VM is an emulated BPF virtual machine. -type VM struct { - filter []Instruction -} - -// NewVM returns a new VM using the input BPF program. -func NewVM(filter []Instruction) (*VM, error) { - if len(filter) == 0 { - return nil, errors.New("one or more Instructions must be specified") - } - - for i, ins := range filter { - check := len(filter) - (i + 1) - switch ins := ins.(type) { - // Check for out-of-bounds jumps in instructions - case Jump: - if check <= int(ins.Skip) { - return nil, fmt.Errorf("cannot jump %d instructions; jumping past program bounds", ins.Skip) - } - case JumpIf: - if check <= int(ins.SkipTrue) { - return nil, fmt.Errorf("cannot jump %d instructions in true case; jumping past program bounds", ins.SkipTrue) - } - if check <= int(ins.SkipFalse) { - return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse) - } - case JumpIfX: - if check <= int(ins.SkipTrue) { - return nil, fmt.Errorf("cannot jump %d instructions in true case; jumping past program bounds", ins.SkipTrue) - } - if check <= int(ins.SkipFalse) { - return nil, fmt.Errorf("cannot jump %d instructions in false case; jumping past program bounds", ins.SkipFalse) - } - // Check for division or modulus by zero - case ALUOpConstant: - if ins.Val != 0 { - break - } - - switch ins.Op { - case ALUOpDiv, ALUOpMod: - return nil, errors.New("cannot divide by zero using ALUOpConstant") - } - // Check for unknown extensions - case LoadExtension: - switch ins.Num { - case ExtLen: - default: - return nil, fmt.Errorf("extension %d not implemented", ins.Num) - } - } - } - - // Make sure last instruction is a return instruction - switch filter[len(filter)-1].(type) { - case RetA, RetConstant: - default: - return nil, errors.New("BPF program must end with RetA or RetConstant") - } - - // Though our VM works using disassembled instructions, we - // attempt to assemble the input filter anyway to ensure it is compatible - // with an operating system VM. - _, err := Assemble(filter) - - return &VM{ - filter: filter, - }, err -} - -// Run runs the VM's BPF program against the input bytes. -// Run returns the number of bytes accepted by the BPF program, and any errors -// which occurred while processing the program. -func (v *VM) Run(in []byte) (int, error) { - var ( - // Registers of the virtual machine - regA uint32 - regX uint32 - regScratch [16]uint32 - - // OK is true if the program should continue processing the next - // instruction, or false if not, causing the loop to break - ok = true - ) - - // TODO(mdlayher): implement: - // - NegateA: - // - would require a change from uint32 registers to int32 - // registers - - // TODO(mdlayher): add interop tests that check signedness of ALU - // operations against kernel implementation, and make sure Go - // implementation matches behavior - - for i := 0; i < len(v.filter) && ok; i++ { - ins := v.filter[i] - - switch ins := ins.(type) { - case ALUOpConstant: - regA = aluOpConstant(ins, regA) - case ALUOpX: - regA, ok = aluOpX(ins, regA, regX) - case Jump: - i += int(ins.Skip) - case JumpIf: - jump := jumpIf(ins, regA) - i += jump - case JumpIfX: - jump := jumpIfX(ins, regA, regX) - i += jump - case LoadAbsolute: - regA, ok = loadAbsolute(ins, in) - case LoadConstant: - regA, regX = loadConstant(ins, regA, regX) - case LoadExtension: - regA = loadExtension(ins, in) - case LoadIndirect: - regA, ok = loadIndirect(ins, in, regX) - case LoadMemShift: - regX, ok = loadMemShift(ins, in) - case LoadScratch: - regA, regX = loadScratch(ins, regScratch, regA, regX) - case RetA: - return int(regA), nil - case RetConstant: - return int(ins.Val), nil - case StoreScratch: - regScratch = storeScratch(ins, regScratch, regA, regX) - case TAX: - regX = regA - case TXA: - regA = regX - default: - return 0, fmt.Errorf("unknown Instruction at index %d: %T", i, ins) - } - } - - return 0, nil -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_aluop_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_aluop_test.go deleted file mode 100644 index 1667824..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_aluop_test.go +++ /dev/null @@ -1,512 +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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMALUOpAdd(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpAdd, - Val: 3, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 8, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 3, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpSub(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.TAX{}, - bpf.ALUOpX{ - Op: bpf.ALUOpSub, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpMul(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpMul, - Val: 2, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 6, 2, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpDiv(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpDiv, - Val: 2, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 20, 2, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpDivByZeroALUOpConstant(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.ALUOpConstant{ - Op: bpf.ALUOpDiv, - Val: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot divide by zero using ALUOpConstant" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMALUOpDivByZeroALUOpX(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 0 into X - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.TAX{}, - // Load byte 1 into A - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Attempt to perform 1/0 - bpf.ALUOpX{ - Op: bpf.ALUOpDiv, - }, - // Return 4 bytes if program does not terminate - bpf.LoadConstant{ - Val: 12, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpOr(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpOr, - Val: 0x01, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x00, 0x10, 0x03, 0x04, - 0x05, 0x06, 0x07, 0x08, - 0x09, 0xff, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 9, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpAnd(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpAnd, - Val: 0x0019, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0xaa, 0x09, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpShiftLeft(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpShiftLeft, - Val: 0x01, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x02, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0xaa, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpShiftRight(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpShiftRight, - Val: 0x01, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x04, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x08, 0xff, 0xff, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpMod(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpMod, - Val: 20, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 30, 0, 0, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpModByZeroALUOpConstant(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpMod, - Val: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot divide by zero using ALUOpConstant" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMALUOpModByZeroALUOpX(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 0 into X - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.TAX{}, - // Load byte 1 into A - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Attempt to perform 1%0 - bpf.ALUOpX{ - Op: bpf.ALUOpMod, - }, - // Return 4 bytes if program does not terminate - bpf.LoadConstant{ - Val: 12, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 3, 4, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpXor(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpXor, - Val: 0x0a, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x01, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x0b, 0x00, 0x00, 0x00, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMALUOpUnknown(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.ALUOpConstant{ - Op: bpf.ALUOpAdd, - Val: 1, - }, - // Verify that an unknown operation is a no-op - bpf.ALUOpConstant{ - Op: 100, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 0x02, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_bpf_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_bpf_test.go deleted file mode 100644 index 137eea1..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_bpf_test.go +++ /dev/null @@ -1,199 +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 bpf_test - -import ( - "net" - "runtime" - "testing" - "time" - - "golang.org/x/net/bpf" - "golang.org/x/net/ipv4" - "golang.org/x/net/ipv6" - "golang.org/x/net/nettest" -) - -// A virtualMachine is a BPF virtual machine which can process an -// input packet against a BPF program and render a verdict. -type virtualMachine interface { - Run(in []byte) (int, error) -} - -// canUseOSVM indicates if the OS BPF VM is available on this platform. -func canUseOSVM() bool { - // OS BPF VM can only be used on platforms where x/net/ipv4 supports - // attaching a BPF program to a socket. - switch runtime.GOOS { - case "linux": - return true - } - - return false -} - -// All BPF tests against both the Go VM and OS VM are assumed to -// be used with a UDP socket. As a result, the entire contents -// of a UDP datagram is sent through the BPF program, but only -// the body after the UDP header will ever be returned in output. - -// testVM sets up a Go BPF VM, and if available, a native OS BPF VM -// for integration testing. -func testVM(t *testing.T, filter []bpf.Instruction) (virtualMachine, func(), error) { - goVM, err := bpf.NewVM(filter) - if err != nil { - // Some tests expect an error, so this error must be returned - // instead of fatally exiting the test - return nil, nil, err - } - - mvm := &multiVirtualMachine{ - goVM: goVM, - - t: t, - } - - // If available, add the OS VM for tests which verify that both the Go - // VM and OS VM have exactly the same output for the same input program - // and packet. - done := func() {} - if canUseOSVM() { - osVM, osVMDone := testOSVM(t, filter) - done = func() { osVMDone() } - mvm.osVM = osVM - } - - return mvm, done, nil -} - -// udpHeaderLen is the length of a UDP header. -const udpHeaderLen = 8 - -// A multiVirtualMachine is a virtualMachine which can call out to both the Go VM -// and the native OS VM, if the OS VM is available. -type multiVirtualMachine struct { - goVM virtualMachine - osVM virtualMachine - - t *testing.T -} - -func (mvm *multiVirtualMachine) Run(in []byte) (int, error) { - if len(in) < udpHeaderLen { - mvm.t.Fatalf("input must be at least length of UDP header (%d), got: %d", - udpHeaderLen, len(in)) - } - - // All tests have a UDP header as part of input, because the OS VM - // packets always will. For the Go VM, this output is trimmed before - // being sent back to tests. - goOut, goErr := mvm.goVM.Run(in) - if goOut >= udpHeaderLen { - goOut -= udpHeaderLen - } - - // If Go output is larger than the size of the packet, packet filtering - // interop tests must trim the output bytes to the length of the packet. - // The BPF VM should not do this on its own, as other uses of it do - // not trim the output byte count. - trim := len(in) - udpHeaderLen - if goOut > trim { - goOut = trim - } - - // When the OS VM is not available, process using the Go VM alone - if mvm.osVM == nil { - return goOut, goErr - } - - // The OS VM will apply its own UDP header, so remove the pseudo header - // that the Go VM needs. - osOut, err := mvm.osVM.Run(in[udpHeaderLen:]) - if err != nil { - mvm.t.Fatalf("error while running OS VM: %v", err) - } - - // Verify both VMs return same number of bytes - var mismatch bool - if goOut != osOut { - mismatch = true - mvm.t.Logf("output byte count does not match:\n- go: %v\n- os: %v", goOut, osOut) - } - - if mismatch { - mvm.t.Fatal("Go BPF and OS BPF packet outputs do not match") - } - - return goOut, goErr -} - -// An osVirtualMachine is a virtualMachine which uses the OS's BPF VM for -// processing BPF programs. -type osVirtualMachine struct { - l net.PacketConn - s net.Conn -} - -// testOSVM creates a virtualMachine which uses the OS's BPF VM by injecting -// packets into a UDP listener with a BPF program attached to it. -func testOSVM(t *testing.T, filter []bpf.Instruction) (virtualMachine, func()) { - l, err := nettest.NewLocalPacketListener("udp") - if err != nil { - t.Fatalf("failed to open OS VM UDP listener: %v", err) - } - - prog, err := bpf.Assemble(filter) - if err != nil { - t.Fatalf("failed to compile BPF program: %v", err) - } - - ip := l.LocalAddr().(*net.UDPAddr).IP - if ip.To4() != nil && ip.To16() == nil { - err = ipv4.NewPacketConn(l).SetBPF(prog) - } else { - err = ipv6.NewPacketConn(l).SetBPF(prog) - } - if err != nil { - t.Fatalf("failed to attach BPF program to listener: %v", err) - } - - s, err := net.Dial(l.LocalAddr().Network(), l.LocalAddr().String()) - if err != nil { - t.Fatalf("failed to dial connection to listener: %v", err) - } - - done := func() { - _ = s.Close() - _ = l.Close() - } - - return &osVirtualMachine{ - l: l, - s: s, - }, done -} - -// Run sends the input bytes into the OS's BPF VM and returns its verdict. -func (vm *osVirtualMachine) Run(in []byte) (int, error) { - go func() { - _, _ = vm.s.Write(in) - }() - - vm.l.SetDeadline(time.Now().Add(50 * time.Millisecond)) - - var b [512]byte - n, _, err := vm.l.ReadFrom(b[:]) - if err != nil { - // A timeout indicates that BPF filtered out the packet, and thus, - // no input should be returned. - if nerr, ok := err.(net.Error); ok && nerr.Timeout() { - return n, nil - } - - return n, err - } - - return n, nil -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_extension_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_extension_test.go deleted file mode 100644 index 7a48c82..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_extension_test.go +++ /dev/null @@ -1,49 +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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMLoadExtensionNotImplemented(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadExtension{ - Num: 100, - }, - bpf.RetA{}, - }) - if errStr(err) != "extension 100 not implemented" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadExtensionExtLen(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadExtension{ - Num: bpf.ExtLen, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_instructions.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_instructions.go deleted file mode 100644 index cf8947c..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_instructions.go +++ /dev/null @@ -1,182 +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 bpf - -import ( - "encoding/binary" - "fmt" -) - -func aluOpConstant(ins ALUOpConstant, regA uint32) uint32 { - return aluOpCommon(ins.Op, regA, ins.Val) -} - -func aluOpX(ins ALUOpX, regA uint32, regX uint32) (uint32, bool) { - // Guard against division or modulus by zero by terminating - // the program, as the OS BPF VM does - if regX == 0 { - switch ins.Op { - case ALUOpDiv, ALUOpMod: - return 0, false - } - } - - return aluOpCommon(ins.Op, regA, regX), true -} - -func aluOpCommon(op ALUOp, regA uint32, value uint32) uint32 { - switch op { - case ALUOpAdd: - return regA + value - case ALUOpSub: - return regA - value - case ALUOpMul: - return regA * value - case ALUOpDiv: - // Division by zero not permitted by NewVM and aluOpX checks - return regA / value - case ALUOpOr: - return regA | value - case ALUOpAnd: - return regA & value - case ALUOpShiftLeft: - return regA << value - case ALUOpShiftRight: - return regA >> value - case ALUOpMod: - // Modulus by zero not permitted by NewVM and aluOpX checks - return regA % value - case ALUOpXor: - return regA ^ value - default: - return regA - } -} - -func jumpIf(ins JumpIf, regA uint32) int { - return jumpIfCommon(ins.Cond, ins.SkipTrue, ins.SkipFalse, regA, ins.Val) -} - -func jumpIfX(ins JumpIfX, regA uint32, regX uint32) int { - return jumpIfCommon(ins.Cond, ins.SkipTrue, ins.SkipFalse, regA, regX) -} - -func jumpIfCommon(cond JumpTest, skipTrue, skipFalse uint8, regA uint32, value uint32) int { - var ok bool - - switch cond { - case JumpEqual: - ok = regA == value - case JumpNotEqual: - ok = regA != value - case JumpGreaterThan: - ok = regA > value - case JumpLessThan: - ok = regA < value - case JumpGreaterOrEqual: - ok = regA >= value - case JumpLessOrEqual: - ok = regA <= value - case JumpBitsSet: - ok = (regA & value) != 0 - case JumpBitsNotSet: - ok = (regA & value) == 0 - } - - if ok { - return int(skipTrue) - } - - return int(skipFalse) -} - -func loadAbsolute(ins LoadAbsolute, in []byte) (uint32, bool) { - offset := int(ins.Off) - size := int(ins.Size) - - return loadCommon(in, offset, size) -} - -func loadConstant(ins LoadConstant, regA uint32, regX uint32) (uint32, uint32) { - switch ins.Dst { - case RegA: - regA = ins.Val - case RegX: - regX = ins.Val - } - - return regA, regX -} - -func loadExtension(ins LoadExtension, in []byte) uint32 { - switch ins.Num { - case ExtLen: - return uint32(len(in)) - default: - panic(fmt.Sprintf("unimplemented extension: %d", ins.Num)) - } -} - -func loadIndirect(ins LoadIndirect, in []byte, regX uint32) (uint32, bool) { - offset := int(ins.Off) + int(regX) - size := int(ins.Size) - - return loadCommon(in, offset, size) -} - -func loadMemShift(ins LoadMemShift, in []byte) (uint32, bool) { - offset := int(ins.Off) - - // Size of LoadMemShift is always 1 byte - if !inBounds(len(in), offset, 1) { - return 0, false - } - - // Mask off high 4 bits and multiply low 4 bits by 4 - return uint32(in[offset]&0x0f) * 4, true -} - -func inBounds(inLen int, offset int, size int) bool { - return offset+size <= inLen -} - -func loadCommon(in []byte, offset int, size int) (uint32, bool) { - if !inBounds(len(in), offset, size) { - return 0, false - } - - switch size { - case 1: - return uint32(in[offset]), true - case 2: - return uint32(binary.BigEndian.Uint16(in[offset : offset+size])), true - case 4: - return uint32(binary.BigEndian.Uint32(in[offset : offset+size])), true - default: - panic(fmt.Sprintf("invalid load size: %d", size)) - } -} - -func loadScratch(ins LoadScratch, regScratch [16]uint32, regA uint32, regX uint32) (uint32, uint32) { - switch ins.Dst { - case RegA: - regA = regScratch[ins.N] - case RegX: - regX = regScratch[ins.N] - } - - return regA, regX -} - -func storeScratch(ins StoreScratch, regScratch [16]uint32, regA uint32, regX uint32) [16]uint32 { - switch ins.Src { - case RegA: - regScratch[ins.N] = regA - case RegX: - regScratch[ins.N] = regX - } - - return regScratch -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_jump_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_jump_test.go deleted file mode 100644 index 77a2d47..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_jump_test.go +++ /dev/null @@ -1,726 +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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMJumpOne(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.Jump{ - Skip: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.Jump{ - Skip: 1, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 1 instructions; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfTrueOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIf{ - Cond: bpf.JumpEqual, - SkipTrue: 2, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 2 instructions in true case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfFalseOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIf{ - Cond: bpf.JumpEqual, - SkipFalse: 3, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 3 instructions in false case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfXTrueOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIfX{ - Cond: bpf.JumpEqual, - SkipTrue: 2, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 2 instructions in true case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfXFalseOutOfProgram(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.JumpIfX{ - Cond: bpf.JumpEqual, - SkipFalse: 3, - }, - bpf.RetA{}, - }) - if errStr(err) != "cannot jump 3 instructions in false case; jumping past program bounds" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMJumpIfEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 1, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfNotEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.JumpIf{ - Cond: bpf.JumpNotEqual, - Val: 1, - SkipFalse: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfGreaterThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpGreaterThan, - Val: 0x00010202, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfLessThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpLessThan, - Val: 0xff010203, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfGreaterOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpGreaterOrEqual, - Val: 0x00010203, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfLessOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.JumpIf{ - Cond: bpf.JumpLessOrEqual, - Val: 0xff010203, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfBitsSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.JumpIf{ - Cond: bpf.JumpBitsSet, - Val: 0x1122, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfBitsNotSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.JumpIf{ - Cond: bpf.JumpBitsNotSet, - Val: 0x1221, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 1, - }, - bpf.JumpIfX{ - Cond: bpf.JumpEqual, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXNotEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 1, - }, - bpf.JumpIfX{ - Cond: bpf.JumpNotEqual, - SkipFalse: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXGreaterThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x00010202, - }, - bpf.JumpIfX{ - Cond: bpf.JumpGreaterThan, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXLessThan(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0xff010203, - }, - bpf.JumpIfX{ - Cond: bpf.JumpLessThan, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXGreaterOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x00010203, - }, - bpf.JumpIfX{ - Cond: bpf.JumpGreaterOrEqual, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXLessOrEqual(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 4, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0xff010203, - }, - bpf.JumpIfX{ - Cond: bpf.JumpLessOrEqual, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 12, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 4, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXBitsSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x1122, - }, - bpf.JumpIfX{ - Cond: bpf.JumpBitsSet, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMJumpIfXBitsNotSet(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 0x1221, - }, - bpf.JumpIfX{ - Cond: bpf.JumpBitsNotSet, - SkipTrue: 1, - }, - bpf.RetConstant{ - Val: 0, - }, - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x01, 0x02, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_load_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_load_test.go deleted file mode 100644 index d57e4af..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_load_test.go +++ /dev/null @@ -1,258 +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 bpf_test - -import ( - "net" - "testing" - - "golang.org/x/net/bpf" - "golang.org/x/net/ipv4" -) - -func TestVMLoadAbsoluteOffsetOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, 2, 3, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: uint32(len(pkt)), - Size: 1, - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadAbsoluteOffsetPlusSizeOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: uint32(len(pkt) - 1), - Size: 2, - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadAbsoluteBadInstructionSize(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Size: 5, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid load byte length 0" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadConstantOK(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadConstant{ - Dst: bpf.RegX, - Val: 9, - }, - bpf.TXA{}, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadIndirectOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadIndirect{ - Off: uint32(len(pkt)), - Size: 1, - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadMemShiftOutOfBounds(t *testing.T) { - pkt := []byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, - } - - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadMemShift{ - Off: uint32(len(pkt)), - }, - // Out of bounds should return 0, return 1 to tell if execution continued - bpf.RetConstant{Val: 1}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run(pkt) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected result:\n- want: %d\n- got: %d", - want, got) - } -} - -const ( - dhcp4Port = 53 -) - -func TestVMLoadMemShiftLoadIndirectNoResult(t *testing.T) { - vm, in, done := testDHCPv4(t) - defer done() - - // Append mostly empty UDP header with incorrect DHCPv4 port - in = append(in, []byte{ - 0, 0, - 0, dhcp4Port + 1, - 0, 0, - 0, 0, - }...) - - out, err := vm.Run(in) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 0, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMLoadMemShiftLoadIndirectOK(t *testing.T) { - vm, in, done := testDHCPv4(t) - defer done() - - // Append mostly empty UDP header with correct DHCPv4 port - in = append(in, []byte{ - 0, 0, - 0, dhcp4Port, - 0, 0, - 0, 0, - }...) - - out, err := vm.Run(in) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := len(in)-8, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func testDHCPv4(t *testing.T) (virtualMachine, []byte, func()) { - // DHCPv4 test data courtesy of David Anderson: - // https://github.com/google/netboot/blob/master/dhcp4/conn_linux.go#L59-L70 - vm, done, err := testVM(t, []bpf.Instruction{ - // Load IPv4 packet length - bpf.LoadMemShift{Off: 8}, - // Get UDP dport - bpf.LoadIndirect{Off: 8 + 2, Size: 2}, - // Correct dport? - bpf.JumpIf{Cond: bpf.JumpEqual, Val: dhcp4Port, SkipFalse: 1}, - // Accept - bpf.RetConstant{Val: 1500}, - // Ignore - bpf.RetConstant{Val: 0}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - - // Minimal requirements to make a valid IPv4 header - h := &ipv4.Header{ - Len: ipv4.HeaderLen, - Src: net.IPv4(192, 168, 1, 1), - Dst: net.IPv4(192, 168, 1, 2), - } - hb, err := h.Marshal() - if err != nil { - t.Fatalf("failed to marshal IPv4 header: %v", err) - } - - hb = append([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - }, hb...) - - return vm, hb, done -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_ret_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_ret_test.go deleted file mode 100644 index 2d86eae..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_ret_test.go +++ /dev/null @@ -1,115 +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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMRetA(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 9, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMRetALargerThanInput(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadAbsolute{ - Off: 8, - Size: 2, - }, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 255, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMRetConstant(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.RetConstant{ - Val: 9, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 1, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMRetConstantLargerThanInput(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.RetConstant{ - Val: 16, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0, 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_scratch_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_scratch_test.go deleted file mode 100644 index e600e3c..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_scratch_test.go +++ /dev/null @@ -1,247 +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 bpf_test - -import ( - "testing" - - "golang.org/x/net/bpf" -) - -func TestVMStoreScratchInvalidScratchRegisterTooSmall(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.StoreScratch{ - Src: bpf.RegA, - N: -1, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot -1" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMStoreScratchInvalidScratchRegisterTooLarge(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.StoreScratch{ - Src: bpf.RegA, - N: 16, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot 16" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMStoreScratchUnknownSourceRegister(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.StoreScratch{ - Src: 100, - N: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid source register 100" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadScratchInvalidScratchRegisterTooSmall(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadScratch{ - Dst: bpf.RegX, - N: -1, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot -1" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadScratchInvalidScratchRegisterTooLarge(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadScratch{ - Dst: bpf.RegX, - N: 16, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid scratch slot 16" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMLoadScratchUnknownDestinationRegister(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadScratch{ - Dst: 100, - N: 0, - }, - bpf.RetA{}, - }) - if errStr(err) != "assembling instruction 1: invalid target register 100" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMStoreScratchLoadScratchOneValue(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 255 - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - // Copy to X and store in scratch[0] - bpf.TAX{}, - bpf.StoreScratch{ - Src: bpf.RegX, - N: 0, - }, - // Load byte 1 - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Overwrite 1 with 255 from scratch[0] - bpf.LoadScratch{ - Dst: bpf.RegA, - N: 0, - }, - // Return 255 - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 255, 1, 2, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 3, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} - -func TestVMStoreScratchLoadScratchMultipleValues(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - // Load byte 10 - bpf.LoadAbsolute{ - Off: 8, - Size: 1, - }, - // Store in scratch[0] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 0, - }, - // Load byte 20 - bpf.LoadAbsolute{ - Off: 9, - Size: 1, - }, - // Store in scratch[1] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 1, - }, - // Load byte 30 - bpf.LoadAbsolute{ - Off: 10, - Size: 1, - }, - // Store in scratch[2] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 2, - }, - // Load byte 1 - bpf.LoadAbsolute{ - Off: 11, - Size: 1, - }, - // Store in scratch[3] - bpf.StoreScratch{ - Src: bpf.RegA, - N: 3, - }, - // Load in byte 10 to X - bpf.LoadScratch{ - Dst: bpf.RegX, - N: 0, - }, - // Copy X -> A - bpf.TXA{}, - // Verify value is 10 - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 10, - SkipTrue: 1, - }, - // Fail test if incorrect - bpf.RetConstant{ - Val: 0, - }, - // Load in byte 20 to A - bpf.LoadScratch{ - Dst: bpf.RegA, - N: 1, - }, - // Verify value is 20 - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 20, - SkipTrue: 1, - }, - // Fail test if incorrect - bpf.RetConstant{ - Val: 0, - }, - // Load in byte 30 to A - bpf.LoadScratch{ - Dst: bpf.RegA, - N: 2, - }, - // Verify value is 30 - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: 30, - SkipTrue: 1, - }, - // Fail test if incorrect - bpf.RetConstant{ - Val: 0, - }, - // Return first two bytes on success - bpf.RetConstant{ - Val: 10, - }, - }) - if err != nil { - t.Fatalf("failed to load BPF program: %v", err) - } - defer done() - - out, err := vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 10, 20, 30, 1, - }) - if err != nil { - t.Fatalf("unexpected error while running program: %v", err) - } - if want, got := 2, out; want != got { - t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", - want, got) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_test.go b/src/imagemagick/vendor/golang.org/x/net/bpf/vm_test.go deleted file mode 100644 index 6bd4dd5..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/bpf/vm_test.go +++ /dev/null @@ -1,144 +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 bpf_test - -import ( - "fmt" - "testing" - - "golang.org/x/net/bpf" -) - -var _ bpf.Instruction = unknown{} - -type unknown struct{} - -func (unknown) Assemble() (bpf.RawInstruction, error) { - return bpf.RawInstruction{}, nil -} - -func TestVMUnknownInstruction(t *testing.T) { - vm, done, err := testVM(t, []bpf.Instruction{ - bpf.LoadConstant{ - Dst: bpf.RegA, - Val: 100, - }, - // Should terminate the program with an error immediately - unknown{}, - bpf.RetA{}, - }) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - defer done() - - _, err = vm.Run([]byte{ - 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, - 0x00, 0x00, - }) - if errStr(err) != "unknown Instruction at index 1: bpf_test.unknown" { - t.Fatalf("unexpected error while running program: %v", err) - } -} - -func TestVMNoReturnInstruction(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{ - bpf.LoadConstant{ - Dst: bpf.RegA, - Val: 1, - }, - }) - if errStr(err) != "BPF program must end with RetA or RetConstant" { - t.Fatalf("unexpected error: %v", err) - } -} - -func TestVMNoInputInstructions(t *testing.T) { - _, _, err := testVM(t, []bpf.Instruction{}) - if errStr(err) != "one or more Instructions must be specified" { - t.Fatalf("unexpected error: %v", err) - } -} - -// ExampleNewVM demonstrates usage of a VM, using an Ethernet frame -// as input and checking its EtherType to determine if it should be accepted. -func ExampleNewVM() { - // Offset | Length | Comment - // ------------------------- - // 00 | 06 | Ethernet destination MAC address - // 06 | 06 | Ethernet source MAC address - // 12 | 02 | Ethernet EtherType - const ( - etOff = 12 - etLen = 2 - - etARP = 0x0806 - ) - - // Set up a VM to filter traffic based on if its EtherType - // matches the ARP EtherType. - vm, err := bpf.NewVM([]bpf.Instruction{ - // Load EtherType value from Ethernet header - bpf.LoadAbsolute{ - Off: etOff, - Size: etLen, - }, - // If EtherType is equal to the ARP EtherType, jump to allow - // packet to be accepted - bpf.JumpIf{ - Cond: bpf.JumpEqual, - Val: etARP, - SkipTrue: 1, - }, - // EtherType does not match the ARP EtherType - bpf.RetConstant{ - Val: 0, - }, - // EtherType matches the ARP EtherType, accept up to 1500 - // bytes of packet - bpf.RetConstant{ - Val: 1500, - }, - }) - if err != nil { - panic(fmt.Sprintf("failed to load BPF program: %v", err)) - } - - // Create an Ethernet frame with the ARP EtherType for testing - frame := []byte{ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, - 0x08, 0x06, - // Payload omitted for brevity - } - - // Run our VM's BPF program using the Ethernet frame as input - out, err := vm.Run(frame) - if err != nil { - panic(fmt.Sprintf("failed to accept Ethernet frame: %v", err)) - } - - // BPF VM can return a byte count greater than the number of input - // bytes, so trim the output to match the input byte length - if out > len(frame) { - out = len(frame) - } - - fmt.Printf("out: %d bytes", out) - - // Output: - // out: 14 bytes -} - -// errStr returns the string representation of an error, or -// "" if it is nil. -func errStr(err error) string { - if err == nil { - return "" - } - - return err.Error() -} diff --git a/src/imagemagick/vendor/golang.org/x/net/codereview.cfg b/src/imagemagick/vendor/golang.org/x/net/codereview.cfg deleted file mode 100644 index 3f8b14b..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/codereview.cfg +++ /dev/null @@ -1 +0,0 @@ -issuerepo: golang/go diff --git a/src/imagemagick/vendor/golang.org/x/net/context/context.go b/src/imagemagick/vendor/golang.org/x/net/context/context.go deleted file mode 100644 index a3c021d..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/context.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2014 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 context defines the Context type, which carries deadlines, -// cancelation signals, and other request-scoped values across API boundaries -// and between processes. -// As of Go 1.7 this package is available in the standard library under the -// name context. https://golang.org/pkg/context. -// -// Incoming requests to a server should create a Context, and outgoing calls to -// servers should accept a Context. The chain of function calls between must -// propagate the Context, optionally replacing it with a modified copy created -// using WithDeadline, WithTimeout, WithCancel, or WithValue. -// -// Programs that use Contexts should follow these rules to keep interfaces -// consistent across packages and enable static analysis tools to check context -// propagation: -// -// Do not store Contexts inside a struct type; instead, pass a Context -// explicitly to each function that needs it. The Context should be the first -// parameter, typically named ctx: -// -// func DoSomething(ctx context.Context, arg Arg) error { -// // ... use ctx ... -// } -// -// Do not pass a nil Context, even if a function permits it. Pass context.TODO -// if you are unsure about which Context to use. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -// -// The same Context may be passed to functions running in different goroutines; -// Contexts are safe for simultaneous use by multiple goroutines. -// -// See http://blog.golang.org/context for example code for a server that uses -// Contexts. -package context // import "golang.org/x/net/context" - -// Background returns a non-nil, empty Context. It is never canceled, has no -// values, and has no deadline. It is typically used by the main function, -// initialization, and tests, and as the top-level Context for incoming -// requests. -func Background() Context { - return background -} - -// TODO returns a non-nil, empty Context. Code should use context.TODO when -// it's unclear which Context to use or it is not yet available (because the -// surrounding function has not yet been extended to accept a Context -// parameter). TODO is recognized by static analysis tools that determine -// whether Contexts are propagated correctly in a program. -func TODO() Context { - return todo -} diff --git a/src/imagemagick/vendor/golang.org/x/net/context/context_test.go b/src/imagemagick/vendor/golang.org/x/net/context/context_test.go deleted file mode 100644 index 6284413..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/context_test.go +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright 2014 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. - -// +build !go1.7 - -package context - -import ( - "fmt" - "math/rand" - "runtime" - "strings" - "sync" - "testing" - "time" -) - -// otherContext is a Context that's not one of the types defined in context.go. -// This lets us test code paths that differ based on the underlying type of the -// Context. -type otherContext struct { - Context -} - -func TestBackground(t *testing.T) { - c := Background() - if c == nil { - t.Fatalf("Background returned nil") - } - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - if got, want := fmt.Sprint(c), "context.Background"; got != want { - t.Errorf("Background().String() = %q want %q", got, want) - } -} - -func TestTODO(t *testing.T) { - c := TODO() - if c == nil { - t.Fatalf("TODO returned nil") - } - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - if got, want := fmt.Sprint(c), "context.TODO"; got != want { - t.Errorf("TODO().String() = %q want %q", got, want) - } -} - -func TestWithCancel(t *testing.T) { - c1, cancel := WithCancel(Background()) - - if got, want := fmt.Sprint(c1), "context.Background.WithCancel"; got != want { - t.Errorf("c1.String() = %q want %q", got, want) - } - - o := otherContext{c1} - c2, _ := WithCancel(o) - contexts := []Context{c1, o, c2} - - for i, c := range contexts { - if d := c.Done(); d == nil { - t.Errorf("c[%d].Done() == %v want non-nil", i, d) - } - if e := c.Err(); e != nil { - t.Errorf("c[%d].Err() == %v want nil", i, e) - } - - select { - case x := <-c.Done(): - t.Errorf("<-c.Done() == %v want nothing (it should block)", x) - default: - } - } - - cancel() - time.Sleep(100 * time.Millisecond) // let cancelation propagate - - for i, c := range contexts { - select { - case <-c.Done(): - default: - t.Errorf("<-c[%d].Done() blocked, but shouldn't have", i) - } - if e := c.Err(); e != Canceled { - t.Errorf("c[%d].Err() == %v want %v", i, e, Canceled) - } - } -} - -func TestParentFinishesChild(t *testing.T) { - // Context tree: - // parent -> cancelChild - // parent -> valueChild -> timerChild - parent, cancel := WithCancel(Background()) - cancelChild, stop := WithCancel(parent) - defer stop() - valueChild := WithValue(parent, "key", "value") - timerChild, stop := WithTimeout(valueChild, 10000*time.Hour) - defer stop() - - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - case x := <-cancelChild.Done(): - t.Errorf("<-cancelChild.Done() == %v want nothing (it should block)", x) - case x := <-timerChild.Done(): - t.Errorf("<-timerChild.Done() == %v want nothing (it should block)", x) - case x := <-valueChild.Done(): - t.Errorf("<-valueChild.Done() == %v want nothing (it should block)", x) - default: - } - - // The parent's children should contain the two cancelable children. - pc := parent.(*cancelCtx) - cc := cancelChild.(*cancelCtx) - tc := timerChild.(*timerCtx) - pc.mu.Lock() - if len(pc.children) != 2 || !pc.children[cc] || !pc.children[tc] { - t.Errorf("bad linkage: pc.children = %v, want %v and %v", - pc.children, cc, tc) - } - pc.mu.Unlock() - - if p, ok := parentCancelCtx(cc.Context); !ok || p != pc { - t.Errorf("bad linkage: parentCancelCtx(cancelChild.Context) = %v, %v want %v, true", p, ok, pc) - } - if p, ok := parentCancelCtx(tc.Context); !ok || p != pc { - t.Errorf("bad linkage: parentCancelCtx(timerChild.Context) = %v, %v want %v, true", p, ok, pc) - } - - cancel() - - pc.mu.Lock() - if len(pc.children) != 0 { - t.Errorf("pc.cancel didn't clear pc.children = %v", pc.children) - } - pc.mu.Unlock() - - // parent and children should all be finished. - check := func(ctx Context, name string) { - select { - case <-ctx.Done(): - default: - t.Errorf("<-%s.Done() blocked, but shouldn't have", name) - } - if e := ctx.Err(); e != Canceled { - t.Errorf("%s.Err() == %v want %v", name, e, Canceled) - } - } - check(parent, "parent") - check(cancelChild, "cancelChild") - check(valueChild, "valueChild") - check(timerChild, "timerChild") - - // WithCancel should return a canceled context on a canceled parent. - precanceledChild := WithValue(parent, "key", "value") - select { - case <-precanceledChild.Done(): - default: - t.Errorf("<-precanceledChild.Done() blocked, but shouldn't have") - } - if e := precanceledChild.Err(); e != Canceled { - t.Errorf("precanceledChild.Err() == %v want %v", e, Canceled) - } -} - -func TestChildFinishesFirst(t *testing.T) { - cancelable, stop := WithCancel(Background()) - defer stop() - for _, parent := range []Context{Background(), cancelable} { - child, cancel := WithCancel(parent) - - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - case x := <-child.Done(): - t.Errorf("<-child.Done() == %v want nothing (it should block)", x) - default: - } - - cc := child.(*cancelCtx) - pc, pcok := parent.(*cancelCtx) // pcok == false when parent == Background() - if p, ok := parentCancelCtx(cc.Context); ok != pcok || (ok && pc != p) { - t.Errorf("bad linkage: parentCancelCtx(cc.Context) = %v, %v want %v, %v", p, ok, pc, pcok) - } - - if pcok { - pc.mu.Lock() - if len(pc.children) != 1 || !pc.children[cc] { - t.Errorf("bad linkage: pc.children = %v, cc = %v", pc.children, cc) - } - pc.mu.Unlock() - } - - cancel() - - if pcok { - pc.mu.Lock() - if len(pc.children) != 0 { - t.Errorf("child's cancel didn't remove self from pc.children = %v", pc.children) - } - pc.mu.Unlock() - } - - // child should be finished. - select { - case <-child.Done(): - default: - t.Errorf("<-child.Done() blocked, but shouldn't have") - } - if e := child.Err(); e != Canceled { - t.Errorf("child.Err() == %v want %v", e, Canceled) - } - - // parent should not be finished. - select { - case x := <-parent.Done(): - t.Errorf("<-parent.Done() == %v want nothing (it should block)", x) - default: - } - if e := parent.Err(); e != nil { - t.Errorf("parent.Err() == %v want nil", e) - } - } -} - -func testDeadline(c Context, wait time.Duration, t *testing.T) { - select { - case <-time.After(wait): - t.Fatalf("context should have timed out") - case <-c.Done(): - } - if e := c.Err(); e != DeadlineExceeded { - t.Errorf("c.Err() == %v want %v", e, DeadlineExceeded) - } -} - -func TestDeadline(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithDeadline(Background(), time.Now().Add(1*timeUnit)) - if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { - t.Errorf("c.String() = %q want prefix %q", got, prefix) - } - testDeadline(c, 2*timeUnit, t) - - c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) - o := otherContext{c} - testDeadline(o, 2*timeUnit, t) - - c, _ = WithDeadline(Background(), time.Now().Add(1*timeUnit)) - o = otherContext{c} - c, _ = WithDeadline(o, time.Now().Add(3*timeUnit)) - testDeadline(c, 2*timeUnit, t) -} - -func TestTimeout(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithTimeout(Background(), 1*timeUnit) - if got, prefix := fmt.Sprint(c), "context.Background.WithDeadline("; !strings.HasPrefix(got, prefix) { - t.Errorf("c.String() = %q want prefix %q", got, prefix) - } - testDeadline(c, 2*timeUnit, t) - - c, _ = WithTimeout(Background(), 1*timeUnit) - o := otherContext{c} - testDeadline(o, 2*timeUnit, t) - - c, _ = WithTimeout(Background(), 1*timeUnit) - o = otherContext{c} - c, _ = WithTimeout(o, 3*timeUnit) - testDeadline(c, 2*timeUnit, t) -} - -func TestCanceledTimeout(t *testing.T) { - t.Parallel() - const timeUnit = 500 * time.Millisecond - c, _ := WithTimeout(Background(), 2*timeUnit) - o := otherContext{c} - c, cancel := WithTimeout(o, 4*timeUnit) - cancel() - time.Sleep(1 * timeUnit) // let cancelation propagate - select { - case <-c.Done(): - default: - t.Errorf("<-c.Done() blocked, but shouldn't have") - } - if e := c.Err(); e != Canceled { - t.Errorf("c.Err() == %v want %v", e, Canceled) - } -} - -type key1 int -type key2 int - -var k1 = key1(1) -var k2 = key2(1) // same int as k1, different type -var k3 = key2(3) // same type as k2, different int - -func TestValues(t *testing.T) { - check := func(c Context, nm, v1, v2, v3 string) { - if v, ok := c.Value(k1).(string); ok == (len(v1) == 0) || v != v1 { - t.Errorf(`%s.Value(k1).(string) = %q, %t want %q, %t`, nm, v, ok, v1, len(v1) != 0) - } - if v, ok := c.Value(k2).(string); ok == (len(v2) == 0) || v != v2 { - t.Errorf(`%s.Value(k2).(string) = %q, %t want %q, %t`, nm, v, ok, v2, len(v2) != 0) - } - if v, ok := c.Value(k3).(string); ok == (len(v3) == 0) || v != v3 { - t.Errorf(`%s.Value(k3).(string) = %q, %t want %q, %t`, nm, v, ok, v3, len(v3) != 0) - } - } - - c0 := Background() - check(c0, "c0", "", "", "") - - c1 := WithValue(Background(), k1, "c1k1") - check(c1, "c1", "c1k1", "", "") - - if got, want := fmt.Sprint(c1), `context.Background.WithValue(1, "c1k1")`; got != want { - t.Errorf("c.String() = %q want %q", got, want) - } - - c2 := WithValue(c1, k2, "c2k2") - check(c2, "c2", "c1k1", "c2k2", "") - - c3 := WithValue(c2, k3, "c3k3") - check(c3, "c2", "c1k1", "c2k2", "c3k3") - - c4 := WithValue(c3, k1, nil) - check(c4, "c4", "", "c2k2", "c3k3") - - o0 := otherContext{Background()} - check(o0, "o0", "", "", "") - - o1 := otherContext{WithValue(Background(), k1, "c1k1")} - check(o1, "o1", "c1k1", "", "") - - o2 := WithValue(o1, k2, "o2k2") - check(o2, "o2", "c1k1", "o2k2", "") - - o3 := otherContext{c4} - check(o3, "o3", "", "c2k2", "c3k3") - - o4 := WithValue(o3, k3, nil) - check(o4, "o4", "", "c2k2", "") -} - -func TestAllocs(t *testing.T) { - bg := Background() - for _, test := range []struct { - desc string - f func() - limit float64 - gccgoLimit float64 - }{ - { - desc: "Background()", - f: func() { Background() }, - limit: 0, - gccgoLimit: 0, - }, - { - desc: fmt.Sprintf("WithValue(bg, %v, nil)", k1), - f: func() { - c := WithValue(bg, k1, nil) - c.Value(k1) - }, - limit: 3, - gccgoLimit: 3, - }, - { - desc: "WithTimeout(bg, 15*time.Millisecond)", - f: func() { - c, _ := WithTimeout(bg, 15*time.Millisecond) - <-c.Done() - }, - limit: 8, - gccgoLimit: 16, - }, - { - desc: "WithCancel(bg)", - f: func() { - c, cancel := WithCancel(bg) - cancel() - <-c.Done() - }, - limit: 5, - gccgoLimit: 8, - }, - { - desc: "WithTimeout(bg, 100*time.Millisecond)", - f: func() { - c, cancel := WithTimeout(bg, 100*time.Millisecond) - cancel() - <-c.Done() - }, - limit: 8, - gccgoLimit: 25, - }, - } { - limit := test.limit - if runtime.Compiler == "gccgo" { - // gccgo does not yet do escape analysis. - // TODO(iant): Remove this when gccgo does do escape analysis. - limit = test.gccgoLimit - } - if n := testing.AllocsPerRun(100, test.f); n > limit { - t.Errorf("%s allocs = %f want %d", test.desc, n, int(limit)) - } - } -} - -func TestSimultaneousCancels(t *testing.T) { - root, cancel := WithCancel(Background()) - m := map[Context]CancelFunc{root: cancel} - q := []Context{root} - // Create a tree of contexts. - for len(q) != 0 && len(m) < 100 { - parent := q[0] - q = q[1:] - for i := 0; i < 4; i++ { - ctx, cancel := WithCancel(parent) - m[ctx] = cancel - q = append(q, ctx) - } - } - // Start all the cancels in a random order. - var wg sync.WaitGroup - wg.Add(len(m)) - for _, cancel := range m { - go func(cancel CancelFunc) { - cancel() - wg.Done() - }(cancel) - } - // Wait on all the contexts in a random order. - for ctx := range m { - select { - case <-ctx.Done(): - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for <-ctx.Done(); stacks:\n%s", buf[:n]) - } - } - // Wait for all the cancel functions to return. - done := make(chan struct{}) - go func() { - wg.Wait() - close(done) - }() - select { - case <-done: - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for cancel functions; stacks:\n%s", buf[:n]) - } -} - -func TestInterlockedCancels(t *testing.T) { - parent, cancelParent := WithCancel(Background()) - child, cancelChild := WithCancel(parent) - go func() { - parent.Done() - cancelChild() - }() - cancelParent() - select { - case <-child.Done(): - case <-time.After(1 * time.Second): - buf := make([]byte, 10<<10) - n := runtime.Stack(buf, true) - t.Fatalf("timed out waiting for child.Done(); stacks:\n%s", buf[:n]) - } -} - -func TestLayersCancel(t *testing.T) { - testLayers(t, time.Now().UnixNano(), false) -} - -func TestLayersTimeout(t *testing.T) { - testLayers(t, time.Now().UnixNano(), true) -} - -func testLayers(t *testing.T, seed int64, testTimeout bool) { - rand.Seed(seed) - errorf := func(format string, a ...interface{}) { - t.Errorf(fmt.Sprintf("seed=%d: %s", seed, format), a...) - } - const ( - timeout = 200 * time.Millisecond - minLayers = 30 - ) - type value int - var ( - vals []*value - cancels []CancelFunc - numTimers int - ctx = Background() - ) - for i := 0; i < minLayers || numTimers == 0 || len(cancels) == 0 || len(vals) == 0; i++ { - switch rand.Intn(3) { - case 0: - v := new(value) - ctx = WithValue(ctx, v, v) - vals = append(vals, v) - case 1: - var cancel CancelFunc - ctx, cancel = WithCancel(ctx) - cancels = append(cancels, cancel) - case 2: - var cancel CancelFunc - ctx, cancel = WithTimeout(ctx, timeout) - cancels = append(cancels, cancel) - numTimers++ - } - } - checkValues := func(when string) { - for _, key := range vals { - if val := ctx.Value(key).(*value); key != val { - errorf("%s: ctx.Value(%p) = %p want %p", when, key, val, key) - } - } - } - select { - case <-ctx.Done(): - errorf("ctx should not be canceled yet") - default: - } - if s, prefix := fmt.Sprint(ctx), "context.Background."; !strings.HasPrefix(s, prefix) { - t.Errorf("ctx.String() = %q want prefix %q", s, prefix) - } - t.Log(ctx) - checkValues("before cancel") - if testTimeout { - select { - case <-ctx.Done(): - case <-time.After(timeout + 100*time.Millisecond): - errorf("ctx should have timed out") - } - checkValues("after timeout") - } else { - cancel := cancels[rand.Intn(len(cancels))] - cancel() - select { - case <-ctx.Done(): - default: - errorf("ctx should be canceled") - } - checkValues("after cancel") - } -} - -func TestCancelRemoves(t *testing.T) { - checkChildren := func(when string, ctx Context, want int) { - if got := len(ctx.(*cancelCtx).children); got != want { - t.Errorf("%s: context has %d children, want %d", when, got, want) - } - } - - ctx, _ := WithCancel(Background()) - checkChildren("after creation", ctx, 0) - _, cancel := WithCancel(ctx) - checkChildren("with WithCancel child ", ctx, 1) - cancel() - checkChildren("after cancelling WithCancel child", ctx, 0) - - ctx, _ = WithCancel(Background()) - checkChildren("after creation", ctx, 0) - _, cancel = WithTimeout(ctx, 60*time.Minute) - checkChildren("with WithTimeout child ", ctx, 1) - cancel() - checkChildren("after cancelling WithTimeout child", ctx, 0) -} diff --git a/src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go deleted file mode 100644 index 37dc0cf..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +++ /dev/null @@ -1,71 +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 ctxhttp provides helper functions for performing context-aware HTTP requests. -package ctxhttp // import "golang.org/x/net/context/ctxhttp" - -import ( - "context" - "io" - "net/http" - "net/url" - "strings" -) - -// Do sends an HTTP request with the provided http.Client and returns -// an HTTP response. -// -// If the client is nil, http.DefaultClient is used. -// -// The provided ctx must be non-nil. If it is canceled or times out, -// ctx.Err() will be returned. -func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { - if client == nil { - client = http.DefaultClient - } - resp, err := client.Do(req.WithContext(ctx)) - // If we got an error, and the context has been canceled, - // the context's error is probably more useful. - if err != nil { - select { - case <-ctx.Done(): - err = ctx.Err() - default: - } - } - return resp, err -} - -// Get issues a GET request via the Do function. -func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("GET", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Head issues a HEAD request via the Do function. -func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { - req, err := http.NewRequest("HEAD", url, nil) - if err != nil { - return nil, err - } - return Do(ctx, client, req) -} - -// Post issues a POST request via the Do function. -func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { - req, err := http.NewRequest("POST", url, body) - if err != nil { - return nil, err - } - req.Header.Set("Content-Type", bodyType) - return Do(ctx, client, req) -} - -// PostForm issues a POST request via the Do function. -func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { - return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) -} diff --git a/src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go b/src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go deleted file mode 100644 index c4339c4..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_test.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2015 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. - -// +build !plan9 - -package ctxhttp - -import ( - "context" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - "time" -) - -func TestGo17Context(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "ok") - })) - defer ts.Close() - ctx := context.Background() - resp, err := Get(ctx, http.DefaultClient, ts.URL) - if resp == nil || err != nil { - t.Fatalf("error received from client: %v %v", err, resp) - } - resp.Body.Close() -} - -const ( - requestDuration = 100 * time.Millisecond - requestBody = "ok" -) - -func okHandler(w http.ResponseWriter, r *http.Request) { - time.Sleep(requestDuration) - io.WriteString(w, requestBody) -} - -func TestNoTimeout(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(okHandler)) - defer ts.Close() - - ctx := context.Background() - res, err := Get(ctx, nil, ts.URL) - if err != nil { - t.Fatal(err) - } - defer res.Body.Close() - slurp, err := ioutil.ReadAll(res.Body) - if err != nil { - t.Fatal(err) - } - if string(slurp) != requestBody { - t.Errorf("body = %q; want %q", slurp, requestBody) - } -} - -func TestCancelBeforeHeaders(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - - blockServer := make(chan struct{}) - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - cancel() - <-blockServer - io.WriteString(w, requestBody) - })) - defer ts.Close() - defer close(blockServer) - - res, err := Get(ctx, nil, ts.URL) - if err == nil { - res.Body.Close() - t.Fatal("Get returned unexpected nil error") - } - if err != context.Canceled { - t.Errorf("err = %v; want %v", err, context.Canceled) - } -} - -func TestCancelAfterHangingRequest(t *testing.T) { - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - w.(http.Flusher).Flush() - <-w.(http.CloseNotifier).CloseNotify() - })) - defer ts.Close() - - ctx, cancel := context.WithCancel(context.Background()) - resp, err := Get(ctx, nil, ts.URL) - if err != nil { - t.Fatalf("unexpected error in Get: %v", err) - } - - // Cancel befer reading the body. - // Reading Request.Body should fail, since the request was - // canceled before anything was written. - cancel() - - done := make(chan struct{}) - - go func() { - b, err := ioutil.ReadAll(resp.Body) - if len(b) != 0 || err == nil { - t.Errorf(`Read got (%q, %v); want ("", error)`, b, err) - } - close(done) - }() - - select { - case <-time.After(1 * time.Second): - t.Errorf("Test timed out") - case <-done: - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/context/go17.go b/src/imagemagick/vendor/golang.org/x/net/context/go17.go deleted file mode 100644 index d20f52b..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/go17.go +++ /dev/null @@ -1,72 +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. - -// +build go1.7 - -package context - -import ( - "context" // standard library's context, as of Go 1.7 - "time" -) - -var ( - todo = context.TODO() - background = context.Background() -) - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = context.Canceled - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = context.DeadlineExceeded - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - ctx, f := context.WithCancel(parent) - return ctx, CancelFunc(f) -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - ctx, f := context.WithDeadline(parent, deadline) - return ctx, CancelFunc(f) -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return context.WithValue(parent, key, val) -} diff --git a/src/imagemagick/vendor/golang.org/x/net/context/go19.go b/src/imagemagick/vendor/golang.org/x/net/context/go19.go deleted file mode 100644 index d88bd1d..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/go19.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 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. - -// +build go1.9 - -package context - -import "context" // standard library's context, as of Go 1.7 - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context = context.Context - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc = context.CancelFunc diff --git a/src/imagemagick/vendor/golang.org/x/net/context/pre_go17.go b/src/imagemagick/vendor/golang.org/x/net/context/pre_go17.go deleted file mode 100644 index 0f35592..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/pre_go17.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2014 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. - -// +build !go1.7 - -package context - -import ( - "errors" - "fmt" - "sync" - "time" -) - -// An emptyCtx is never canceled, has no values, and has no deadline. It is not -// struct{}, since vars of this type must have distinct addresses. -type emptyCtx int - -func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { - return -} - -func (*emptyCtx) Done() <-chan struct{} { - return nil -} - -func (*emptyCtx) Err() error { - return nil -} - -func (*emptyCtx) Value(key interface{}) interface{} { - return nil -} - -func (e *emptyCtx) String() string { - switch e { - case background: - return "context.Background" - case todo: - return "context.TODO" - } - return "unknown empty Context" -} - -var ( - background = new(emptyCtx) - todo = new(emptyCtx) -) - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = errors.New("context canceled") - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = errors.New("context deadline exceeded") - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - c := newCancelCtx(parent) - propagateCancel(parent, c) - return c, func() { c.cancel(true, Canceled) } -} - -// newCancelCtx returns an initialized cancelCtx. -func newCancelCtx(parent Context) *cancelCtx { - return &cancelCtx{ - Context: parent, - done: make(chan struct{}), - } -} - -// propagateCancel arranges for child to be canceled when parent is. -func propagateCancel(parent Context, child canceler) { - if parent.Done() == nil { - return // parent is never canceled - } - if p, ok := parentCancelCtx(parent); ok { - p.mu.Lock() - if p.err != nil { - // parent has already been canceled - child.cancel(false, p.err) - } else { - if p.children == nil { - p.children = make(map[canceler]bool) - } - p.children[child] = true - } - p.mu.Unlock() - } else { - go func() { - select { - case <-parent.Done(): - child.cancel(false, parent.Err()) - case <-child.Done(): - } - }() - } -} - -// parentCancelCtx follows a chain of parent references until it finds a -// *cancelCtx. This function understands how each of the concrete types in this -// package represents its parent. -func parentCancelCtx(parent Context) (*cancelCtx, bool) { - for { - switch c := parent.(type) { - case *cancelCtx: - return c, true - case *timerCtx: - return c.cancelCtx, true - case *valueCtx: - parent = c.Context - default: - return nil, false - } - } -} - -// removeChild removes a context from its parent. -func removeChild(parent Context, child canceler) { - p, ok := parentCancelCtx(parent) - if !ok { - return - } - p.mu.Lock() - if p.children != nil { - delete(p.children, child) - } - p.mu.Unlock() -} - -// A canceler is a context type that can be canceled directly. The -// implementations are *cancelCtx and *timerCtx. -type canceler interface { - cancel(removeFromParent bool, err error) - Done() <-chan struct{} -} - -// A cancelCtx can be canceled. When canceled, it also cancels any children -// that implement canceler. -type cancelCtx struct { - Context - - done chan struct{} // closed by the first cancel call. - - mu sync.Mutex - children map[canceler]bool // set to nil by the first cancel call - err error // set to non-nil by the first cancel call -} - -func (c *cancelCtx) Done() <-chan struct{} { - return c.done -} - -func (c *cancelCtx) Err() error { - c.mu.Lock() - defer c.mu.Unlock() - return c.err -} - -func (c *cancelCtx) String() string { - return fmt.Sprintf("%v.WithCancel", c.Context) -} - -// cancel closes c.done, cancels each of c's children, and, if -// removeFromParent is true, removes c from its parent's children. -func (c *cancelCtx) cancel(removeFromParent bool, err error) { - if err == nil { - panic("context: internal error: missing cancel error") - } - c.mu.Lock() - if c.err != nil { - c.mu.Unlock() - return // already canceled - } - c.err = err - close(c.done) - for child := range c.children { - // NOTE: acquiring the child's lock while holding parent's lock. - child.cancel(false, err) - } - c.children = nil - c.mu.Unlock() - - if removeFromParent { - removeChild(c.Context, c) - } -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { - // The current deadline is already sooner than the new one. - return WithCancel(parent) - } - c := &timerCtx{ - cancelCtx: newCancelCtx(parent), - deadline: deadline, - } - propagateCancel(parent, c) - d := deadline.Sub(time.Now()) - if d <= 0 { - c.cancel(true, DeadlineExceeded) // deadline has already passed - return c, func() { c.cancel(true, Canceled) } - } - c.mu.Lock() - defer c.mu.Unlock() - if c.err == nil { - c.timer = time.AfterFunc(d, func() { - c.cancel(true, DeadlineExceeded) - }) - } - return c, func() { c.cancel(true, Canceled) } -} - -// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to -// implement Done and Err. It implements cancel by stopping its timer then -// delegating to cancelCtx.cancel. -type timerCtx struct { - *cancelCtx - timer *time.Timer // Under cancelCtx.mu. - - deadline time.Time -} - -func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { - return c.deadline, true -} - -func (c *timerCtx) String() string { - return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) -} - -func (c *timerCtx) cancel(removeFromParent bool, err error) { - c.cancelCtx.cancel(false, err) - if removeFromParent { - // Remove this timerCtx from its parent cancelCtx's children. - removeChild(c.cancelCtx.Context, c) - } - c.mu.Lock() - if c.timer != nil { - c.timer.Stop() - c.timer = nil - } - c.mu.Unlock() -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return &valueCtx{parent, key, val} -} - -// A valueCtx carries a key-value pair. It implements Value for that key and -// delegates all other calls to the embedded Context. -type valueCtx struct { - Context - key, val interface{} -} - -func (c *valueCtx) String() string { - return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) -} - -func (c *valueCtx) Value(key interface{}) interface{} { - if c.key == key { - return c.val - } - return c.Context.Value(key) -} diff --git a/src/imagemagick/vendor/golang.org/x/net/context/pre_go19.go b/src/imagemagick/vendor/golang.org/x/net/context/pre_go19.go deleted file mode 100644 index b105f80..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/pre_go19.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2014 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. - -// +build !go1.9 - -package context - -import "time" - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - // - // WithCancel arranges for Done to be closed when cancel is called; - // WithDeadline arranges for Done to be closed when the deadline - // expires; WithTimeout arranges for Done to be closed when the timeout - // elapses. - // - // Done is provided for use in select statements: - // - // // Stream generates values with DoSomething and sends them to out - // // until DoSomething returns an error or ctx.Done is closed. - // func Stream(ctx context.Context, out chan<- Value) error { - // for { - // v, err := DoSomething(ctx) - // if err != nil { - // return err - // } - // select { - // case <-ctx.Done(): - // return ctx.Err() - // case out <- v: - // } - // } - // } - // - // See http://blog.golang.org/pipelines for more examples of how to use - // a Done channel for cancelation. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - // - // A key identifies a specific value in a Context. Functions that wish - // to store values in Context typically allocate a key in a global - // variable then use that key as the argument to context.WithValue and - // Context.Value. A key can be any type that supports equality; - // packages should define keys as an unexported type to avoid - // collisions. - // - // Packages that define a Context key should provide type-safe accessors - // for the values stores using that key: - // - // // Package user defines a User type that's stored in Contexts. - // package user - // - // import "golang.org/x/net/context" - // - // // User is the type of value stored in the Contexts. - // type User struct {...} - // - // // key is an unexported type for keys defined in this package. - // // This prevents collisions with keys defined in other packages. - // type key int - // - // // userKey is the key for user.User values in Contexts. It is - // // unexported; clients use user.NewContext and user.FromContext - // // instead of using this key directly. - // var userKey key = 0 - // - // // NewContext returns a new Context that carries value u. - // func NewContext(ctx context.Context, u *User) context.Context { - // return context.WithValue(ctx, userKey, u) - // } - // - // // FromContext returns the User value stored in ctx, if any. - // func FromContext(ctx context.Context) (*User, bool) { - // u, ok := ctx.Value(userKey).(*User) - // return u, ok - // } - Value(key interface{}) interface{} -} - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc func() diff --git a/src/imagemagick/vendor/golang.org/x/net/context/withtimeout_test.go b/src/imagemagick/vendor/golang.org/x/net/context/withtimeout_test.go deleted file mode 100644 index e6f5669..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/context/withtimeout_test.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 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 context_test - -import ( - "fmt" - "time" - - "golang.org/x/net/context" -) - -// This example passes a context with a timeout to tell a blocking function that -// it should abandon its work after the timeout elapses. -func ExampleWithTimeout() { - // Pass a context with a timeout to tell a blocking function that it - // should abandon its work after the timeout elapses. - ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) - defer cancel() - - select { - case <-time.After(1 * time.Second): - fmt.Println("overslept") - case <-ctx.Done(): - fmt.Println(ctx.Err()) // prints "context deadline exceeded" - } - - // Output: - // context deadline exceeded -} diff --git a/src/imagemagick/vendor/golang.org/x/net/dict/dict.go b/src/imagemagick/vendor/golang.org/x/net/dict/dict.go deleted file mode 100644 index 93e65c0..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/dict/dict.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2010 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 dict implements the Dictionary Server Protocol -// as defined in RFC 2229. -package dict // import "golang.org/x/net/dict" - -import ( - "net/textproto" - "strconv" - "strings" -) - -// A Client represents a client connection to a dictionary server. -type Client struct { - text *textproto.Conn -} - -// Dial returns a new client connected to a dictionary server at -// addr on the given network. -func Dial(network, addr string) (*Client, error) { - text, err := textproto.Dial(network, addr) - if err != nil { - return nil, err - } - _, _, err = text.ReadCodeLine(220) - if err != nil { - text.Close() - return nil, err - } - return &Client{text: text}, nil -} - -// Close closes the connection to the dictionary server. -func (c *Client) Close() error { - return c.text.Close() -} - -// A Dict represents a dictionary available on the server. -type Dict struct { - Name string // short name of dictionary - Desc string // long description -} - -// Dicts returns a list of the dictionaries available on the server. -func (c *Client) Dicts() ([]Dict, error) { - id, err := c.text.Cmd("SHOW DB") - if err != nil { - return nil, err - } - - c.text.StartResponse(id) - defer c.text.EndResponse(id) - - _, _, err = c.text.ReadCodeLine(110) - if err != nil { - return nil, err - } - lines, err := c.text.ReadDotLines() - if err != nil { - return nil, err - } - _, _, err = c.text.ReadCodeLine(250) - - dicts := make([]Dict, len(lines)) - for i := range dicts { - d := &dicts[i] - a, _ := fields(lines[i]) - if len(a) < 2 { - return nil, textproto.ProtocolError("invalid dictionary: " + lines[i]) - } - d.Name = a[0] - d.Desc = a[1] - } - return dicts, err -} - -// A Defn represents a definition. -type Defn struct { - Dict Dict // Dict where definition was found - Word string // Word being defined - Text []byte // Definition text, typically multiple lines -} - -// Define requests the definition of the given word. -// The argument dict names the dictionary to use, -// the Name field of a Dict returned by Dicts. -// -// The special dictionary name "*" means to look in all the -// server's dictionaries. -// The special dictionary name "!" means to look in all the -// server's dictionaries in turn, stopping after finding the word -// in one of them. -func (c *Client) Define(dict, word string) ([]*Defn, error) { - id, err := c.text.Cmd("DEFINE %s %q", dict, word) - if err != nil { - return nil, err - } - - c.text.StartResponse(id) - defer c.text.EndResponse(id) - - _, line, err := c.text.ReadCodeLine(150) - if err != nil { - return nil, err - } - a, _ := fields(line) - if len(a) < 1 { - return nil, textproto.ProtocolError("malformed response: " + line) - } - n, err := strconv.Atoi(a[0]) - if err != nil { - return nil, textproto.ProtocolError("invalid definition count: " + a[0]) - } - def := make([]*Defn, n) - for i := 0; i < n; i++ { - _, line, err = c.text.ReadCodeLine(151) - if err != nil { - return nil, err - } - a, _ := fields(line) - if len(a) < 3 { - // skip it, to keep protocol in sync - i-- - n-- - def = def[0:n] - continue - } - d := &Defn{Word: a[0], Dict: Dict{a[1], a[2]}} - d.Text, err = c.text.ReadDotBytes() - if err != nil { - return nil, err - } - def[i] = d - } - _, _, err = c.text.ReadCodeLine(250) - return def, err -} - -// Fields returns the fields in s. -// Fields are space separated unquoted words -// or quoted with single or double quote. -func fields(s string) ([]string, error) { - var v []string - i := 0 - for { - for i < len(s) && (s[i] == ' ' || s[i] == '\t') { - i++ - } - if i >= len(s) { - break - } - if s[i] == '"' || s[i] == '\'' { - q := s[i] - // quoted string - var j int - for j = i + 1; ; j++ { - if j >= len(s) { - return nil, textproto.ProtocolError("malformed quoted string") - } - if s[j] == '\\' { - j++ - continue - } - if s[j] == q { - j++ - break - } - } - v = append(v, unquote(s[i+1:j-1])) - i = j - } else { - // atom - var j int - for j = i; j < len(s); j++ { - if s[j] == ' ' || s[j] == '\t' || s[j] == '\\' || s[j] == '"' || s[j] == '\'' { - break - } - } - v = append(v, s[i:j]) - i = j - } - if i < len(s) { - c := s[i] - if c != ' ' && c != '\t' { - return nil, textproto.ProtocolError("quotes not on word boundaries") - } - } - } - return v, nil -} - -func unquote(s string) string { - if strings.Index(s, "\\") < 0 { - return s - } - b := []byte(s) - w := 0 - for r := 0; r < len(b); r++ { - c := b[r] - if c == '\\' { - r++ - c = b[r] - } - b[w] = c - w++ - } - return string(b[0:w]) -} diff --git a/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/example_test.go b/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/example_test.go deleted file mode 100644 index 8600a6b..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2017 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 dnsmessage_test - -import ( - "fmt" - "net" - "strings" - - "golang.org/x/net/dns/dnsmessage" -) - -func mustNewName(name string) dnsmessage.Name { - n, err := dnsmessage.NewName(name) - if err != nil { - panic(err) - } - return n -} - -func ExampleParser() { - msg := dnsmessage.Message{ - Header: dnsmessage.Header{Response: true, Authoritative: true}, - Questions: []dnsmessage.Question{ - { - Name: mustNewName("foo.bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - { - Name: mustNewName("bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - }, - Answers: []dnsmessage.Resource{ - { - Header: dnsmessage.ResourceHeader{ - Name: mustNewName("foo.bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 1}}, - }, - { - Header: dnsmessage.ResourceHeader{ - Name: mustNewName("bar.example.com."), - Type: dnsmessage.TypeA, - Class: dnsmessage.ClassINET, - }, - Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 2}}, - }, - }, - } - - buf, err := msg.Pack() - if err != nil { - panic(err) - } - - wantName := "bar.example.com." - - var p dnsmessage.Parser - if _, err := p.Start(buf); err != nil { - panic(err) - } - - for { - q, err := p.Question() - if err == dnsmessage.ErrSectionDone { - break - } - if err != nil { - panic(err) - } - - if q.Name.String() != wantName { - continue - } - - fmt.Println("Found question for name", wantName) - if err := p.SkipAllQuestions(); err != nil { - panic(err) - } - break - } - - var gotIPs []net.IP - for { - h, err := p.AnswerHeader() - if err == dnsmessage.ErrSectionDone { - break - } - if err != nil { - panic(err) - } - - if (h.Type != dnsmessage.TypeA && h.Type != dnsmessage.TypeAAAA) || h.Class != dnsmessage.ClassINET { - continue - } - - if !strings.EqualFold(h.Name.String(), wantName) { - if err := p.SkipAnswer(); err != nil { - panic(err) - } - continue - } - - switch h.Type { - case dnsmessage.TypeA: - r, err := p.AResource() - if err != nil { - panic(err) - } - gotIPs = append(gotIPs, r.A[:]) - case dnsmessage.TypeAAAA: - r, err := p.AAAAResource() - if err != nil { - panic(err) - } - gotIPs = append(gotIPs, r.AAAA[:]) - } - } - - fmt.Printf("Found A/AAAA records for name %s: %v\n", wantName, gotIPs) - - // Output: - // Found question for name bar.example.com. - // Found A/AAAA records for name bar.example.com.: [127.0.0.2] -} diff --git a/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message.go b/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message.go deleted file mode 100644 index 13fbc08..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message.go +++ /dev/null @@ -1,2606 +0,0 @@ -// Copyright 2009 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 dnsmessage provides a mostly RFC 1035 compliant implementation of -// DNS message packing and unpacking. -// -// The package also supports messages with Extension Mechanisms for DNS -// (EDNS(0)) as defined in RFC 6891. -// -// This implementation is designed to minimize heap allocations and avoid -// unnecessary packing and unpacking as much as possible. -package dnsmessage - -import ( - "errors" -) - -// Message formats - -// A Type is a type of DNS request and response. -type Type uint16 - -const ( - // ResourceHeader.Type and Question.Type - TypeA Type = 1 - TypeNS Type = 2 - TypeCNAME Type = 5 - TypeSOA Type = 6 - TypePTR Type = 12 - TypeMX Type = 15 - TypeTXT Type = 16 - TypeAAAA Type = 28 - TypeSRV Type = 33 - TypeOPT Type = 41 - - // Question.Type - TypeWKS Type = 11 - TypeHINFO Type = 13 - TypeMINFO Type = 14 - TypeAXFR Type = 252 - TypeALL Type = 255 -) - -var typeNames = map[Type]string{ - TypeA: "TypeA", - TypeNS: "TypeNS", - TypeCNAME: "TypeCNAME", - TypeSOA: "TypeSOA", - TypePTR: "TypePTR", - TypeMX: "TypeMX", - TypeTXT: "TypeTXT", - TypeAAAA: "TypeAAAA", - TypeSRV: "TypeSRV", - TypeOPT: "TypeOPT", - TypeWKS: "TypeWKS", - TypeHINFO: "TypeHINFO", - TypeMINFO: "TypeMINFO", - TypeAXFR: "TypeAXFR", - TypeALL: "TypeALL", -} - -// String implements fmt.Stringer.String. -func (t Type) String() string { - if n, ok := typeNames[t]; ok { - return n - } - return printUint16(uint16(t)) -} - -// GoString implements fmt.GoStringer.GoString. -func (t Type) GoString() string { - if n, ok := typeNames[t]; ok { - return "dnsmessage." + n - } - return printUint16(uint16(t)) -} - -// A Class is a type of network. -type Class uint16 - -const ( - // ResourceHeader.Class and Question.Class - ClassINET Class = 1 - ClassCSNET Class = 2 - ClassCHAOS Class = 3 - ClassHESIOD Class = 4 - - // Question.Class - ClassANY Class = 255 -) - -var classNames = map[Class]string{ - ClassINET: "ClassINET", - ClassCSNET: "ClassCSNET", - ClassCHAOS: "ClassCHAOS", - ClassHESIOD: "ClassHESIOD", - ClassANY: "ClassANY", -} - -// String implements fmt.Stringer.String. -func (c Class) String() string { - if n, ok := classNames[c]; ok { - return n - } - return printUint16(uint16(c)) -} - -// GoString implements fmt.GoStringer.GoString. -func (c Class) GoString() string { - if n, ok := classNames[c]; ok { - return "dnsmessage." + n - } - return printUint16(uint16(c)) -} - -// An OpCode is a DNS operation code. -type OpCode uint16 - -// GoString implements fmt.GoStringer.GoString. -func (o OpCode) GoString() string { - return printUint16(uint16(o)) -} - -// An RCode is a DNS response status code. -type RCode uint16 - -const ( - // Message.Rcode - RCodeSuccess RCode = 0 - RCodeFormatError RCode = 1 - RCodeServerFailure RCode = 2 - RCodeNameError RCode = 3 - RCodeNotImplemented RCode = 4 - RCodeRefused RCode = 5 -) - -var rCodeNames = map[RCode]string{ - RCodeSuccess: "RCodeSuccess", - RCodeFormatError: "RCodeFormatError", - RCodeServerFailure: "RCodeServerFailure", - RCodeNameError: "RCodeNameError", - RCodeNotImplemented: "RCodeNotImplemented", - RCodeRefused: "RCodeRefused", -} - -// String implements fmt.Stringer.String. -func (r RCode) String() string { - if n, ok := rCodeNames[r]; ok { - return n - } - return printUint16(uint16(r)) -} - -// GoString implements fmt.GoStringer.GoString. -func (r RCode) GoString() string { - if n, ok := rCodeNames[r]; ok { - return "dnsmessage." + n - } - return printUint16(uint16(r)) -} - -func printPaddedUint8(i uint8) string { - b := byte(i) - return string([]byte{ - b/100 + '0', - b/10%10 + '0', - b%10 + '0', - }) -} - -func printUint8Bytes(buf []byte, i uint8) []byte { - b := byte(i) - if i >= 100 { - buf = append(buf, b/100+'0') - } - if i >= 10 { - buf = append(buf, b/10%10+'0') - } - return append(buf, b%10+'0') -} - -func printByteSlice(b []byte) string { - if len(b) == 0 { - return "" - } - buf := make([]byte, 0, 5*len(b)) - buf = printUint8Bytes(buf, uint8(b[0])) - for _, n := range b[1:] { - buf = append(buf, ',', ' ') - buf = printUint8Bytes(buf, uint8(n)) - } - return string(buf) -} - -const hexDigits = "0123456789abcdef" - -func printString(str []byte) string { - buf := make([]byte, 0, len(str)) - for i := 0; i < len(str); i++ { - c := str[i] - if c == '.' || c == '-' || c == ' ' || - 'A' <= c && c <= 'Z' || - 'a' <= c && c <= 'z' || - '0' <= c && c <= '9' { - buf = append(buf, c) - continue - } - - upper := c >> 4 - lower := (c << 4) >> 4 - buf = append( - buf, - '\\', - 'x', - hexDigits[upper], - hexDigits[lower], - ) - } - return string(buf) -} - -func printUint16(i uint16) string { - return printUint32(uint32(i)) -} - -func printUint32(i uint32) string { - // Max value is 4294967295. - buf := make([]byte, 10) - for b, d := buf, uint32(1000000000); d > 0; d /= 10 { - b[0] = byte(i/d%10 + '0') - if b[0] == '0' && len(b) == len(buf) && len(buf) > 1 { - buf = buf[1:] - } - b = b[1:] - i %= d - } - return string(buf) -} - -func printBool(b bool) string { - if b { - return "true" - } - return "false" -} - -var ( - // ErrNotStarted indicates that the prerequisite information isn't - // available yet because the previous records haven't been appropriately - // parsed, skipped or finished. - ErrNotStarted = errors.New("parsing/packing of this type isn't available yet") - - // ErrSectionDone indicated that all records in the section have been - // parsed or finished. - ErrSectionDone = errors.New("parsing/packing of this section has completed") - - errBaseLen = errors.New("insufficient data for base length type") - errCalcLen = errors.New("insufficient data for calculated length type") - errReserved = errors.New("segment prefix is reserved") - errTooManyPtr = errors.New("too many pointers (>10)") - errInvalidPtr = errors.New("invalid pointer") - errNilResouceBody = errors.New("nil resource body") - errResourceLen = errors.New("insufficient data for resource body length") - errSegTooLong = errors.New("segment length too long") - errZeroSegLen = errors.New("zero length segment") - errResTooLong = errors.New("resource length too long") - errTooManyQuestions = errors.New("too many Questions to pack (>65535)") - errTooManyAnswers = errors.New("too many Answers to pack (>65535)") - errTooManyAuthorities = errors.New("too many Authorities to pack (>65535)") - errTooManyAdditionals = errors.New("too many Additionals to pack (>65535)") - errNonCanonicalName = errors.New("name is not in canonical format (it must end with a .)") - errStringTooLong = errors.New("character string exceeds maximum length (255)") - errCompressedSRV = errors.New("compressed name in SRV resource data") -) - -// Internal constants. -const ( - // packStartingCap is the default initial buffer size allocated during - // packing. - // - // The starting capacity doesn't matter too much, but most DNS responses - // Will be <= 512 bytes as it is the limit for DNS over UDP. - packStartingCap = 512 - - // uint16Len is the length (in bytes) of a uint16. - uint16Len = 2 - - // uint32Len is the length (in bytes) of a uint32. - uint32Len = 4 - - // headerLen is the length (in bytes) of a DNS header. - // - // A header is comprised of 6 uint16s and no padding. - headerLen = 6 * uint16Len -) - -type nestedError struct { - // s is the current level's error message. - s string - - // err is the nested error. - err error -} - -// nestedError implements error.Error. -func (e *nestedError) Error() string { - return e.s + ": " + e.err.Error() -} - -// Header is a representation of a DNS message header. -type Header struct { - ID uint16 - Response bool - OpCode OpCode - Authoritative bool - Truncated bool - RecursionDesired bool - RecursionAvailable bool - RCode RCode -} - -func (m *Header) pack() (id uint16, bits uint16) { - id = m.ID - bits = uint16(m.OpCode)<<11 | uint16(m.RCode) - if m.RecursionAvailable { - bits |= headerBitRA - } - if m.RecursionDesired { - bits |= headerBitRD - } - if m.Truncated { - bits |= headerBitTC - } - if m.Authoritative { - bits |= headerBitAA - } - if m.Response { - bits |= headerBitQR - } - return -} - -// GoString implements fmt.GoStringer.GoString. -func (m *Header) GoString() string { - return "dnsmessage.Header{" + - "ID: " + printUint16(m.ID) + ", " + - "Response: " + printBool(m.Response) + ", " + - "OpCode: " + m.OpCode.GoString() + ", " + - "Authoritative: " + printBool(m.Authoritative) + ", " + - "Truncated: " + printBool(m.Truncated) + ", " + - "RecursionDesired: " + printBool(m.RecursionDesired) + ", " + - "RecursionAvailable: " + printBool(m.RecursionAvailable) + ", " + - "RCode: " + m.RCode.GoString() + "}" -} - -// Message is a representation of a DNS message. -type Message struct { - Header - Questions []Question - Answers []Resource - Authorities []Resource - Additionals []Resource -} - -type section uint8 - -const ( - sectionNotStarted section = iota - sectionHeader - sectionQuestions - sectionAnswers - sectionAuthorities - sectionAdditionals - sectionDone - - headerBitQR = 1 << 15 // query/response (response=1) - headerBitAA = 1 << 10 // authoritative - headerBitTC = 1 << 9 // truncated - headerBitRD = 1 << 8 // recursion desired - headerBitRA = 1 << 7 // recursion available -) - -var sectionNames = map[section]string{ - sectionHeader: "header", - sectionQuestions: "Question", - sectionAnswers: "Answer", - sectionAuthorities: "Authority", - sectionAdditionals: "Additional", -} - -// header is the wire format for a DNS message header. -type header struct { - id uint16 - bits uint16 - questions uint16 - answers uint16 - authorities uint16 - additionals uint16 -} - -func (h *header) count(sec section) uint16 { - switch sec { - case sectionQuestions: - return h.questions - case sectionAnswers: - return h.answers - case sectionAuthorities: - return h.authorities - case sectionAdditionals: - return h.additionals - } - return 0 -} - -// pack appends the wire format of the header to msg. -func (h *header) pack(msg []byte) []byte { - msg = packUint16(msg, h.id) - msg = packUint16(msg, h.bits) - msg = packUint16(msg, h.questions) - msg = packUint16(msg, h.answers) - msg = packUint16(msg, h.authorities) - return packUint16(msg, h.additionals) -} - -func (h *header) unpack(msg []byte, off int) (int, error) { - newOff := off - var err error - if h.id, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"id", err} - } - if h.bits, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"bits", err} - } - if h.questions, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"questions", err} - } - if h.answers, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"answers", err} - } - if h.authorities, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"authorities", err} - } - if h.additionals, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"additionals", err} - } - return newOff, nil -} - -func (h *header) header() Header { - return Header{ - ID: h.id, - Response: (h.bits & headerBitQR) != 0, - OpCode: OpCode(h.bits>>11) & 0xF, - Authoritative: (h.bits & headerBitAA) != 0, - Truncated: (h.bits & headerBitTC) != 0, - RecursionDesired: (h.bits & headerBitRD) != 0, - RecursionAvailable: (h.bits & headerBitRA) != 0, - RCode: RCode(h.bits & 0xF), - } -} - -// A Resource is a DNS resource record. -type Resource struct { - Header ResourceHeader - Body ResourceBody -} - -func (r *Resource) GoString() string { - return "dnsmessage.Resource{" + - "Header: " + r.Header.GoString() + - ", Body: &" + r.Body.GoString() + - "}" -} - -// A ResourceBody is a DNS resource record minus the header. -type ResourceBody interface { - // pack packs a Resource except for its header. - pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) - - // realType returns the actual type of the Resource. This is used to - // fill in the header Type field. - realType() Type - - // GoString implements fmt.GoStringer.GoString. - GoString() string -} - -// pack appends the wire format of the Resource to msg. -func (r *Resource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - if r.Body == nil { - return msg, errNilResouceBody - } - oldMsg := msg - r.Header.Type = r.Body.realType() - msg, lenOff, err := r.Header.pack(msg, compression, compressionOff) - if err != nil { - return msg, &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - msg, err = r.Body.pack(msg, compression, compressionOff) - if err != nil { - return msg, &nestedError{"content", err} - } - if err := r.Header.fixLen(msg, lenOff, preLen); err != nil { - return oldMsg, err - } - return msg, nil -} - -// A Parser allows incrementally parsing a DNS message. -// -// When parsing is started, the Header is parsed. Next, each Question can be -// either parsed or skipped. Alternatively, all Questions can be skipped at -// once. When all Questions have been parsed, attempting to parse Questions -// will return (nil, nil) and attempting to skip Questions will return -// (true, nil). After all Questions have been either parsed or skipped, all -// Answers, Authorities and Additionals can be either parsed or skipped in the -// same way, and each type of Resource must be fully parsed or skipped before -// proceeding to the next type of Resource. -// -// Note that there is no requirement to fully skip or parse the message. -type Parser struct { - msg []byte - header header - - section section - off int - index int - resHeaderValid bool - resHeader ResourceHeader -} - -// Start parses the header and enables the parsing of Questions. -func (p *Parser) Start(msg []byte) (Header, error) { - if p.msg != nil { - *p = Parser{} - } - p.msg = msg - var err error - if p.off, err = p.header.unpack(msg, 0); err != nil { - return Header{}, &nestedError{"unpacking header", err} - } - p.section = sectionQuestions - return p.header.header(), nil -} - -func (p *Parser) checkAdvance(sec section) error { - if p.section < sec { - return ErrNotStarted - } - if p.section > sec { - return ErrSectionDone - } - p.resHeaderValid = false - if p.index == int(p.header.count(sec)) { - p.index = 0 - p.section++ - return ErrSectionDone - } - return nil -} - -func (p *Parser) resource(sec section) (Resource, error) { - var r Resource - var err error - r.Header, err = p.resourceHeader(sec) - if err != nil { - return r, err - } - p.resHeaderValid = false - r.Body, p.off, err = unpackResourceBody(p.msg, p.off, r.Header) - if err != nil { - return Resource{}, &nestedError{"unpacking " + sectionNames[sec], err} - } - p.index++ - return r, nil -} - -func (p *Parser) resourceHeader(sec section) (ResourceHeader, error) { - if p.resHeaderValid { - return p.resHeader, nil - } - if err := p.checkAdvance(sec); err != nil { - return ResourceHeader{}, err - } - var hdr ResourceHeader - off, err := hdr.unpack(p.msg, p.off) - if err != nil { - return ResourceHeader{}, err - } - p.resHeaderValid = true - p.resHeader = hdr - p.off = off - return hdr, nil -} - -func (p *Parser) skipResource(sec section) error { - if p.resHeaderValid { - newOff := p.off + int(p.resHeader.Length) - if newOff > len(p.msg) { - return errResourceLen - } - p.off = newOff - p.resHeaderValid = false - p.index++ - return nil - } - if err := p.checkAdvance(sec); err != nil { - return err - } - var err error - p.off, err = skipResource(p.msg, p.off) - if err != nil { - return &nestedError{"skipping: " + sectionNames[sec], err} - } - p.index++ - return nil -} - -// Question parses a single Question. -func (p *Parser) Question() (Question, error) { - if err := p.checkAdvance(sectionQuestions); err != nil { - return Question{}, err - } - var name Name - off, err := name.unpack(p.msg, p.off) - if err != nil { - return Question{}, &nestedError{"unpacking Question.Name", err} - } - typ, off, err := unpackType(p.msg, off) - if err != nil { - return Question{}, &nestedError{"unpacking Question.Type", err} - } - class, off, err := unpackClass(p.msg, off) - if err != nil { - return Question{}, &nestedError{"unpacking Question.Class", err} - } - p.off = off - p.index++ - return Question{name, typ, class}, nil -} - -// AllQuestions parses all Questions. -func (p *Parser) AllQuestions() ([]Question, error) { - // Multiple questions are valid according to the spec, - // but servers don't actually support them. There will - // be at most one question here. - // - // Do not pre-allocate based on info in p.header, since - // the data is untrusted. - qs := []Question{} - for { - q, err := p.Question() - if err == ErrSectionDone { - return qs, nil - } - if err != nil { - return nil, err - } - qs = append(qs, q) - } -} - -// SkipQuestion skips a single Question. -func (p *Parser) SkipQuestion() error { - if err := p.checkAdvance(sectionQuestions); err != nil { - return err - } - off, err := skipName(p.msg, p.off) - if err != nil { - return &nestedError{"skipping Question Name", err} - } - if off, err = skipType(p.msg, off); err != nil { - return &nestedError{"skipping Question Type", err} - } - if off, err = skipClass(p.msg, off); err != nil { - return &nestedError{"skipping Question Class", err} - } - p.off = off - p.index++ - return nil -} - -// SkipAllQuestions skips all Questions. -func (p *Parser) SkipAllQuestions() error { - for { - if err := p.SkipQuestion(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// AnswerHeader parses a single Answer ResourceHeader. -func (p *Parser) AnswerHeader() (ResourceHeader, error) { - return p.resourceHeader(sectionAnswers) -} - -// Answer parses a single Answer Resource. -func (p *Parser) Answer() (Resource, error) { - return p.resource(sectionAnswers) -} - -// AllAnswers parses all Answer Resources. -func (p *Parser) AllAnswers() ([]Resource, error) { - // The most common query is for A/AAAA, which usually returns - // a handful of IPs. - // - // Pre-allocate up to a certain limit, since p.header is - // untrusted data. - n := int(p.header.answers) - if n > 20 { - n = 20 - } - as := make([]Resource, 0, n) - for { - a, err := p.Answer() - if err == ErrSectionDone { - return as, nil - } - if err != nil { - return nil, err - } - as = append(as, a) - } -} - -// SkipAnswer skips a single Answer Resource. -func (p *Parser) SkipAnswer() error { - return p.skipResource(sectionAnswers) -} - -// SkipAllAnswers skips all Answer Resources. -func (p *Parser) SkipAllAnswers() error { - for { - if err := p.SkipAnswer(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// AuthorityHeader parses a single Authority ResourceHeader. -func (p *Parser) AuthorityHeader() (ResourceHeader, error) { - return p.resourceHeader(sectionAuthorities) -} - -// Authority parses a single Authority Resource. -func (p *Parser) Authority() (Resource, error) { - return p.resource(sectionAuthorities) -} - -// AllAuthorities parses all Authority Resources. -func (p *Parser) AllAuthorities() ([]Resource, error) { - // Authorities contains SOA in case of NXDOMAIN and friends, - // otherwise it is empty. - // - // Pre-allocate up to a certain limit, since p.header is - // untrusted data. - n := int(p.header.authorities) - if n > 10 { - n = 10 - } - as := make([]Resource, 0, n) - for { - a, err := p.Authority() - if err == ErrSectionDone { - return as, nil - } - if err != nil { - return nil, err - } - as = append(as, a) - } -} - -// SkipAuthority skips a single Authority Resource. -func (p *Parser) SkipAuthority() error { - return p.skipResource(sectionAuthorities) -} - -// SkipAllAuthorities skips all Authority Resources. -func (p *Parser) SkipAllAuthorities() error { - for { - if err := p.SkipAuthority(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// AdditionalHeader parses a single Additional ResourceHeader. -func (p *Parser) AdditionalHeader() (ResourceHeader, error) { - return p.resourceHeader(sectionAdditionals) -} - -// Additional parses a single Additional Resource. -func (p *Parser) Additional() (Resource, error) { - return p.resource(sectionAdditionals) -} - -// AllAdditionals parses all Additional Resources. -func (p *Parser) AllAdditionals() ([]Resource, error) { - // Additionals usually contain OPT, and sometimes A/AAAA - // glue records. - // - // Pre-allocate up to a certain limit, since p.header is - // untrusted data. - n := int(p.header.additionals) - if n > 10 { - n = 10 - } - as := make([]Resource, 0, n) - for { - a, err := p.Additional() - if err == ErrSectionDone { - return as, nil - } - if err != nil { - return nil, err - } - as = append(as, a) - } -} - -// SkipAdditional skips a single Additional Resource. -func (p *Parser) SkipAdditional() error { - return p.skipResource(sectionAdditionals) -} - -// SkipAllAdditionals skips all Additional Resources. -func (p *Parser) SkipAllAdditionals() error { - for { - if err := p.SkipAdditional(); err == ErrSectionDone { - return nil - } else if err != nil { - return err - } - } -} - -// CNAMEResource parses a single CNAMEResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) CNAMEResource() (CNAMEResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeCNAME { - return CNAMEResource{}, ErrNotStarted - } - r, err := unpackCNAMEResource(p.msg, p.off) - if err != nil { - return CNAMEResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// MXResource parses a single MXResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) MXResource() (MXResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeMX { - return MXResource{}, ErrNotStarted - } - r, err := unpackMXResource(p.msg, p.off) - if err != nil { - return MXResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// NSResource parses a single NSResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) NSResource() (NSResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeNS { - return NSResource{}, ErrNotStarted - } - r, err := unpackNSResource(p.msg, p.off) - if err != nil { - return NSResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// PTRResource parses a single PTRResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) PTRResource() (PTRResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypePTR { - return PTRResource{}, ErrNotStarted - } - r, err := unpackPTRResource(p.msg, p.off) - if err != nil { - return PTRResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// SOAResource parses a single SOAResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) SOAResource() (SOAResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeSOA { - return SOAResource{}, ErrNotStarted - } - r, err := unpackSOAResource(p.msg, p.off) - if err != nil { - return SOAResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// TXTResource parses a single TXTResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) TXTResource() (TXTResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeTXT { - return TXTResource{}, ErrNotStarted - } - r, err := unpackTXTResource(p.msg, p.off, p.resHeader.Length) - if err != nil { - return TXTResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// SRVResource parses a single SRVResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) SRVResource() (SRVResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeSRV { - return SRVResource{}, ErrNotStarted - } - r, err := unpackSRVResource(p.msg, p.off) - if err != nil { - return SRVResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// AResource parses a single AResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) AResource() (AResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeA { - return AResource{}, ErrNotStarted - } - r, err := unpackAResource(p.msg, p.off) - if err != nil { - return AResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// AAAAResource parses a single AAAAResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) AAAAResource() (AAAAResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeAAAA { - return AAAAResource{}, ErrNotStarted - } - r, err := unpackAAAAResource(p.msg, p.off) - if err != nil { - return AAAAResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// OPTResource parses a single OPTResource. -// -// One of the XXXHeader methods must have been called before calling this -// method. -func (p *Parser) OPTResource() (OPTResource, error) { - if !p.resHeaderValid || p.resHeader.Type != TypeOPT { - return OPTResource{}, ErrNotStarted - } - r, err := unpackOPTResource(p.msg, p.off, p.resHeader.Length) - if err != nil { - return OPTResource{}, err - } - p.off += int(p.resHeader.Length) - p.resHeaderValid = false - p.index++ - return r, nil -} - -// Unpack parses a full Message. -func (m *Message) Unpack(msg []byte) error { - var p Parser - var err error - if m.Header, err = p.Start(msg); err != nil { - return err - } - if m.Questions, err = p.AllQuestions(); err != nil { - return err - } - if m.Answers, err = p.AllAnswers(); err != nil { - return err - } - if m.Authorities, err = p.AllAuthorities(); err != nil { - return err - } - if m.Additionals, err = p.AllAdditionals(); err != nil { - return err - } - return nil -} - -// Pack packs a full Message. -func (m *Message) Pack() ([]byte, error) { - return m.AppendPack(make([]byte, 0, packStartingCap)) -} - -// AppendPack is like Pack but appends the full Message to b and returns the -// extended buffer. -func (m *Message) AppendPack(b []byte) ([]byte, error) { - // Validate the lengths. It is very unlikely that anyone will try to - // pack more than 65535 of any particular type, but it is possible and - // we should fail gracefully. - if len(m.Questions) > int(^uint16(0)) { - return nil, errTooManyQuestions - } - if len(m.Answers) > int(^uint16(0)) { - return nil, errTooManyAnswers - } - if len(m.Authorities) > int(^uint16(0)) { - return nil, errTooManyAuthorities - } - if len(m.Additionals) > int(^uint16(0)) { - return nil, errTooManyAdditionals - } - - var h header - h.id, h.bits = m.Header.pack() - - h.questions = uint16(len(m.Questions)) - h.answers = uint16(len(m.Answers)) - h.authorities = uint16(len(m.Authorities)) - h.additionals = uint16(len(m.Additionals)) - - compressionOff := len(b) - msg := h.pack(b) - - // RFC 1035 allows (but does not require) compression for packing. RFC - // 1035 requires unpacking implementations to support compression, so - // unconditionally enabling it is fine. - // - // DNS lookups are typically done over UDP, and RFC 1035 states that UDP - // DNS messages can be a maximum of 512 bytes long. Without compression, - // many DNS response messages are over this limit, so enabling - // compression will help ensure compliance. - compression := map[string]int{} - - for i := range m.Questions { - var err error - if msg, err = m.Questions[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Question", err} - } - } - for i := range m.Answers { - var err error - if msg, err = m.Answers[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Answer", err} - } - } - for i := range m.Authorities { - var err error - if msg, err = m.Authorities[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Authority", err} - } - } - for i := range m.Additionals { - var err error - if msg, err = m.Additionals[i].pack(msg, compression, compressionOff); err != nil { - return nil, &nestedError{"packing Additional", err} - } - } - - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (m *Message) GoString() string { - s := "dnsmessage.Message{Header: " + m.Header.GoString() + ", " + - "Questions: []dnsmessage.Question{" - if len(m.Questions) > 0 { - s += m.Questions[0].GoString() - for _, q := range m.Questions[1:] { - s += ", " + q.GoString() - } - } - s += "}, Answers: []dnsmessage.Resource{" - if len(m.Answers) > 0 { - s += m.Answers[0].GoString() - for _, a := range m.Answers[1:] { - s += ", " + a.GoString() - } - } - s += "}, Authorities: []dnsmessage.Resource{" - if len(m.Authorities) > 0 { - s += m.Authorities[0].GoString() - for _, a := range m.Authorities[1:] { - s += ", " + a.GoString() - } - } - s += "}, Additionals: []dnsmessage.Resource{" - if len(m.Additionals) > 0 { - s += m.Additionals[0].GoString() - for _, a := range m.Additionals[1:] { - s += ", " + a.GoString() - } - } - return s + "}}" -} - -// A Builder allows incrementally packing a DNS message. -// -// Example usage: -// buf := make([]byte, 2, 514) -// b := NewBuilder(buf, Header{...}) -// b.EnableCompression() -// // Optionally start a section and add things to that section. -// // Repeat adding sections as necessary. -// buf, err := b.Finish() -// // If err is nil, buf[2:] will contain the built bytes. -type Builder struct { - // msg is the storage for the message being built. - msg []byte - - // section keeps track of the current section being built. - section section - - // header keeps track of what should go in the header when Finish is - // called. - header header - - // start is the starting index of the bytes allocated in msg for header. - start int - - // compression is a mapping from name suffixes to their starting index - // in msg. - compression map[string]int -} - -// NewBuilder creates a new builder with compression disabled. -// -// Note: Most users will want to immediately enable compression with the -// EnableCompression method. See that method's comment for why you may or may -// not want to enable compression. -// -// The DNS message is appended to the provided initial buffer buf (which may be -// nil) as it is built. The final message is returned by the (*Builder).Finish -// method, which may return the same underlying array if there was sufficient -// capacity in the slice. -func NewBuilder(buf []byte, h Header) Builder { - if buf == nil { - buf = make([]byte, 0, packStartingCap) - } - b := Builder{msg: buf, start: len(buf)} - b.header.id, b.header.bits = h.pack() - var hb [headerLen]byte - b.msg = append(b.msg, hb[:]...) - b.section = sectionHeader - return b -} - -// EnableCompression enables compression in the Builder. -// -// Leaving compression disabled avoids compression related allocations, but can -// result in larger message sizes. Be careful with this mode as it can cause -// messages to exceed the UDP size limit. -// -// According to RFC 1035, section 4.1.4, the use of compression is optional, but -// all implementations must accept both compressed and uncompressed DNS -// messages. -// -// Compression should be enabled before any sections are added for best results. -func (b *Builder) EnableCompression() { - b.compression = map[string]int{} -} - -func (b *Builder) startCheck(s section) error { - if b.section <= sectionNotStarted { - return ErrNotStarted - } - if b.section > s { - return ErrSectionDone - } - return nil -} - -// StartQuestions prepares the builder for packing Questions. -func (b *Builder) StartQuestions() error { - if err := b.startCheck(sectionQuestions); err != nil { - return err - } - b.section = sectionQuestions - return nil -} - -// StartAnswers prepares the builder for packing Answers. -func (b *Builder) StartAnswers() error { - if err := b.startCheck(sectionAnswers); err != nil { - return err - } - b.section = sectionAnswers - return nil -} - -// StartAuthorities prepares the builder for packing Authorities. -func (b *Builder) StartAuthorities() error { - if err := b.startCheck(sectionAuthorities); err != nil { - return err - } - b.section = sectionAuthorities - return nil -} - -// StartAdditionals prepares the builder for packing Additionals. -func (b *Builder) StartAdditionals() error { - if err := b.startCheck(sectionAdditionals); err != nil { - return err - } - b.section = sectionAdditionals - return nil -} - -func (b *Builder) incrementSectionCount() error { - var count *uint16 - var err error - switch b.section { - case sectionQuestions: - count = &b.header.questions - err = errTooManyQuestions - case sectionAnswers: - count = &b.header.answers - err = errTooManyAnswers - case sectionAuthorities: - count = &b.header.authorities - err = errTooManyAuthorities - case sectionAdditionals: - count = &b.header.additionals - err = errTooManyAdditionals - } - if *count == ^uint16(0) { - return err - } - *count++ - return nil -} - -// Question adds a single Question. -func (b *Builder) Question(q Question) error { - if b.section < sectionQuestions { - return ErrNotStarted - } - if b.section > sectionQuestions { - return ErrSectionDone - } - msg, err := q.pack(b.msg, b.compression, b.start) - if err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -func (b *Builder) checkResourceSection() error { - if b.section < sectionAnswers { - return ErrNotStarted - } - if b.section > sectionAdditionals { - return ErrSectionDone - } - return nil -} - -// CNAMEResource adds a single CNAMEResource. -func (b *Builder) CNAMEResource(h ResourceHeader, r CNAMEResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"CNAMEResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// MXResource adds a single MXResource. -func (b *Builder) MXResource(h ResourceHeader, r MXResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"MXResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// NSResource adds a single NSResource. -func (b *Builder) NSResource(h ResourceHeader, r NSResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"NSResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// PTRResource adds a single PTRResource. -func (b *Builder) PTRResource(h ResourceHeader, r PTRResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"PTRResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// SOAResource adds a single SOAResource. -func (b *Builder) SOAResource(h ResourceHeader, r SOAResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"SOAResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// TXTResource adds a single TXTResource. -func (b *Builder) TXTResource(h ResourceHeader, r TXTResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"TXTResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// SRVResource adds a single SRVResource. -func (b *Builder) SRVResource(h ResourceHeader, r SRVResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"SRVResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// AResource adds a single AResource. -func (b *Builder) AResource(h ResourceHeader, r AResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"AResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// AAAAResource adds a single AAAAResource. -func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"AAAAResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// OPTResource adds a single OPTResource. -func (b *Builder) OPTResource(h ResourceHeader, r OPTResource) error { - if err := b.checkResourceSection(); err != nil { - return err - } - h.Type = r.realType() - msg, lenOff, err := h.pack(b.msg, b.compression, b.start) - if err != nil { - return &nestedError{"ResourceHeader", err} - } - preLen := len(msg) - if msg, err = r.pack(msg, b.compression, b.start); err != nil { - return &nestedError{"OPTResource body", err} - } - if err := h.fixLen(msg, lenOff, preLen); err != nil { - return err - } - if err := b.incrementSectionCount(); err != nil { - return err - } - b.msg = msg - return nil -} - -// Finish ends message building and generates a binary message. -func (b *Builder) Finish() ([]byte, error) { - if b.section < sectionHeader { - return nil, ErrNotStarted - } - b.section = sectionDone - // Space for the header was allocated in NewBuilder. - b.header.pack(b.msg[b.start:b.start]) - return b.msg, nil -} - -// A ResourceHeader is the header of a DNS resource record. There are -// many types of DNS resource records, but they all share the same header. -type ResourceHeader struct { - // Name is the domain name for which this resource record pertains. - Name Name - - // Type is the type of DNS resource record. - // - // This field will be set automatically during packing. - Type Type - - // Class is the class of network to which this DNS resource record - // pertains. - Class Class - - // TTL is the length of time (measured in seconds) which this resource - // record is valid for (time to live). All Resources in a set should - // have the same TTL (RFC 2181 Section 5.2). - TTL uint32 - - // Length is the length of data in the resource record after the header. - // - // This field will be set automatically during packing. - Length uint16 -} - -// GoString implements fmt.GoStringer.GoString. -func (h *ResourceHeader) GoString() string { - return "dnsmessage.ResourceHeader{" + - "Name: " + h.Name.GoString() + ", " + - "Type: " + h.Type.GoString() + ", " + - "Class: " + h.Class.GoString() + ", " + - "TTL: " + printUint32(h.TTL) + ", " + - "Length: " + printUint16(h.Length) + "}" -} - -// pack appends the wire format of the ResourceHeader to oldMsg. -// -// lenOff is the offset in msg where the Length field was packed. -func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]int, compressionOff int) (msg []byte, lenOff int, err error) { - msg = oldMsg - if msg, err = h.Name.pack(msg, compression, compressionOff); err != nil { - return oldMsg, 0, &nestedError{"Name", err} - } - msg = packType(msg, h.Type) - msg = packClass(msg, h.Class) - msg = packUint32(msg, h.TTL) - lenOff = len(msg) - msg = packUint16(msg, h.Length) - return msg, lenOff, nil -} - -func (h *ResourceHeader) unpack(msg []byte, off int) (int, error) { - newOff := off - var err error - if newOff, err = h.Name.unpack(msg, newOff); err != nil { - return off, &nestedError{"Name", err} - } - if h.Type, newOff, err = unpackType(msg, newOff); err != nil { - return off, &nestedError{"Type", err} - } - if h.Class, newOff, err = unpackClass(msg, newOff); err != nil { - return off, &nestedError{"Class", err} - } - if h.TTL, newOff, err = unpackUint32(msg, newOff); err != nil { - return off, &nestedError{"TTL", err} - } - if h.Length, newOff, err = unpackUint16(msg, newOff); err != nil { - return off, &nestedError{"Length", err} - } - return newOff, nil -} - -// fixLen updates a packed ResourceHeader to include the length of the -// ResourceBody. -// -// lenOff is the offset of the ResourceHeader.Length field in msg. -// -// preLen is the length that msg was before the ResourceBody was packed. -func (h *ResourceHeader) fixLen(msg []byte, lenOff int, preLen int) error { - conLen := len(msg) - preLen - if conLen > int(^uint16(0)) { - return errResTooLong - } - - // Fill in the length now that we know how long the content is. - packUint16(msg[lenOff:lenOff], uint16(conLen)) - h.Length = uint16(conLen) - - return nil -} - -// EDNS(0) wire costants. -const ( - edns0Version = 0 - - edns0DNSSECOK = 0x00008000 - ednsVersionMask = 0x00ff0000 - edns0DNSSECOKMask = 0x00ff8000 -) - -// SetEDNS0 configures h for EDNS(0). -// -// The provided extRCode must be an extedned RCode. -func (h *ResourceHeader) SetEDNS0(udpPayloadLen int, extRCode RCode, dnssecOK bool) error { - h.Name = Name{Data: [nameLen]byte{'.'}, Length: 1} // RFC 6891 section 6.1.2 - h.Type = TypeOPT - h.Class = Class(udpPayloadLen) - h.TTL = uint32(extRCode) >> 4 << 24 - if dnssecOK { - h.TTL |= edns0DNSSECOK - } - return nil -} - -// DNSSECAllowed reports whether the DNSSEC OK bit is set. -func (h *ResourceHeader) DNSSECAllowed() bool { - return h.TTL&edns0DNSSECOKMask == edns0DNSSECOK // RFC 6891 section 6.1.3 -} - -// ExtendedRCode returns an extended RCode. -// -// The provided rcode must be the RCode in DNS message header. -func (h *ResourceHeader) ExtendedRCode(rcode RCode) RCode { - if h.TTL&ednsVersionMask == edns0Version { // RFC 6891 section 6.1.3 - return RCode(h.TTL>>24<<4) | rcode - } - return rcode -} - -func skipResource(msg []byte, off int) (int, error) { - newOff, err := skipName(msg, off) - if err != nil { - return off, &nestedError{"Name", err} - } - if newOff, err = skipType(msg, newOff); err != nil { - return off, &nestedError{"Type", err} - } - if newOff, err = skipClass(msg, newOff); err != nil { - return off, &nestedError{"Class", err} - } - if newOff, err = skipUint32(msg, newOff); err != nil { - return off, &nestedError{"TTL", err} - } - length, newOff, err := unpackUint16(msg, newOff) - if err != nil { - return off, &nestedError{"Length", err} - } - if newOff += int(length); newOff > len(msg) { - return off, errResourceLen - } - return newOff, nil -} - -// packUint16 appends the wire format of field to msg. -func packUint16(msg []byte, field uint16) []byte { - return append(msg, byte(field>>8), byte(field)) -} - -func unpackUint16(msg []byte, off int) (uint16, int, error) { - if off+uint16Len > len(msg) { - return 0, off, errBaseLen - } - return uint16(msg[off])<<8 | uint16(msg[off+1]), off + uint16Len, nil -} - -func skipUint16(msg []byte, off int) (int, error) { - if off+uint16Len > len(msg) { - return off, errBaseLen - } - return off + uint16Len, nil -} - -// packType appends the wire format of field to msg. -func packType(msg []byte, field Type) []byte { - return packUint16(msg, uint16(field)) -} - -func unpackType(msg []byte, off int) (Type, int, error) { - t, o, err := unpackUint16(msg, off) - return Type(t), o, err -} - -func skipType(msg []byte, off int) (int, error) { - return skipUint16(msg, off) -} - -// packClass appends the wire format of field to msg. -func packClass(msg []byte, field Class) []byte { - return packUint16(msg, uint16(field)) -} - -func unpackClass(msg []byte, off int) (Class, int, error) { - c, o, err := unpackUint16(msg, off) - return Class(c), o, err -} - -func skipClass(msg []byte, off int) (int, error) { - return skipUint16(msg, off) -} - -// packUint32 appends the wire format of field to msg. -func packUint32(msg []byte, field uint32) []byte { - return append( - msg, - byte(field>>24), - byte(field>>16), - byte(field>>8), - byte(field), - ) -} - -func unpackUint32(msg []byte, off int) (uint32, int, error) { - if off+uint32Len > len(msg) { - return 0, off, errBaseLen - } - v := uint32(msg[off])<<24 | uint32(msg[off+1])<<16 | uint32(msg[off+2])<<8 | uint32(msg[off+3]) - return v, off + uint32Len, nil -} - -func skipUint32(msg []byte, off int) (int, error) { - if off+uint32Len > len(msg) { - return off, errBaseLen - } - return off + uint32Len, nil -} - -// packText appends the wire format of field to msg. -func packText(msg []byte, field string) ([]byte, error) { - l := len(field) - if l > 255 { - return nil, errStringTooLong - } - msg = append(msg, byte(l)) - msg = append(msg, field...) - - return msg, nil -} - -func unpackText(msg []byte, off int) (string, int, error) { - if off >= len(msg) { - return "", off, errBaseLen - } - beginOff := off + 1 - endOff := beginOff + int(msg[off]) - if endOff > len(msg) { - return "", off, errCalcLen - } - return string(msg[beginOff:endOff]), endOff, nil -} - -func skipText(msg []byte, off int) (int, error) { - if off >= len(msg) { - return off, errBaseLen - } - endOff := off + 1 + int(msg[off]) - if endOff > len(msg) { - return off, errCalcLen - } - return endOff, nil -} - -// packBytes appends the wire format of field to msg. -func packBytes(msg []byte, field []byte) []byte { - return append(msg, field...) -} - -func unpackBytes(msg []byte, off int, field []byte) (int, error) { - newOff := off + len(field) - if newOff > len(msg) { - return off, errBaseLen - } - copy(field, msg[off:newOff]) - return newOff, nil -} - -func skipBytes(msg []byte, off int, field []byte) (int, error) { - newOff := off + len(field) - if newOff > len(msg) { - return off, errBaseLen - } - return newOff, nil -} - -const nameLen = 255 - -// A Name is a non-encoded domain name. It is used instead of strings to avoid -// allocations. -type Name struct { - Data [nameLen]byte - Length uint8 -} - -// NewName creates a new Name from a string. -func NewName(name string) (Name, error) { - if len([]byte(name)) > nameLen { - return Name{}, errCalcLen - } - n := Name{Length: uint8(len(name))} - copy(n.Data[:], []byte(name)) - return n, nil -} - -// MustNewName creates a new Name from a string and panics on error. -func MustNewName(name string) Name { - n, err := NewName(name) - if err != nil { - panic("creating name: " + err.Error()) - } - return n -} - -// String implements fmt.Stringer.String. -func (n Name) String() string { - return string(n.Data[:n.Length]) -} - -// GoString implements fmt.GoStringer.GoString. -func (n *Name) GoString() string { - return `dnsmessage.MustNewName("` + printString(n.Data[:n.Length]) + `")` -} - -// pack appends the wire format of the Name to msg. -// -// Domain names are a sequence of counted strings split at the dots. They end -// with a zero-length string. Compression can be used to reuse domain suffixes. -// -// The compression map will be updated with new domain suffixes. If compression -// is nil, compression will not be used. -func (n *Name) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - - // Add a trailing dot to canonicalize name. - if n.Length == 0 || n.Data[n.Length-1] != '.' { - return oldMsg, errNonCanonicalName - } - - // Allow root domain. - if n.Data[0] == '.' && n.Length == 1 { - return append(msg, 0), nil - } - - // Emit sequence of counted strings, chopping at dots. - for i, begin := 0, 0; i < int(n.Length); i++ { - // Check for the end of the segment. - if n.Data[i] == '.' { - // The two most significant bits have special meaning. - // It isn't allowed for segments to be long enough to - // need them. - if i-begin >= 1<<6 { - return oldMsg, errSegTooLong - } - - // Segments must have a non-zero length. - if i-begin == 0 { - return oldMsg, errZeroSegLen - } - - msg = append(msg, byte(i-begin)) - - for j := begin; j < i; j++ { - msg = append(msg, n.Data[j]) - } - - begin = i + 1 - continue - } - - // We can only compress domain suffixes starting with a new - // segment. A pointer is two bytes with the two most significant - // bits set to 1 to indicate that it is a pointer. - if (i == 0 || n.Data[i-1] == '.') && compression != nil { - if ptr, ok := compression[string(n.Data[i:])]; ok { - // Hit. Emit a pointer instead of the rest of - // the domain. - return append(msg, byte(ptr>>8|0xC0), byte(ptr)), nil - } - - // Miss. Add the suffix to the compression table if the - // offset can be stored in the available 14 bytes. - if len(msg) <= int(^uint16(0)>>2) { - compression[string(n.Data[i:])] = len(msg) - compressionOff - } - } - } - return append(msg, 0), nil -} - -// unpack unpacks a domain name. -func (n *Name) unpack(msg []byte, off int) (int, error) { - return n.unpackCompressed(msg, off, true /* allowCompression */) -} - -func (n *Name) unpackCompressed(msg []byte, off int, allowCompression bool) (int, error) { - // currOff is the current working offset. - currOff := off - - // newOff is the offset where the next record will start. Pointers lead - // to data that belongs to other names and thus doesn't count towards to - // the usage of this name. - newOff := off - - // ptr is the number of pointers followed. - var ptr int - - // Name is a slice representation of the name data. - name := n.Data[:0] - -Loop: - for { - if currOff >= len(msg) { - return off, errBaseLen - } - c := int(msg[currOff]) - currOff++ - switch c & 0xC0 { - case 0x00: // String segment - if c == 0x00 { - // A zero length signals the end of the name. - break Loop - } - endOff := currOff + c - if endOff > len(msg) { - return off, errCalcLen - } - name = append(name, msg[currOff:endOff]...) - name = append(name, '.') - currOff = endOff - case 0xC0: // Pointer - if !allowCompression { - return off, errCompressedSRV - } - if currOff >= len(msg) { - return off, errInvalidPtr - } - c1 := msg[currOff] - currOff++ - if ptr == 0 { - newOff = currOff - } - // Don't follow too many pointers, maybe there's a loop. - if ptr++; ptr > 10 { - return off, errTooManyPtr - } - currOff = (c^0xC0)<<8 | int(c1) - default: - // Prefixes 0x80 and 0x40 are reserved. - return off, errReserved - } - } - if len(name) == 0 { - name = append(name, '.') - } - if len(name) > len(n.Data) { - return off, errCalcLen - } - n.Length = uint8(len(name)) - if ptr == 0 { - newOff = currOff - } - return newOff, nil -} - -func skipName(msg []byte, off int) (int, error) { - // newOff is the offset where the next record will start. Pointers lead - // to data that belongs to other names and thus doesn't count towards to - // the usage of this name. - newOff := off - -Loop: - for { - if newOff >= len(msg) { - return off, errBaseLen - } - c := int(msg[newOff]) - newOff++ - switch c & 0xC0 { - case 0x00: - if c == 0x00 { - // A zero length signals the end of the name. - break Loop - } - // literal string - newOff += c - if newOff > len(msg) { - return off, errCalcLen - } - case 0xC0: - // Pointer to somewhere else in msg. - - // Pointers are two bytes. - newOff++ - - // Don't follow the pointer as the data here has ended. - break Loop - default: - // Prefixes 0x80 and 0x40 are reserved. - return off, errReserved - } - } - - return newOff, nil -} - -// A Question is a DNS query. -type Question struct { - Name Name - Type Type - Class Class -} - -// pack appends the wire format of the Question to msg. -func (q *Question) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - msg, err := q.Name.pack(msg, compression, compressionOff) - if err != nil { - return msg, &nestedError{"Name", err} - } - msg = packType(msg, q.Type) - return packClass(msg, q.Class), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (q *Question) GoString() string { - return "dnsmessage.Question{" + - "Name: " + q.Name.GoString() + ", " + - "Type: " + q.Type.GoString() + ", " + - "Class: " + q.Class.GoString() + "}" -} - -func unpackResourceBody(msg []byte, off int, hdr ResourceHeader) (ResourceBody, int, error) { - var ( - r ResourceBody - err error - name string - ) - switch hdr.Type { - case TypeA: - var rb AResource - rb, err = unpackAResource(msg, off) - r = &rb - name = "A" - case TypeNS: - var rb NSResource - rb, err = unpackNSResource(msg, off) - r = &rb - name = "NS" - case TypeCNAME: - var rb CNAMEResource - rb, err = unpackCNAMEResource(msg, off) - r = &rb - name = "CNAME" - case TypeSOA: - var rb SOAResource - rb, err = unpackSOAResource(msg, off) - r = &rb - name = "SOA" - case TypePTR: - var rb PTRResource - rb, err = unpackPTRResource(msg, off) - r = &rb - name = "PTR" - case TypeMX: - var rb MXResource - rb, err = unpackMXResource(msg, off) - r = &rb - name = "MX" - case TypeTXT: - var rb TXTResource - rb, err = unpackTXTResource(msg, off, hdr.Length) - r = &rb - name = "TXT" - case TypeAAAA: - var rb AAAAResource - rb, err = unpackAAAAResource(msg, off) - r = &rb - name = "AAAA" - case TypeSRV: - var rb SRVResource - rb, err = unpackSRVResource(msg, off) - r = &rb - name = "SRV" - case TypeOPT: - var rb OPTResource - rb, err = unpackOPTResource(msg, off, hdr.Length) - r = &rb - name = "OPT" - } - if err != nil { - return nil, off, &nestedError{name + " record", err} - } - if r == nil { - return nil, off, errors.New("invalid resource type: " + string(hdr.Type+'0')) - } - return r, off + int(hdr.Length), nil -} - -// A CNAMEResource is a CNAME Resource record. -type CNAMEResource struct { - CNAME Name -} - -func (r *CNAMEResource) realType() Type { - return TypeCNAME -} - -// pack appends the wire format of the CNAMEResource to msg. -func (r *CNAMEResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return r.CNAME.pack(msg, compression, compressionOff) -} - -// GoString implements fmt.GoStringer.GoString. -func (r *CNAMEResource) GoString() string { - return "dnsmessage.CNAMEResource{CNAME: " + r.CNAME.GoString() + "}" -} - -func unpackCNAMEResource(msg []byte, off int) (CNAMEResource, error) { - var cname Name - if _, err := cname.unpack(msg, off); err != nil { - return CNAMEResource{}, err - } - return CNAMEResource{cname}, nil -} - -// An MXResource is an MX Resource record. -type MXResource struct { - Pref uint16 - MX Name -} - -func (r *MXResource) realType() Type { - return TypeMX -} - -// pack appends the wire format of the MXResource to msg. -func (r *MXResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - msg = packUint16(msg, r.Pref) - msg, err := r.MX.pack(msg, compression, compressionOff) - if err != nil { - return oldMsg, &nestedError{"MXResource.MX", err} - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *MXResource) GoString() string { - return "dnsmessage.MXResource{" + - "Pref: " + printUint16(r.Pref) + ", " + - "MX: " + r.MX.GoString() + "}" -} - -func unpackMXResource(msg []byte, off int) (MXResource, error) { - pref, off, err := unpackUint16(msg, off) - if err != nil { - return MXResource{}, &nestedError{"Pref", err} - } - var mx Name - if _, err := mx.unpack(msg, off); err != nil { - return MXResource{}, &nestedError{"MX", err} - } - return MXResource{pref, mx}, nil -} - -// An NSResource is an NS Resource record. -type NSResource struct { - NS Name -} - -func (r *NSResource) realType() Type { - return TypeNS -} - -// pack appends the wire format of the NSResource to msg. -func (r *NSResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return r.NS.pack(msg, compression, compressionOff) -} - -// GoString implements fmt.GoStringer.GoString. -func (r *NSResource) GoString() string { - return "dnsmessage.NSResource{NS: " + r.NS.GoString() + "}" -} - -func unpackNSResource(msg []byte, off int) (NSResource, error) { - var ns Name - if _, err := ns.unpack(msg, off); err != nil { - return NSResource{}, err - } - return NSResource{ns}, nil -} - -// A PTRResource is a PTR Resource record. -type PTRResource struct { - PTR Name -} - -func (r *PTRResource) realType() Type { - return TypePTR -} - -// pack appends the wire format of the PTRResource to msg. -func (r *PTRResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return r.PTR.pack(msg, compression, compressionOff) -} - -// GoString implements fmt.GoStringer.GoString. -func (r *PTRResource) GoString() string { - return "dnsmessage.PTRResource{PTR: " + r.PTR.GoString() + "}" -} - -func unpackPTRResource(msg []byte, off int) (PTRResource, error) { - var ptr Name - if _, err := ptr.unpack(msg, off); err != nil { - return PTRResource{}, err - } - return PTRResource{ptr}, nil -} - -// An SOAResource is an SOA Resource record. -type SOAResource struct { - NS Name - MBox Name - Serial uint32 - Refresh uint32 - Retry uint32 - Expire uint32 - - // MinTTL the is the default TTL of Resources records which did not - // contain a TTL value and the TTL of negative responses. (RFC 2308 - // Section 4) - MinTTL uint32 -} - -func (r *SOAResource) realType() Type { - return TypeSOA -} - -// pack appends the wire format of the SOAResource to msg. -func (r *SOAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - msg, err := r.NS.pack(msg, compression, compressionOff) - if err != nil { - return oldMsg, &nestedError{"SOAResource.NS", err} - } - msg, err = r.MBox.pack(msg, compression, compressionOff) - if err != nil { - return oldMsg, &nestedError{"SOAResource.MBox", err} - } - msg = packUint32(msg, r.Serial) - msg = packUint32(msg, r.Refresh) - msg = packUint32(msg, r.Retry) - msg = packUint32(msg, r.Expire) - return packUint32(msg, r.MinTTL), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *SOAResource) GoString() string { - return "dnsmessage.SOAResource{" + - "NS: " + r.NS.GoString() + ", " + - "MBox: " + r.MBox.GoString() + ", " + - "Serial: " + printUint32(r.Serial) + ", " + - "Refresh: " + printUint32(r.Refresh) + ", " + - "Retry: " + printUint32(r.Retry) + ", " + - "Expire: " + printUint32(r.Expire) + ", " + - "MinTTL: " + printUint32(r.MinTTL) + "}" -} - -func unpackSOAResource(msg []byte, off int) (SOAResource, error) { - var ns Name - off, err := ns.unpack(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"NS", err} - } - var mbox Name - if off, err = mbox.unpack(msg, off); err != nil { - return SOAResource{}, &nestedError{"MBox", err} - } - serial, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Serial", err} - } - refresh, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Refresh", err} - } - retry, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Retry", err} - } - expire, off, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"Expire", err} - } - minTTL, _, err := unpackUint32(msg, off) - if err != nil { - return SOAResource{}, &nestedError{"MinTTL", err} - } - return SOAResource{ns, mbox, serial, refresh, retry, expire, minTTL}, nil -} - -// A TXTResource is a TXT Resource record. -type TXTResource struct { - TXT []string -} - -func (r *TXTResource) realType() Type { - return TypeTXT -} - -// pack appends the wire format of the TXTResource to msg. -func (r *TXTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - for _, s := range r.TXT { - var err error - msg, err = packText(msg, s) - if err != nil { - return oldMsg, err - } - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *TXTResource) GoString() string { - s := "dnsmessage.TXTResource{TXT: []string{" - if len(r.TXT) == 0 { - return s + "}}" - } - s += `"` + printString([]byte(r.TXT[0])) - for _, t := range r.TXT[1:] { - s += `", "` + printString([]byte(t)) - } - return s + `"}}` -} - -func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) { - txts := make([]string, 0, 1) - for n := uint16(0); n < length; { - var t string - var err error - if t, off, err = unpackText(msg, off); err != nil { - return TXTResource{}, &nestedError{"text", err} - } - // Check if we got too many bytes. - if length-n < uint16(len(t))+1 { - return TXTResource{}, errCalcLen - } - n += uint16(len(t)) + 1 - txts = append(txts, t) - } - return TXTResource{txts}, nil -} - -// An SRVResource is an SRV Resource record. -type SRVResource struct { - Priority uint16 - Weight uint16 - Port uint16 - Target Name // Not compressed as per RFC 2782. -} - -func (r *SRVResource) realType() Type { - return TypeSRV -} - -// pack appends the wire format of the SRVResource to msg. -func (r *SRVResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - oldMsg := msg - msg = packUint16(msg, r.Priority) - msg = packUint16(msg, r.Weight) - msg = packUint16(msg, r.Port) - msg, err := r.Target.pack(msg, nil, compressionOff) - if err != nil { - return oldMsg, &nestedError{"SRVResource.Target", err} - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *SRVResource) GoString() string { - return "dnsmessage.SRVResource{" + - "Priority: " + printUint16(r.Priority) + ", " + - "Weight: " + printUint16(r.Weight) + ", " + - "Port: " + printUint16(r.Port) + ", " + - "Target: " + r.Target.GoString() + "}" -} - -func unpackSRVResource(msg []byte, off int) (SRVResource, error) { - priority, off, err := unpackUint16(msg, off) - if err != nil { - return SRVResource{}, &nestedError{"Priority", err} - } - weight, off, err := unpackUint16(msg, off) - if err != nil { - return SRVResource{}, &nestedError{"Weight", err} - } - port, off, err := unpackUint16(msg, off) - if err != nil { - return SRVResource{}, &nestedError{"Port", err} - } - var target Name - if _, err := target.unpackCompressed(msg, off, false /* allowCompression */); err != nil { - return SRVResource{}, &nestedError{"Target", err} - } - return SRVResource{priority, weight, port, target}, nil -} - -// An AResource is an A Resource record. -type AResource struct { - A [4]byte -} - -func (r *AResource) realType() Type { - return TypeA -} - -// pack appends the wire format of the AResource to msg. -func (r *AResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return packBytes(msg, r.A[:]), nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *AResource) GoString() string { - return "dnsmessage.AResource{" + - "A: [4]byte{" + printByteSlice(r.A[:]) + "}}" -} - -func unpackAResource(msg []byte, off int) (AResource, error) { - var a [4]byte - if _, err := unpackBytes(msg, off, a[:]); err != nil { - return AResource{}, err - } - return AResource{a}, nil -} - -// An AAAAResource is an AAAA Resource record. -type AAAAResource struct { - AAAA [16]byte -} - -func (r *AAAAResource) realType() Type { - return TypeAAAA -} - -// GoString implements fmt.GoStringer.GoString. -func (r *AAAAResource) GoString() string { - return "dnsmessage.AAAAResource{" + - "AAAA: [16]byte{" + printByteSlice(r.AAAA[:]) + "}}" -} - -// pack appends the wire format of the AAAAResource to msg. -func (r *AAAAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - return packBytes(msg, r.AAAA[:]), nil -} - -func unpackAAAAResource(msg []byte, off int) (AAAAResource, error) { - var aaaa [16]byte - if _, err := unpackBytes(msg, off, aaaa[:]); err != nil { - return AAAAResource{}, err - } - return AAAAResource{aaaa}, nil -} - -// An OPTResource is an OPT pseudo Resource record. -// -// The pseudo resource record is part of the extension mechanisms for DNS -// as defined in RFC 6891. -type OPTResource struct { - Options []Option -} - -// An Option represents a DNS message option within OPTResource. -// -// The message option is part of the extension mechanisms for DNS as -// defined in RFC 6891. -type Option struct { - Code uint16 // option code - Data []byte -} - -// GoString implements fmt.GoStringer.GoString. -func (o *Option) GoString() string { - return "dnsmessage.Option{" + - "Code: " + printUint16(o.Code) + ", " + - "Data: []byte{" + printByteSlice(o.Data) + "}}" -} - -func (r *OPTResource) realType() Type { - return TypeOPT -} - -func (r *OPTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { - for _, opt := range r.Options { - msg = packUint16(msg, opt.Code) - l := uint16(len(opt.Data)) - msg = packUint16(msg, l) - msg = packBytes(msg, opt.Data) - } - return msg, nil -} - -// GoString implements fmt.GoStringer.GoString. -func (r *OPTResource) GoString() string { - s := "dnsmessage.OPTResource{Options: []dnsmessage.Option{" - if len(r.Options) == 0 { - return s + "}}" - } - s += r.Options[0].GoString() - for _, o := range r.Options[1:] { - s += ", " + o.GoString() - } - return s + "}}" -} - -func unpackOPTResource(msg []byte, off int, length uint16) (OPTResource, error) { - var opts []Option - for oldOff := off; off < oldOff+int(length); { - var err error - var o Option - o.Code, off, err = unpackUint16(msg, off) - if err != nil { - return OPTResource{}, &nestedError{"Code", err} - } - var l uint16 - l, off, err = unpackUint16(msg, off) - if err != nil { - return OPTResource{}, &nestedError{"Data", err} - } - o.Data = make([]byte, l) - if copy(o.Data, msg[off:]) != int(l) { - return OPTResource{}, &nestedError{"Data", errCalcLen} - } - off += int(l) - opts = append(opts, o) - } - return OPTResource{opts}, nil -} diff --git a/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message_test.go b/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message_test.go deleted file mode 100644 index 25ba8f0..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/dns/dnsmessage/message_test.go +++ /dev/null @@ -1,1451 +0,0 @@ -// Copyright 2009 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 dnsmessage - -import ( - "bytes" - "fmt" - "reflect" - "strings" - "testing" -) - -func TestPrintPaddedUint8(t *testing.T) { - tests := []struct { - num uint8 - want string - }{ - {0, "000"}, - {1, "001"}, - {9, "009"}, - {10, "010"}, - {99, "099"}, - {100, "100"}, - {124, "124"}, - {104, "104"}, - {120, "120"}, - {255, "255"}, - } - - for _, test := range tests { - if got := printPaddedUint8(test.num); got != test.want { - t.Errorf("got printPaddedUint8(%d) = %s, want = %s", test.num, got, test.want) - } - } -} - -func TestPrintUint8Bytes(t *testing.T) { - tests := []uint8{ - 0, - 1, - 9, - 10, - 99, - 100, - 124, - 104, - 120, - 255, - } - - for _, test := range tests { - if got, want := string(printUint8Bytes(nil, test)), fmt.Sprint(test); got != want { - t.Errorf("got printUint8Bytes(%d) = %s, want = %s", test, got, want) - } - } -} - -func TestPrintUint16(t *testing.T) { - tests := []uint16{ - 65535, - 0, - 1, - 10, - 100, - 1000, - 10000, - 324, - 304, - 320, - } - - for _, test := range tests { - if got, want := printUint16(test), fmt.Sprint(test); got != want { - t.Errorf("got printUint16(%d) = %s, want = %s", test, got, want) - } - } -} - -func TestPrintUint32(t *testing.T) { - tests := []uint32{ - 4294967295, - 65535, - 0, - 1, - 10, - 100, - 1000, - 10000, - 100000, - 1000000, - 10000000, - 100000000, - 1000000000, - 324, - 304, - 320, - } - - for _, test := range tests { - if got, want := printUint32(test), fmt.Sprint(test); got != want { - t.Errorf("got printUint32(%d) = %s, want = %s", test, got, want) - } - } -} - -func mustEDNS0ResourceHeader(l int, extrc RCode, do bool) ResourceHeader { - h := ResourceHeader{Class: ClassINET} - if err := h.SetEDNS0(l, extrc, do); err != nil { - panic(err) - } - return h -} - -func (m *Message) String() string { - s := fmt.Sprintf("Message: %#v\n", &m.Header) - if len(m.Questions) > 0 { - s += "-- Questions\n" - for _, q := range m.Questions { - s += fmt.Sprintf("%#v\n", q) - } - } - if len(m.Answers) > 0 { - s += "-- Answers\n" - for _, a := range m.Answers { - s += fmt.Sprintf("%#v\n", a) - } - } - if len(m.Authorities) > 0 { - s += "-- Authorities\n" - for _, ns := range m.Authorities { - s += fmt.Sprintf("%#v\n", ns) - } - } - if len(m.Additionals) > 0 { - s += "-- Additionals\n" - for _, e := range m.Additionals { - s += fmt.Sprintf("%#v\n", e) - } - } - return s -} - -func TestNameString(t *testing.T) { - want := "foo" - name := MustNewName(want) - if got := fmt.Sprint(name); got != want { - t.Errorf("got fmt.Sprint(%#v) = %s, want = %s", name, got, want) - } -} - -func TestQuestionPackUnpack(t *testing.T) { - want := Question{ - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - } - buf, err := want.pack(make([]byte, 1, 50), map[string]int{}, 1) - if err != nil { - t.Fatal("Question.pack() =", err) - } - var p Parser - p.msg = buf - p.header.questions = 1 - p.section = sectionQuestions - p.off = 1 - got, err := p.Question() - if err != nil { - t.Fatalf("Parser{%q}.Question() = %v", string(buf[1:]), err) - } - if p.off != len(buf) { - t.Errorf("unpacked different amount than packed: got = %d, want = %d", p.off, len(buf)) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("got from Parser.Question() = %+v, want = %+v", got, want) - } -} - -func TestName(t *testing.T) { - tests := []string{ - "", - ".", - "google..com", - "google.com", - "google..com.", - "google.com.", - ".google.com.", - "www..google.com.", - "www.google.com.", - } - - for _, test := range tests { - n, err := NewName(test) - if err != nil { - t.Errorf("NewName(%q) = %v", test, err) - continue - } - if ns := n.String(); ns != test { - t.Errorf("got %#v.String() = %q, want = %q", n, ns, test) - continue - } - } -} - -func TestNamePackUnpack(t *testing.T) { - tests := []struct { - in string - want string - err error - }{ - {"", "", errNonCanonicalName}, - {".", ".", nil}, - {"google..com", "", errNonCanonicalName}, - {"google.com", "", errNonCanonicalName}, - {"google..com.", "", errZeroSegLen}, - {"google.com.", "google.com.", nil}, - {".google.com.", "", errZeroSegLen}, - {"www..google.com.", "", errZeroSegLen}, - {"www.google.com.", "www.google.com.", nil}, - } - - for _, test := range tests { - in := MustNewName(test.in) - want := MustNewName(test.want) - buf, err := in.pack(make([]byte, 0, 30), map[string]int{}, 0) - if err != test.err { - t.Errorf("got %q.pack() = %v, want = %v", test.in, err, test.err) - continue - } - if test.err != nil { - continue - } - var got Name - n, err := got.unpack(buf, 0) - if err != nil { - t.Errorf("%q.unpack() = %v", test.in, err) - continue - } - if n != len(buf) { - t.Errorf( - "unpacked different amount than packed for %q: got = %d, want = %d", - test.in, - n, - len(buf), - ) - } - if got != want { - t.Errorf("unpacking packing of %q: got = %#v, want = %#v", test.in, got, want) - } - } -} - -func TestIncompressibleName(t *testing.T) { - name := MustNewName("example.com.") - compression := map[string]int{} - buf, err := name.pack(make([]byte, 0, 100), compression, 0) - if err != nil { - t.Fatal("first Name.pack() =", err) - } - buf, err = name.pack(buf, compression, 0) - if err != nil { - t.Fatal("second Name.pack() =", err) - } - var n1 Name - off, err := n1.unpackCompressed(buf, 0, false /* allowCompression */) - if err != nil { - t.Fatal("unpacking incompressible name without pointers failed:", err) - } - var n2 Name - if _, err := n2.unpackCompressed(buf, off, false /* allowCompression */); err != errCompressedSRV { - t.Errorf("unpacking compressed incompressible name with pointers: got %v, want = %v", err, errCompressedSRV) - } -} - -func checkErrorPrefix(err error, prefix string) bool { - e, ok := err.(*nestedError) - return ok && e.s == prefix -} - -func TestHeaderUnpackError(t *testing.T) { - wants := []string{ - "id", - "bits", - "questions", - "answers", - "authorities", - "additionals", - } - var buf []byte - var h header - for _, want := range wants { - n, err := h.unpack(buf, 0) - if n != 0 || !checkErrorPrefix(err, want) { - t.Errorf("got header.unpack([%d]byte, 0) = %d, %v, want = 0, %s", len(buf), n, err, want) - } - buf = append(buf, 0, 0) - } -} - -func TestParserStart(t *testing.T) { - const want = "unpacking header" - var p Parser - for i := 0; i <= 1; i++ { - _, err := p.Start([]byte{}) - if !checkErrorPrefix(err, want) { - t.Errorf("got Parser.Start(nil) = _, %v, want = _, %s", err, want) - } - } -} - -func TestResourceNotStarted(t *testing.T) { - tests := []struct { - name string - fn func(*Parser) error - }{ - {"CNAMEResource", func(p *Parser) error { _, err := p.CNAMEResource(); return err }}, - {"MXResource", func(p *Parser) error { _, err := p.MXResource(); return err }}, - {"NSResource", func(p *Parser) error { _, err := p.NSResource(); return err }}, - {"PTRResource", func(p *Parser) error { _, err := p.PTRResource(); return err }}, - {"SOAResource", func(p *Parser) error { _, err := p.SOAResource(); return err }}, - {"TXTResource", func(p *Parser) error { _, err := p.TXTResource(); return err }}, - {"SRVResource", func(p *Parser) error { _, err := p.SRVResource(); return err }}, - {"AResource", func(p *Parser) error { _, err := p.AResource(); return err }}, - {"AAAAResource", func(p *Parser) error { _, err := p.AAAAResource(); return err }}, - } - - for _, test := range tests { - if err := test.fn(&Parser{}); err != ErrNotStarted { - t.Errorf("got Parser.%s() = _ , %v, want = _, %v", test.name, err, ErrNotStarted) - } - } -} - -func TestDNSPackUnpack(t *testing.T) { - wants := []Message{ - { - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Answers: []Resource{}, - Authorities: []Resource{}, - Additionals: []Resource{}, - }, - largeTestMsg(), - } - for i, want := range wants { - b, err := want.Pack() - if err != nil { - t.Fatalf("%d: Message.Pack() = %v", i, err) - } - var got Message - err = got.Unpack(b) - if err != nil { - t.Fatalf("%d: Message.Unapck() = %v", i, err) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("%d: Message.Pack/Unpack() roundtrip: got = %+v, want = %+v", i, &got, &want) - } - } -} - -func TestDNSAppendPackUnpack(t *testing.T) { - wants := []Message{ - { - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Answers: []Resource{}, - Authorities: []Resource{}, - Additionals: []Resource{}, - }, - largeTestMsg(), - } - for i, want := range wants { - b := make([]byte, 2, 514) - b, err := want.AppendPack(b) - if err != nil { - t.Fatalf("%d: Message.AppendPack() = %v", i, err) - } - b = b[2:] - var got Message - err = got.Unpack(b) - if err != nil { - t.Fatalf("%d: Message.Unapck() = %v", i, err) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("%d: Message.AppendPack/Unpack() roundtrip: got = %+v, want = %+v", i, &got, &want) - } - } -} - -func TestSkipAll(t *testing.T) { - msg := largeTestMsg() - buf, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - var p Parser - if _, err := p.Start(buf); err != nil { - t.Fatal("Parser.Start(non-nil) =", err) - } - - tests := []struct { - name string - f func() error - }{ - {"SkipAllQuestions", p.SkipAllQuestions}, - {"SkipAllAnswers", p.SkipAllAnswers}, - {"SkipAllAuthorities", p.SkipAllAuthorities}, - {"SkipAllAdditionals", p.SkipAllAdditionals}, - } - for _, test := range tests { - for i := 1; i <= 3; i++ { - if err := test.f(); err != nil { - t.Errorf("%d: Parser.%s() = %v", i, test.name, err) - } - } - } -} - -func TestSkipEach(t *testing.T) { - msg := smallTestMsg() - - buf, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - var p Parser - if _, err := p.Start(buf); err != nil { - t.Fatal("Parser.Start(non-nil) =", err) - } - - tests := []struct { - name string - f func() error - }{ - {"SkipQuestion", p.SkipQuestion}, - {"SkipAnswer", p.SkipAnswer}, - {"SkipAuthority", p.SkipAuthority}, - {"SkipAdditional", p.SkipAdditional}, - } - for _, test := range tests { - if err := test.f(); err != nil { - t.Errorf("first Parser.%s() = %v, want = nil", test.name, err) - } - if err := test.f(); err != ErrSectionDone { - t.Errorf("second Parser.%s() = %v, want = %v", test.name, err, ErrSectionDone) - } - } -} - -func TestSkipAfterRead(t *testing.T) { - msg := smallTestMsg() - - buf, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - var p Parser - if _, err := p.Start(buf); err != nil { - t.Fatal("Parser.Srart(non-nil) =", err) - } - - tests := []struct { - name string - skip func() error - read func() error - }{ - {"Question", p.SkipQuestion, func() error { _, err := p.Question(); return err }}, - {"Answer", p.SkipAnswer, func() error { _, err := p.Answer(); return err }}, - {"Authority", p.SkipAuthority, func() error { _, err := p.Authority(); return err }}, - {"Additional", p.SkipAdditional, func() error { _, err := p.Additional(); return err }}, - } - for _, test := range tests { - if err := test.read(); err != nil { - t.Errorf("got Parser.%s() = _, %v, want = _, nil", test.name, err) - } - if err := test.skip(); err != ErrSectionDone { - t.Errorf("got Parser.Skip%s() = %v, want = %v", test.name, err, ErrSectionDone) - } - } -} - -func TestSkipNotStarted(t *testing.T) { - var p Parser - - tests := []struct { - name string - f func() error - }{ - {"SkipAllQuestions", p.SkipAllQuestions}, - {"SkipAllAnswers", p.SkipAllAnswers}, - {"SkipAllAuthorities", p.SkipAllAuthorities}, - {"SkipAllAdditionals", p.SkipAllAdditionals}, - } - for _, test := range tests { - if err := test.f(); err != ErrNotStarted { - t.Errorf("got Parser.%s() = %v, want = %v", test.name, err, ErrNotStarted) - } - } -} - -func TestTooManyRecords(t *testing.T) { - const recs = int(^uint16(0)) + 1 - tests := []struct { - name string - msg Message - want error - }{ - { - "Questions", - Message{ - Questions: make([]Question, recs), - }, - errTooManyQuestions, - }, - { - "Answers", - Message{ - Answers: make([]Resource, recs), - }, - errTooManyAnswers, - }, - { - "Authorities", - Message{ - Authorities: make([]Resource, recs), - }, - errTooManyAuthorities, - }, - { - "Additionals", - Message{ - Additionals: make([]Resource, recs), - }, - errTooManyAdditionals, - }, - } - - for _, test := range tests { - if _, got := test.msg.Pack(); got != test.want { - t.Errorf("got Message.Pack() for %d %s = %v, want = %v", recs, test.name, got, test.want) - } - } -} - -func TestVeryLongTxt(t *testing.T) { - want := Resource{ - ResourceHeader{ - Name: MustNewName("foo.bar.example.com."), - Type: TypeTXT, - Class: ClassINET, - }, - &TXTResource{[]string{ - "", - "", - "foo bar", - "", - "www.example.com", - "www.example.com.", - strings.Repeat(".", 255), - }}, - } - buf, err := want.pack(make([]byte, 0, 8000), map[string]int{}, 0) - if err != nil { - t.Fatal("Resource.pack() =", err) - } - var got Resource - off, err := got.Header.unpack(buf, 0) - if err != nil { - t.Fatal("ResourceHeader.unpack() =", err) - } - body, n, err := unpackResourceBody(buf, off, got.Header) - if err != nil { - t.Fatal("unpackResourceBody() =", err) - } - got.Body = body - if n != len(buf) { - t.Errorf("unpacked different amount than packed: got = %d, want = %d", n, len(buf)) - } - if !reflect.DeepEqual(got, want) { - t.Errorf("Resource.pack/unpack() roundtrip: got = %#v, want = %#v", got, want) - } -} - -func TestTooLongTxt(t *testing.T) { - rb := TXTResource{[]string{strings.Repeat(".", 256)}} - if _, err := rb.pack(make([]byte, 0, 8000), map[string]int{}, 0); err != errStringTooLong { - t.Errorf("packing TXTResource with 256 character string: got err = %v, want = %v", err, errStringTooLong) - } -} - -func TestStartAppends(t *testing.T) { - buf := make([]byte, 2, 514) - wantBuf := []byte{4, 44} - copy(buf, wantBuf) - - b := NewBuilder(buf, Header{}) - b.EnableCompression() - - buf, err := b.Finish() - if err != nil { - t.Fatal("Builder.Finish() =", err) - } - if got, want := len(buf), headerLen+2; got != want { - t.Errorf("got len(buf) = %d, want = %d", got, want) - } - if string(buf[:2]) != string(wantBuf) { - t.Errorf("original data not preserved, got = %#v, want = %#v", buf[:2], wantBuf) - } -} - -func TestStartError(t *testing.T) { - tests := []struct { - name string - fn func(*Builder) error - }{ - {"Questions", func(b *Builder) error { return b.StartQuestions() }}, - {"Answers", func(b *Builder) error { return b.StartAnswers() }}, - {"Authorities", func(b *Builder) error { return b.StartAuthorities() }}, - {"Additionals", func(b *Builder) error { return b.StartAdditionals() }}, - } - - envs := []struct { - name string - fn func() *Builder - want error - }{ - {"sectionNotStarted", func() *Builder { return &Builder{section: sectionNotStarted} }, ErrNotStarted}, - {"sectionDone", func() *Builder { return &Builder{section: sectionDone} }, ErrSectionDone}, - } - - for _, env := range envs { - for _, test := range tests { - if got := test.fn(env.fn()); got != env.want { - t.Errorf("got Builder{%s}.Start%s() = %v, want = %v", env.name, test.name, got, env.want) - } - } - } -} - -func TestBuilderResourceError(t *testing.T) { - tests := []struct { - name string - fn func(*Builder) error - }{ - {"CNAMEResource", func(b *Builder) error { return b.CNAMEResource(ResourceHeader{}, CNAMEResource{}) }}, - {"MXResource", func(b *Builder) error { return b.MXResource(ResourceHeader{}, MXResource{}) }}, - {"NSResource", func(b *Builder) error { return b.NSResource(ResourceHeader{}, NSResource{}) }}, - {"PTRResource", func(b *Builder) error { return b.PTRResource(ResourceHeader{}, PTRResource{}) }}, - {"SOAResource", func(b *Builder) error { return b.SOAResource(ResourceHeader{}, SOAResource{}) }}, - {"TXTResource", func(b *Builder) error { return b.TXTResource(ResourceHeader{}, TXTResource{}) }}, - {"SRVResource", func(b *Builder) error { return b.SRVResource(ResourceHeader{}, SRVResource{}) }}, - {"AResource", func(b *Builder) error { return b.AResource(ResourceHeader{}, AResource{}) }}, - {"AAAAResource", func(b *Builder) error { return b.AAAAResource(ResourceHeader{}, AAAAResource{}) }}, - {"OPTResource", func(b *Builder) error { return b.OPTResource(ResourceHeader{}, OPTResource{}) }}, - } - - envs := []struct { - name string - fn func() *Builder - want error - }{ - {"sectionNotStarted", func() *Builder { return &Builder{section: sectionNotStarted} }, ErrNotStarted}, - {"sectionHeader", func() *Builder { return &Builder{section: sectionHeader} }, ErrNotStarted}, - {"sectionQuestions", func() *Builder { return &Builder{section: sectionQuestions} }, ErrNotStarted}, - {"sectionDone", func() *Builder { return &Builder{section: sectionDone} }, ErrSectionDone}, - } - - for _, env := range envs { - for _, test := range tests { - if got := test.fn(env.fn()); got != env.want { - t.Errorf("got Builder{%s}.%s() = %v, want = %v", env.name, test.name, got, env.want) - } - } - } -} - -func TestFinishError(t *testing.T) { - var b Builder - want := ErrNotStarted - if _, got := b.Finish(); got != want { - t.Errorf("got Builder.Finish() = %v, want = %v", got, want) - } -} - -func TestBuilder(t *testing.T) { - msg := largeTestMsg() - want, err := msg.Pack() - if err != nil { - t.Fatal("Message.Pack() =", err) - } - - b := NewBuilder(nil, msg.Header) - b.EnableCompression() - - if err := b.StartQuestions(); err != nil { - t.Fatal("Builder.StartQuestions() =", err) - } - for _, q := range msg.Questions { - if err := b.Question(q); err != nil { - t.Fatalf("Builder.Question(%#v) = %v", q, err) - } - } - - if err := b.StartAnswers(); err != nil { - t.Fatal("Builder.StartAnswers() =", err) - } - for _, a := range msg.Answers { - switch a.Header.Type { - case TypeA: - if err := b.AResource(a.Header, *a.Body.(*AResource)); err != nil { - t.Fatalf("Builder.AResource(%#v) = %v", a, err) - } - case TypeNS: - if err := b.NSResource(a.Header, *a.Body.(*NSResource)); err != nil { - t.Fatalf("Builder.NSResource(%#v) = %v", a, err) - } - case TypeCNAME: - if err := b.CNAMEResource(a.Header, *a.Body.(*CNAMEResource)); err != nil { - t.Fatalf("Builder.CNAMEResource(%#v) = %v", a, err) - } - case TypeSOA: - if err := b.SOAResource(a.Header, *a.Body.(*SOAResource)); err != nil { - t.Fatalf("Builder.SOAResource(%#v) = %v", a, err) - } - case TypePTR: - if err := b.PTRResource(a.Header, *a.Body.(*PTRResource)); err != nil { - t.Fatalf("Builder.PTRResource(%#v) = %v", a, err) - } - case TypeMX: - if err := b.MXResource(a.Header, *a.Body.(*MXResource)); err != nil { - t.Fatalf("Builder.MXResource(%#v) = %v", a, err) - } - case TypeTXT: - if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { - t.Fatalf("Builder.TXTResource(%#v) = %v", a, err) - } - case TypeAAAA: - if err := b.AAAAResource(a.Header, *a.Body.(*AAAAResource)); err != nil { - t.Fatalf("Builder.AAAAResource(%#v) = %v", a, err) - } - case TypeSRV: - if err := b.SRVResource(a.Header, *a.Body.(*SRVResource)); err != nil { - t.Fatalf("Builder.SRVResource(%#v) = %v", a, err) - } - } - } - - if err := b.StartAuthorities(); err != nil { - t.Fatal("Builder.StartAuthorities() =", err) - } - for _, a := range msg.Authorities { - if err := b.NSResource(a.Header, *a.Body.(*NSResource)); err != nil { - t.Fatalf("Builder.NSResource(%#v) = %v", a, err) - } - } - - if err := b.StartAdditionals(); err != nil { - t.Fatal("Builder.StartAdditionals() =", err) - } - for _, a := range msg.Additionals { - switch a.Body.(type) { - case *TXTResource: - if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { - t.Fatalf("Builder.TXTResource(%#v) = %v", a, err) - } - case *OPTResource: - if err := b.OPTResource(a.Header, *a.Body.(*OPTResource)); err != nil { - t.Fatalf("Builder.OPTResource(%#v) = %v", a, err) - } - } - } - - got, err := b.Finish() - if err != nil { - t.Fatal("Builder.Finish() =", err) - } - if !bytes.Equal(got, want) { - t.Fatalf("got from Builder.Finish() = %#v\nwant = %#v", got, want) - } -} - -func TestResourcePack(t *testing.T) { - for _, tt := range []struct { - m Message - err error - }{ - { - Message{ - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Answers: []Resource{{ResourceHeader{}, nil}}, - }, - &nestedError{"packing Answer", errNilResouceBody}, - }, - { - Message{ - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Authorities: []Resource{{ResourceHeader{}, (*NSResource)(nil)}}, - }, - &nestedError{"packing Authority", - &nestedError{"ResourceHeader", - &nestedError{"Name", errNonCanonicalName}, - }, - }, - }, - { - Message{ - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - }, - }, - Additionals: []Resource{{ResourceHeader{}, nil}}, - }, - &nestedError{"packing Additional", errNilResouceBody}, - }, - } { - _, err := tt.m.Pack() - if !reflect.DeepEqual(err, tt.err) { - t.Errorf("got Message{%v}.Pack() = %v, want %v", tt.m, err, tt.err) - } - } -} - -func TestResourcePackLength(t *testing.T) { - r := Resource{ - ResourceHeader{ - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 2}}, - } - - hb, _, err := r.Header.pack(nil, nil, 0) - if err != nil { - t.Fatal("ResourceHeader.pack() =", err) - } - buf := make([]byte, 0, len(hb)) - buf, err = r.pack(buf, nil, 0) - if err != nil { - t.Fatal("Resource.pack() =", err) - } - - var hdr ResourceHeader - if _, err := hdr.unpack(buf, 0); err != nil { - t.Fatal("ResourceHeader.unpack() =", err) - } - - if got, want := int(hdr.Length), len(buf)-len(hb); got != want { - t.Errorf("got hdr.Length = %d, want = %d", got, want) - } -} - -func TestOptionPackUnpack(t *testing.T) { - for _, tt := range []struct { - name string - w []byte // wire format of m.Additionals - m Message - dnssecOK bool - extRCode RCode - }{ - { - name: "without EDNS(0) options", - w: []byte{ - 0x00, 0x00, 0x29, 0x10, 0x00, 0xfe, 0x00, 0x80, - 0x00, 0x00, 0x00, - }, - m: Message{ - Header: Header{RCode: RCodeFormatError}, - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeA, - Class: ClassINET, - }, - }, - Additionals: []Resource{ - { - mustEDNS0ResourceHeader(4096, 0xfe0|RCodeFormatError, true), - &OPTResource{}, - }, - }, - }, - dnssecOK: true, - extRCode: 0xfe0 | RCodeFormatError, - }, - { - name: "with EDNS(0) options", - w: []byte{ - 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x0b, 0x00, 0x02, 0x12, 0x34, - }, - m: Message{ - Header: Header{RCode: RCodeServerFailure}, - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Additionals: []Resource{ - { - mustEDNS0ResourceHeader(4096, 0xff0|RCodeServerFailure, false), - &OPTResource{ - Options: []Option{ - { - Code: 12, // see RFC 7828 - Data: []byte{0x00, 0x00}, - }, - { - Code: 11, // see RFC 7830 - Data: []byte{0x12, 0x34}, - }, - }, - }, - }, - }, - }, - dnssecOK: false, - extRCode: 0xff0 | RCodeServerFailure, - }, - { - // Containing multiple OPT resources in a - // message is invalid, but it's necessary for - // protocol conformance testing. - name: "with multiple OPT resources", - w: []byte{ - 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x02, 0x12, - 0x34, 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, - 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x02, - 0x00, 0x00, - }, - m: Message{ - Header: Header{RCode: RCodeNameError}, - Questions: []Question{ - { - Name: MustNewName("."), - Type: TypeAAAA, - Class: ClassINET, - }, - }, - Additionals: []Resource{ - { - mustEDNS0ResourceHeader(4096, 0xff0|RCodeNameError, false), - &OPTResource{ - Options: []Option{ - { - Code: 11, // see RFC 7830 - Data: []byte{0x12, 0x34}, - }, - }, - }, - }, - { - mustEDNS0ResourceHeader(4096, 0xff0|RCodeNameError, false), - &OPTResource{ - Options: []Option{ - { - Code: 12, // see RFC 7828 - Data: []byte{0x00, 0x00}, - }, - }, - }, - }, - }, - }, - }, - } { - w, err := tt.m.Pack() - if err != nil { - t.Errorf("Message.Pack() for %s = %v", tt.name, err) - continue - } - if !bytes.Equal(w[len(w)-len(tt.w):], tt.w) { - t.Errorf("got Message.Pack() for %s = %#v, want %#v", tt.name, w[len(w)-len(tt.w):], tt.w) - continue - } - var m Message - if err := m.Unpack(w); err != nil { - t.Errorf("Message.Unpack() for %s = %v", tt.name, err) - continue - } - if !reflect.DeepEqual(m.Additionals, tt.m.Additionals) { - t.Errorf("got Message.Pack/Unpack() roundtrip for %s = %+v, want %+v", tt.name, m, tt.m) - continue - } - } -} - -// TestGoString tests that Message.GoString produces Go code that compiles to -// reproduce the Message. -// -// This test was produced as follows: -// 1. Run (*Message).GoString on largeTestMsg(). -// 2. Remove "dnsmessage." from the output. -// 3. Paste the result in the test to store it in msg. -// 4. Also put the original output in the test to store in want. -func TestGoString(t *testing.T) { - msg := Message{Header: Header{ID: 0, Response: true, OpCode: 0, Authoritative: true, Truncated: false, RecursionDesired: false, RecursionAvailable: false, RCode: RCodeSuccess}, Questions: []Question{{Name: MustNewName("foo.bar.example.com."), Type: TypeA, Class: ClassINET}}, Answers: []Resource{{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeA, Class: ClassINET, TTL: 0, Length: 0}, Body: &AResource{A: [4]byte{127, 0, 0, 1}}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeA, Class: ClassINET, TTL: 0, Length: 0}, Body: &AResource{A: [4]byte{127, 0, 0, 2}}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeAAAA, Class: ClassINET, TTL: 0, Length: 0}, Body: &AAAAResource{AAAA: [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeCNAME, Class: ClassINET, TTL: 0, Length: 0}, Body: &CNAMEResource{CNAME: MustNewName("alias.example.com.")}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeSOA, Class: ClassINET, TTL: 0, Length: 0}, Body: &SOAResource{NS: MustNewName("ns1.example.com."), MBox: MustNewName("mb.example.com."), Serial: 1, Refresh: 2, Retry: 3, Expire: 4, MinTTL: 5}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypePTR, Class: ClassINET, TTL: 0, Length: 0}, Body: &PTRResource{PTR: MustNewName("ptr.example.com.")}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeMX, Class: ClassINET, TTL: 0, Length: 0}, Body: &MXResource{Pref: 7, MX: MustNewName("mx.example.com.")}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeSRV, Class: ClassINET, TTL: 0, Length: 0}, Body: &SRVResource{Priority: 8, Weight: 9, Port: 11, Target: MustNewName("srv.example.com.")}}}, Authorities: []Resource{{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeNS, Class: ClassINET, TTL: 0, Length: 0}, Body: &NSResource{NS: MustNewName("ns1.example.com.")}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeNS, Class: ClassINET, TTL: 0, Length: 0}, Body: &NSResource{NS: MustNewName("ns2.example.com.")}}}, Additionals: []Resource{{Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeTXT, Class: ClassINET, TTL: 0, Length: 0}, Body: &TXTResource{TXT: []string{"So Long\x2c and Thanks for All the Fish"}}}, {Header: ResourceHeader{Name: MustNewName("foo.bar.example.com."), Type: TypeTXT, Class: ClassINET, TTL: 0, Length: 0}, Body: &TXTResource{TXT: []string{"Hamster Huey and the Gooey Kablooie"}}}, {Header: ResourceHeader{Name: MustNewName("."), Type: TypeOPT, Class: 4096, TTL: 4261412864, Length: 0}, Body: &OPTResource{Options: []Option{{Code: 10, Data: []byte{1, 35, 69, 103, 137, 171, 205, 239}}}}}}} - if !reflect.DeepEqual(msg, largeTestMsg()) { - t.Error("Message.GoString lost information or largeTestMsg changed: msg != largeTestMsg()") - } - got := msg.GoString() - want := `dnsmessage.Message{Header: dnsmessage.Header{ID: 0, Response: true, OpCode: 0, Authoritative: true, Truncated: false, RecursionDesired: false, RecursionAvailable: false, RCode: dnsmessage.RCodeSuccess}, Questions: []dnsmessage.Question{dnsmessage.Question{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET}}, Answers: []dnsmessage.Resource{dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 1}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 2}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeAAAA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.AAAAResource{AAAA: [16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeCNAME, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.CNAMEResource{CNAME: dnsmessage.MustNewName("alias.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeSOA, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.SOAResource{NS: dnsmessage.MustNewName("ns1.example.com."), MBox: dnsmessage.MustNewName("mb.example.com."), Serial: 1, Refresh: 2, Retry: 3, Expire: 4, MinTTL: 5}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypePTR, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.PTRResource{PTR: dnsmessage.MustNewName("ptr.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeMX, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.MXResource{Pref: 7, MX: dnsmessage.MustNewName("mx.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeSRV, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.SRVResource{Priority: 8, Weight: 9, Port: 11, Target: dnsmessage.MustNewName("srv.example.com.")}}}, Authorities: []dnsmessage.Resource{dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeNS, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.NSResource{NS: dnsmessage.MustNewName("ns1.example.com.")}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeNS, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.NSResource{NS: dnsmessage.MustNewName("ns2.example.com.")}}}, Additionals: []dnsmessage.Resource{dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeTXT, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.TXTResource{TXT: []string{"So Long\x2c and Thanks for All the Fish"}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("foo.bar.example.com."), Type: dnsmessage.TypeTXT, Class: dnsmessage.ClassINET, TTL: 0, Length: 0}, Body: &dnsmessage.TXTResource{TXT: []string{"Hamster Huey and the Gooey Kablooie"}}}, dnsmessage.Resource{Header: dnsmessage.ResourceHeader{Name: dnsmessage.MustNewName("."), Type: dnsmessage.TypeOPT, Class: 4096, TTL: 4261412864, Length: 0}, Body: &dnsmessage.OPTResource{Options: []dnsmessage.Option{dnsmessage.Option{Code: 10, Data: []byte{1, 35, 69, 103, 137, 171, 205, 239}}}}}}}` - if got != want { - t.Errorf("got msg1.GoString() = %s\nwant = %s", got, want) - } -} - -func benchmarkParsingSetup() ([]byte, error) { - name := MustNewName("foo.bar.example.com.") - msg := Message{ - Header: Header{Response: true, Authoritative: true}, - Questions: []Question{ - { - Name: name, - Type: TypeA, - Class: ClassINET, - }, - }, - Answers: []Resource{ - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &AResource{[4]byte{}}, - }, - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &AAAAResource{[16]byte{}}, - }, - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &CNAMEResource{name}, - }, - { - ResourceHeader{ - Name: name, - Class: ClassINET, - }, - &NSResource{name}, - }, - }, - } - - buf, err := msg.Pack() - if err != nil { - return nil, fmt.Errorf("Message.Pack() = %v", err) - } - return buf, nil -} - -func benchmarkParsing(tb testing.TB, buf []byte) { - var p Parser - if _, err := p.Start(buf); err != nil { - tb.Fatal("Parser.Start(non-nil) =", err) - } - - for { - _, err := p.Question() - if err == ErrSectionDone { - break - } - if err != nil { - tb.Fatal("Parser.Question() =", err) - } - } - - for { - h, err := p.AnswerHeader() - if err == ErrSectionDone { - break - } - if err != nil { - tb.Fatal("Parser.AnswerHeader() =", err) - } - - switch h.Type { - case TypeA: - if _, err := p.AResource(); err != nil { - tb.Fatal("Parser.AResource() =", err) - } - case TypeAAAA: - if _, err := p.AAAAResource(); err != nil { - tb.Fatal("Parser.AAAAResource() =", err) - } - case TypeCNAME: - if _, err := p.CNAMEResource(); err != nil { - tb.Fatal("Parser.CNAMEResource() =", err) - } - case TypeNS: - if _, err := p.NSResource(); err != nil { - tb.Fatal("Parser.NSResource() =", err) - } - case TypeOPT: - if _, err := p.OPTResource(); err != nil { - tb.Fatal("Parser.OPTResource() =", err) - } - default: - tb.Fatalf("got unknown type: %T", h) - } - } -} - -func BenchmarkParsing(b *testing.B) { - buf, err := benchmarkParsingSetup() - if err != nil { - b.Fatal(err) - } - - b.ReportAllocs() - for i := 0; i < b.N; i++ { - benchmarkParsing(b, buf) - } -} - -func TestParsingAllocs(t *testing.T) { - buf, err := benchmarkParsingSetup() - if err != nil { - t.Fatal(err) - } - - if allocs := testing.AllocsPerRun(100, func() { benchmarkParsing(t, buf) }); allocs > 0.5 { - t.Errorf("allocations during parsing: got = %f, want ~0", allocs) - } -} - -func benchmarkBuildingSetup() (Name, []byte) { - name := MustNewName("foo.bar.example.com.") - buf := make([]byte, 0, packStartingCap) - return name, buf -} - -func benchmarkBuilding(tb testing.TB, name Name, buf []byte) { - bld := NewBuilder(buf, Header{Response: true, Authoritative: true}) - - if err := bld.StartQuestions(); err != nil { - tb.Fatal("Builder.StartQuestions() =", err) - } - q := Question{ - Name: name, - Type: TypeA, - Class: ClassINET, - } - if err := bld.Question(q); err != nil { - tb.Fatalf("Builder.Question(%+v) = %v", q, err) - } - - hdr := ResourceHeader{ - Name: name, - Class: ClassINET, - } - if err := bld.StartAnswers(); err != nil { - tb.Fatal("Builder.StartQuestions() =", err) - } - - ar := AResource{[4]byte{}} - if err := bld.AResource(hdr, ar); err != nil { - tb.Fatalf("Builder.AResource(%+v, %+v) = %v", hdr, ar, err) - } - - aaar := AAAAResource{[16]byte{}} - if err := bld.AAAAResource(hdr, aaar); err != nil { - tb.Fatalf("Builder.AAAAResource(%+v, %+v) = %v", hdr, aaar, err) - } - - cnr := CNAMEResource{name} - if err := bld.CNAMEResource(hdr, cnr); err != nil { - tb.Fatalf("Builder.CNAMEResource(%+v, %+v) = %v", hdr, cnr, err) - } - - nsr := NSResource{name} - if err := bld.NSResource(hdr, nsr); err != nil { - tb.Fatalf("Builder.NSResource(%+v, %+v) = %v", hdr, nsr, err) - } - - extrc := 0xfe0 | RCodeNotImplemented - if err := (&hdr).SetEDNS0(4096, extrc, true); err != nil { - tb.Fatalf("ResourceHeader.SetEDNS0(4096, %#x, true) = %v", extrc, err) - } - optr := OPTResource{} - if err := bld.OPTResource(hdr, optr); err != nil { - tb.Fatalf("Builder.OPTResource(%+v, %+v) = %v", hdr, optr, err) - } - - if _, err := bld.Finish(); err != nil { - tb.Fatal("Builder.Finish() =", err) - } -} - -func BenchmarkBuilding(b *testing.B) { - name, buf := benchmarkBuildingSetup() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - benchmarkBuilding(b, name, buf) - } -} - -func TestBuildingAllocs(t *testing.T) { - name, buf := benchmarkBuildingSetup() - if allocs := testing.AllocsPerRun(100, func() { benchmarkBuilding(t, name, buf) }); allocs > 0.5 { - t.Errorf("allocations during building: got = %f, want ~0", allocs) - } -} - -func smallTestMsg() Message { - name := MustNewName("example.com.") - return Message{ - Header: Header{Response: true, Authoritative: true}, - Questions: []Question{ - { - Name: name, - Type: TypeA, - Class: ClassINET, - }, - }, - Answers: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - }, - Authorities: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - }, - Additionals: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - }, - } -} - -func BenchmarkPack(b *testing.B) { - msg := largeTestMsg() - - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - if _, err := msg.Pack(); err != nil { - b.Fatal("Message.Pack() =", err) - } - } -} - -func BenchmarkAppendPack(b *testing.B) { - msg := largeTestMsg() - buf := make([]byte, 0, packStartingCap) - - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - if _, err := msg.AppendPack(buf[:0]); err != nil { - b.Fatal("Message.AppendPack() = ", err) - } - } -} - -func largeTestMsg() Message { - name := MustNewName("foo.bar.example.com.") - return Message{ - Header: Header{Response: true, Authoritative: true}, - Questions: []Question{ - { - Name: name, - Type: TypeA, - Class: ClassINET, - }, - }, - Answers: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 1}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeA, - Class: ClassINET, - }, - &AResource{[4]byte{127, 0, 0, 2}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeAAAA, - Class: ClassINET, - }, - &AAAAResource{[16]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeCNAME, - Class: ClassINET, - }, - &CNAMEResource{MustNewName("alias.example.com.")}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeSOA, - Class: ClassINET, - }, - &SOAResource{ - NS: MustNewName("ns1.example.com."), - MBox: MustNewName("mb.example.com."), - Serial: 1, - Refresh: 2, - Retry: 3, - Expire: 4, - MinTTL: 5, - }, - }, - { - ResourceHeader{ - Name: name, - Type: TypePTR, - Class: ClassINET, - }, - &PTRResource{MustNewName("ptr.example.com.")}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeMX, - Class: ClassINET, - }, - &MXResource{ - 7, - MustNewName("mx.example.com."), - }, - }, - { - ResourceHeader{ - Name: name, - Type: TypeSRV, - Class: ClassINET, - }, - &SRVResource{ - 8, - 9, - 11, - MustNewName("srv.example.com."), - }, - }, - }, - Authorities: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeNS, - Class: ClassINET, - }, - &NSResource{MustNewName("ns1.example.com.")}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeNS, - Class: ClassINET, - }, - &NSResource{MustNewName("ns2.example.com.")}, - }, - }, - Additionals: []Resource{ - { - ResourceHeader{ - Name: name, - Type: TypeTXT, - Class: ClassINET, - }, - &TXTResource{[]string{"So Long, and Thanks for All the Fish"}}, - }, - { - ResourceHeader{ - Name: name, - Type: TypeTXT, - Class: ClassINET, - }, - &TXTResource{[]string{"Hamster Huey and the Gooey Kablooie"}}, - }, - { - mustEDNS0ResourceHeader(4096, 0xfe0|RCodeSuccess, false), - &OPTResource{ - Options: []Option{ - { - Code: 10, // see RFC 7873 - Data: []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, - }, - }, - }, - }, - }, - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/go.mod b/src/imagemagick/vendor/golang.org/x/net/go.mod deleted file mode 100644 index 325937b..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/go.mod +++ /dev/null @@ -1,9 +0,0 @@ -module golang.org/x/net - -go 1.11 - -require ( - golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 - golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a - golang.org/x/text v0.3.0 -) diff --git a/src/imagemagick/vendor/golang.org/x/net/go.sum b/src/imagemagick/vendor/golang.org/x/net/go.sum deleted file mode 100644 index 0fa675a..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/go.sum +++ /dev/null @@ -1,6 +0,0 @@ -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/src/imagemagick/vendor/golang.org/x/net/html/atom/atom_test.go b/src/imagemagick/vendor/golang.org/x/net/html/atom/atom_test.go deleted file mode 100644 index 6e33704..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/atom/atom_test.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2012 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 atom - -import ( - "sort" - "testing" -) - -func TestKnown(t *testing.T) { - for _, s := range testAtomList { - if atom := Lookup([]byte(s)); atom.String() != s { - t.Errorf("Lookup(%q) = %#x (%q)", s, uint32(atom), atom.String()) - } - } -} - -func TestHits(t *testing.T) { - for _, a := range table { - if a == 0 { - continue - } - got := Lookup([]byte(a.String())) - if got != a { - t.Errorf("Lookup(%q) = %#x, want %#x", a.String(), uint32(got), uint32(a)) - } - } -} - -func TestMisses(t *testing.T) { - testCases := []string{ - "", - "\x00", - "\xff", - "A", - "DIV", - "Div", - "dIV", - "aa", - "a\x00", - "ab", - "abb", - "abbr0", - "abbr ", - " abbr", - " a", - "acceptcharset", - "acceptCharset", - "accept_charset", - "h0", - "h1h2", - "h7", - "onClick", - "λ", - // The following string has the same hash (0xa1d7fab7) as "onmouseover". - "\x00\x00\x00\x00\x00\x50\x18\xae\x38\xd0\xb7", - } - for _, tc := range testCases { - got := Lookup([]byte(tc)) - if got != 0 { - t.Errorf("Lookup(%q): got %d, want 0", tc, got) - } - } -} - -func TestForeignObject(t *testing.T) { - const ( - afo = Foreignobject - afO = ForeignObject - sfo = "foreignobject" - sfO = "foreignObject" - ) - if got := Lookup([]byte(sfo)); got != afo { - t.Errorf("Lookup(%q): got %#v, want %#v", sfo, got, afo) - } - if got := Lookup([]byte(sfO)); got != afO { - t.Errorf("Lookup(%q): got %#v, want %#v", sfO, got, afO) - } - if got := afo.String(); got != sfo { - t.Errorf("Atom(%#v).String(): got %q, want %q", afo, got, sfo) - } - if got := afO.String(); got != sfO { - t.Errorf("Atom(%#v).String(): got %q, want %q", afO, got, sfO) - } -} - -func BenchmarkLookup(b *testing.B) { - sortedTable := make([]string, 0, len(table)) - for _, a := range table { - if a != 0 { - sortedTable = append(sortedTable, a.String()) - } - } - sort.Strings(sortedTable) - - x := make([][]byte, 1000) - for i := range x { - x[i] = []byte(sortedTable[i%len(sortedTable)]) - } - - b.ResetTimer() - for i := 0; i < b.N; i++ { - for _, s := range x { - Lookup(s) - } - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/atom/table_test.go b/src/imagemagick/vendor/golang.org/x/net/html/atom/table_test.go deleted file mode 100644 index 8a30762..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/atom/table_test.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by go generate gen.go; DO NOT EDIT. - -//go:generate go run gen.go -test - -package atom - -var testAtomList = []string{ - "a", - "abbr", - "accept", - "accept-charset", - "accesskey", - "acronym", - "action", - "address", - "align", - "allowfullscreen", - "allowpaymentrequest", - "allowusermedia", - "alt", - "annotation", - "annotation-xml", - "applet", - "area", - "article", - "as", - "aside", - "async", - "audio", - "autocomplete", - "autofocus", - "autoplay", - "b", - "base", - "basefont", - "bdi", - "bdo", - "bgsound", - "big", - "blink", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "center", - "challenge", - "charset", - "checked", - "cite", - "class", - "code", - "col", - "colgroup", - "color", - "cols", - "colspan", - "command", - "content", - "contenteditable", - "contextmenu", - "controls", - "coords", - "crossorigin", - "data", - "datalist", - "datetime", - "dd", - "default", - "defer", - "del", - "desc", - "details", - "dfn", - "dialog", - "dir", - "dirname", - "disabled", - "div", - "dl", - "download", - "draggable", - "dropzone", - "dt", - "em", - "embed", - "enctype", - "face", - "fieldset", - "figcaption", - "figure", - "font", - "footer", - "for", - "foreignObject", - "foreignobject", - "form", - "formaction", - "formenctype", - "formmethod", - "formnovalidate", - "formtarget", - "frame", - "frameset", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "headers", - "height", - "hgroup", - "hidden", - "high", - "hr", - "href", - "hreflang", - "html", - "http-equiv", - "i", - "icon", - "id", - "iframe", - "image", - "img", - "input", - "inputmode", - "ins", - "integrity", - "is", - "isindex", - "ismap", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "kbd", - "keygen", - "keytype", - "kind", - "label", - "lang", - "legend", - "li", - "link", - "list", - "listing", - "loop", - "low", - "main", - "malignmark", - "manifest", - "map", - "mark", - "marquee", - "math", - "max", - "maxlength", - "media", - "mediagroup", - "menu", - "menuitem", - "meta", - "meter", - "method", - "mglyph", - "mi", - "min", - "minlength", - "mn", - "mo", - "ms", - "mtext", - "multiple", - "muted", - "name", - "nav", - "nobr", - "noembed", - "noframes", - "nomodule", - "nonce", - "noscript", - "novalidate", - "object", - "ol", - "onabort", - "onafterprint", - "onautocomplete", - "onautocompleteerror", - "onauxclick", - "onbeforeprint", - "onbeforeunload", - "onblur", - "oncancel", - "oncanplay", - "oncanplaythrough", - "onchange", - "onclick", - "onclose", - "oncontextmenu", - "oncopy", - "oncuechange", - "oncut", - "ondblclick", - "ondrag", - "ondragend", - "ondragenter", - "ondragexit", - "ondragleave", - "ondragover", - "ondragstart", - "ondrop", - "ondurationchange", - "onemptied", - "onended", - "onerror", - "onfocus", - "onhashchange", - "oninput", - "oninvalid", - "onkeydown", - "onkeypress", - "onkeyup", - "onlanguagechange", - "onload", - "onloadeddata", - "onloadedmetadata", - "onloadend", - "onloadstart", - "onmessage", - "onmessageerror", - "onmousedown", - "onmouseenter", - "onmouseleave", - "onmousemove", - "onmouseout", - "onmouseover", - "onmouseup", - "onmousewheel", - "onoffline", - "ononline", - "onpagehide", - "onpageshow", - "onpaste", - "onpause", - "onplay", - "onplaying", - "onpopstate", - "onprogress", - "onratechange", - "onrejectionhandled", - "onreset", - "onresize", - "onscroll", - "onsecuritypolicyviolation", - "onseeked", - "onseeking", - "onselect", - "onshow", - "onsort", - "onstalled", - "onstorage", - "onsubmit", - "onsuspend", - "ontimeupdate", - "ontoggle", - "onunhandledrejection", - "onunload", - "onvolumechange", - "onwaiting", - "onwheel", - "open", - "optgroup", - "optimum", - "option", - "output", - "p", - "param", - "pattern", - "picture", - "ping", - "placeholder", - "plaintext", - "playsinline", - "poster", - "pre", - "preload", - "progress", - "prompt", - "public", - "q", - "radiogroup", - "rb", - "readonly", - "referrerpolicy", - "rel", - "required", - "reversed", - "rows", - "rowspan", - "rp", - "rt", - "rtc", - "ruby", - "s", - "samp", - "sandbox", - "scope", - "scoped", - "script", - "seamless", - "section", - "select", - "selected", - "shape", - "size", - "sizes", - "slot", - "small", - "sortable", - "sorted", - "source", - "spacer", - "span", - "spellcheck", - "src", - "srcdoc", - "srclang", - "srcset", - "start", - "step", - "strike", - "strong", - "style", - "sub", - "summary", - "sup", - "svg", - "system", - "tabindex", - "table", - "target", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "translate", - "tt", - "type", - "typemustmatch", - "u", - "ul", - "updateviacache", - "usemap", - "value", - "var", - "video", - "wbr", - "width", - "workertype", - "wrap", - "xmp", -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/charset_test.go b/src/imagemagick/vendor/golang.org/x/net/html/charset/charset_test.go deleted file mode 100644 index e4e7d86..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/charset_test.go +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright 2013 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 charset - -import ( - "bytes" - "encoding/xml" - "io/ioutil" - "runtime" - "strings" - "testing" - - "golang.org/x/text/transform" -) - -func transformString(t transform.Transformer, s string) (string, error) { - r := transform.NewReader(strings.NewReader(s), t) - b, err := ioutil.ReadAll(r) - return string(b), err -} - -type testCase struct { - utf8, other, otherEncoding string -} - -// testCases for encoding and decoding. -var testCases = []testCase{ - {"Résumé", "Résumé", "utf8"}, - {"Résumé", "R\xe9sum\xe9", "latin1"}, - {"ã“ã‚Œã¯æ¼¢å­—ã§ã™ã€‚", "S0\x8c0o0\"oW[g0Y0\x020", "UTF-16LE"}, - {"ã“ã‚Œã¯æ¼¢å­—ã§ã™ã€‚", "0S0\x8c0oo\"[W0g0Y0\x02", "UTF-16BE"}, - {"Hello, world", "Hello, world", "ASCII"}, - {"GdaÅ„sk", "Gda\xf1sk", "ISO-8859-2"}, - {"Ââ ÄŒÄ ÄÄ‘ ÅŠÅ‹ Õõ Å Å¡ Žž Ã…Ã¥ Ää", "\xc2\xe2 \xc8\xe8 \xa9\xb9 \xaf\xbf \xd5\xf5 \xaa\xba \xac\xbc \xc5\xe5 \xc4\xe4", "ISO-8859-10"}, - {"สำหรับ", "\xca\xd3\xcb\xc3\u047a", "ISO-8859-11"}, - {"latvieÅ¡u", "latvie\xf0u", "ISO-8859-13"}, - {"Seònaid", "Se\xf2naid", "ISO-8859-14"}, - {"€1 is cheap", "\xa41 is cheap", "ISO-8859-15"}, - {"româneÈ™te", "rom\xe2ne\xbate", "ISO-8859-16"}, - {"nutraĵo", "nutra\xbco", "ISO-8859-3"}, - {"Kalâdlit", "Kal\xe2dlit", "ISO-8859-4"}, - {"руÑÑкий", "\xe0\xe3\xe1\xe1\xda\xd8\xd9", "ISO-8859-5"}, - {"ελληνικά", "\xe5\xeb\xeb\xe7\xed\xe9\xea\xdc", "ISO-8859-7"}, - {"KaÄŸan", "Ka\xf0an", "ISO-8859-9"}, - {"Résumé", "R\x8esum\x8e", "macintosh"}, - {"GdaÅ„sk", "Gda\xf1sk", "windows-1250"}, - {"руÑÑкий", "\xf0\xf3\xf1\xf1\xea\xe8\xe9", "windows-1251"}, - {"Résumé", "R\xe9sum\xe9", "windows-1252"}, - {"ελληνικά", "\xe5\xeb\xeb\xe7\xed\xe9\xea\xdc", "windows-1253"}, - {"KaÄŸan", "Ka\xf0an", "windows-1254"}, - {"עִבְרִית", "\xf2\xc4\xe1\xc0\xf8\xc4\xe9\xfa", "windows-1255"}, - {"العربية", "\xc7\xe1\xda\xd1\xc8\xed\xc9", "windows-1256"}, - {"latvieÅ¡u", "latvie\xf0u", "windows-1257"}, - {"Việt", "Vi\xea\xf2t", "windows-1258"}, - {"สำหรับ", "\xca\xd3\xcb\xc3\u047a", "windows-874"}, - {"руÑÑкий", "\xd2\xd5\xd3\xd3\xcb\xc9\xca", "KOI8-R"}, - {"українÑька", "\xd5\xcb\xd2\xc1\xa7\xce\xd3\xd8\xcb\xc1", "KOI8-U"}, - {"Hello 常用國字標準字體表", "Hello \xb1`\xa5\u03b0\xea\xa6r\xbc\u0437\u01e6r\xc5\xe9\xaa\xed", "big5"}, - {"Hello 常用國字標準字體表", "Hello \xb3\xa3\xd3\xc3\x87\xf8\xd7\xd6\x98\xcb\x9c\xca\xd7\xd6\xf3\x77\xb1\xed", "gbk"}, - {"Hello 常用國字標準字體表", "Hello \xb3\xa3\xd3\xc3\x87\xf8\xd7\xd6\x98\xcb\x9c\xca\xd7\xd6\xf3\x77\xb1\xed", "gb18030"}, - {"עִבְרִית", "\x81\x30\xfb\x30\x81\x30\xf6\x34\x81\x30\xf9\x33\x81\x30\xf6\x30\x81\x30\xfb\x36\x81\x30\xf6\x34\x81\x30\xfa\x31\x81\x30\xfb\x38", "gb18030"}, - {"㧯", "\x82\x31\x89\x38", "gb18030"}, - {"ã“ã‚Œã¯æ¼¢å­—ã§ã™ã€‚", "\x82\xb1\x82\xea\x82\xcd\x8a\xbf\x8e\x9a\x82\xc5\x82\xb7\x81B", "SJIS"}, - {"Hello, 世界!", "Hello, \x90\xa2\x8aE!", "SJIS"}, - {"イウエオカ", "\xb2\xb3\xb4\xb5\xb6", "SJIS"}, - {"ã“ã‚Œã¯æ¼¢å­—ã§ã™ã€‚", "\xa4\xb3\xa4\xec\xa4\u03f4\xc1\xbb\xfa\xa4\u01e4\xb9\xa1\xa3", "EUC-JP"}, - {"Hello, 世界!", "Hello, \x1b$B@$3&\x1b(B!", "ISO-2022-JP"}, - {"다ìŒê³¼ ê°™ì€ ì¡°ê±´ì„ ë”°ë¼ì•¼ 합니다: 저작ìží‘œì‹œ", "\xb4\xd9\xc0\xbd\xb0\xfa \xb0\xb0\xc0\xba \xc1\xb6\xb0\xc7\xc0\xbb \xb5\xfb\xb6\xf3\xbe\xdf \xc7Õ´Ï´\xd9: \xc0\xfa\xc0\xdb\xc0\xdaÇ¥\xbd\xc3", "EUC-KR"}, -} - -func TestDecode(t *testing.T) { - testCases := append(testCases, []testCase{ - // Replace multi-byte maximum subpart of ill-formed subsequence with - // single replacement character (WhatWG requirement). - {"Rés\ufffdumé", "Rés\xe1\x80umé", "utf8"}, - }...) - for _, tc := range testCases { - e, _ := Lookup(tc.otherEncoding) - if e == nil { - t.Errorf("%s: not found", tc.otherEncoding) - continue - } - s, err := transformString(e.NewDecoder(), tc.other) - if err != nil { - t.Errorf("%s: decode %q: %v", tc.otherEncoding, tc.other, err) - continue - } - if s != tc.utf8 { - t.Errorf("%s: got %q, want %q", tc.otherEncoding, s, tc.utf8) - } - } -} - -func TestEncode(t *testing.T) { - testCases := append(testCases, []testCase{ - // Use Go-style replacement. - {"Rés\xe1\x80umé", "Rés\ufffd\ufffdumé", "utf8"}, - // U+0144 LATIN SMALL LETTER N WITH ACUTE not supported by encoding. - {"GdaÅ„sk", "Gdańsk", "ISO-8859-11"}, - {"\ufffd", "�", "ISO-8859-11"}, - {"a\xe1\x80b", "a��b", "ISO-8859-11"}, - }...) - for _, tc := range testCases { - e, _ := Lookup(tc.otherEncoding) - if e == nil { - t.Errorf("%s: not found", tc.otherEncoding) - continue - } - s, err := transformString(e.NewEncoder(), tc.utf8) - if err != nil { - t.Errorf("%s: encode %q: %s", tc.otherEncoding, tc.utf8, err) - continue - } - if s != tc.other { - t.Errorf("%s: got %q, want %q", tc.otherEncoding, s, tc.other) - } - } -} - -var sniffTestCases = []struct { - filename, declared, want string -}{ - {"HTTP-charset.html", "text/html; charset=iso-8859-15", "iso-8859-15"}, - {"UTF-16LE-BOM.html", "", "utf-16le"}, - {"UTF-16BE-BOM.html", "", "utf-16be"}, - {"meta-content-attribute.html", "text/html", "iso-8859-15"}, - {"meta-charset-attribute.html", "text/html", "iso-8859-15"}, - {"No-encoding-declaration.html", "text/html", "utf-8"}, - {"HTTP-vs-UTF-8-BOM.html", "text/html; charset=iso-8859-15", "utf-8"}, - {"HTTP-vs-meta-content.html", "text/html; charset=iso-8859-15", "iso-8859-15"}, - {"HTTP-vs-meta-charset.html", "text/html; charset=iso-8859-15", "iso-8859-15"}, - {"UTF-8-BOM-vs-meta-content.html", "text/html", "utf-8"}, - {"UTF-8-BOM-vs-meta-charset.html", "text/html", "utf-8"}, -} - -func TestSniff(t *testing.T) { - switch runtime.GOOS { - case "nacl": // platforms that don't permit direct file system access - t.Skipf("not supported on %q", runtime.GOOS) - } - - for _, tc := range sniffTestCases { - content, err := ioutil.ReadFile("testdata/" + tc.filename) - if err != nil { - t.Errorf("%s: error reading file: %v", tc.filename, err) - continue - } - - _, name, _ := DetermineEncoding(content, tc.declared) - if name != tc.want { - t.Errorf("%s: got %q, want %q", tc.filename, name, tc.want) - continue - } - } -} - -func TestReader(t *testing.T) { - switch runtime.GOOS { - case "nacl": // platforms that don't permit direct file system access - t.Skipf("not supported on %q", runtime.GOOS) - } - - for _, tc := range sniffTestCases { - content, err := ioutil.ReadFile("testdata/" + tc.filename) - if err != nil { - t.Errorf("%s: error reading file: %v", tc.filename, err) - continue - } - - r, err := NewReader(bytes.NewReader(content), tc.declared) - if err != nil { - t.Errorf("%s: error creating reader: %v", tc.filename, err) - continue - } - - got, err := ioutil.ReadAll(r) - if err != nil { - t.Errorf("%s: error reading from charset.NewReader: %v", tc.filename, err) - continue - } - - e, _ := Lookup(tc.want) - want, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader(content), e.NewDecoder())) - if err != nil { - t.Errorf("%s: error decoding with hard-coded charset name: %v", tc.filename, err) - continue - } - - if !bytes.Equal(got, want) { - t.Errorf("%s: got %q, want %q", tc.filename, got, want) - continue - } - } -} - -var metaTestCases = []struct { - meta, want string -}{ - {"", ""}, - {"text/html", ""}, - {"text/html; charset utf-8", ""}, - {"text/html; charset=latin-2", "latin-2"}, - {"text/html; charset; charset = utf-8", "utf-8"}, - {`charset="big5"`, "big5"}, - {"charset='shift_jis'", "shift_jis"}, -} - -func TestFromMeta(t *testing.T) { - for _, tc := range metaTestCases { - got := fromMetaElement(tc.meta) - if got != tc.want { - t.Errorf("%q: got %q, want %q", tc.meta, got, tc.want) - } - } -} - -func TestXML(t *testing.T) { - const s = "r\xe9sum\xe9" - - d := xml.NewDecoder(strings.NewReader(s)) - d.CharsetReader = NewReaderLabel - - var a struct { - Word string - } - err := d.Decode(&a) - if err != nil { - t.Fatalf("Decode: %v", err) - } - - want := "résumé" - if a.Word != want { - t.Errorf("got %q, want %q", a.Word, want) - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html deleted file mode 100644 index 9915fa0..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-charset.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - HTTP charset - - - - - - - - - - - -

HTTP charset

- - -
- - -
 
- - - - - -
-

The character encoding of a page can be set using the HTTP header charset declaration.

-

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

The only character encoding declaration for this HTML file is in the HTTP header, which sets the encoding to ISO 8859-15.

-
-
-
HTML5
-

the-input-byte-stream-001
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html deleted file mode 100644 index 26e5d8b..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-UTF-8-BOM.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - HTTP vs UTF-8 BOM - - - - - - - - - - - -

HTTP vs UTF-8 BOM

- - -
- - -
 
- - - - - -
-

A character encoding set in the HTTP header has lower precedence than the UTF-8 signature.

-

The HTTP header attempts to set the character encoding to ISO 8859-15. The page starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

If the test is unsuccessful, the characters  should appear at the top of the page. These represent the bytes that make up the UTF-8 signature when encountered in the ISO 8859-15 encoding.

-
-
-
HTML5
-

the-input-byte-stream-034
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html deleted file mode 100644 index 2f07e95..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-charset.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - HTTP vs meta charset - - - - - - - - - - - -

HTTP vs meta charset

- - -
- - -
 
- - - - - -
-

The HTTP header has a higher precedence than an encoding declaration in a meta charset attribute.

-

The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-1.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-018
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html deleted file mode 100644 index 6853cdd..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/HTTP-vs-meta-content.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - HTTP vs meta content - - - - - - - - - - - -

HTTP vs meta content

- - -
- - -
 
- - - - - -
-

The HTTP header has a higher precedence than an encoding declaration in a meta content attribute.

-

The HTTP header attempts to set the character encoding to ISO 8859-15. The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-1.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-016
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html deleted file mode 100644 index 612e26c..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/No-encoding-declaration.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - No encoding declaration - - - - - - - - - - - -

No encoding declaration

- - -
- - -
 
- - - - - -
-

A page with no encoding information in HTTP, BOM, XML declaration or meta element will be treated as UTF-8.

-

The test on this page contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-015
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/README b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/README deleted file mode 100644 index 38ef0f9..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/README +++ /dev/null @@ -1,9 +0,0 @@ -These test cases come from -http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics - -Distributed under both the W3C Test Suite License -(http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) -and the W3C 3-clause BSD License -(http://www.w3.org/Consortium/Legal/2008/03-bsd-license). -To contribute to a W3C Test Suite, see the policies and contribution -forms (http://www.w3.org/2004/10/27-testcases). diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html deleted file mode 100644 index 3abf7a9343c20518e57dfea58b374fb0f4fb58a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2670 zcmcJR?QRoS5Qc}JAoU&=BQ-(7b^;2j8i*i3RV1JlO@;VXIsPurV!WHiDdLW}i`*CO z^UnC>tih=KsVr;H&Y7?C&O3AV(?534uG?e##U9y_y|!QNi4``n+D>d{2lky^LnFNx z?9HrarH$>rwQR_$g)Hk0*&STI*EYq|47~&U9sfUB+ji})9eR{QqCUra7oDsZ5obtB zdxP%<)-$4Q;rSHJiM>U(#ZI=;?n^BC?Dp6lu=~_1-lnX3u03&2BlmQIY>L+!Uq7XoytKw^Q#oZSM?3*J?)&ojG&yzQRkC!Ml5JE?ax;lp_NYEcdUht`ZswOviB~L5hmJ|pXI71nn20w;>vG! zQGB$EE9&wC``&J#_Ym~PgRu-Bd>1!pOp0||k`kr=VJ zfH6I6rmRaeHA7U-A^OTsT+|d2a^i(>DePzZ{)ibXoCBvJnuYrd-3kkN$uy{qQK;=*Y;S87ro12aTgu^i*%f8zC3>a}9DIe4cfxOzsCw&(cqvP9{ud{N6f` z#TNDY(B6@Gpr|uN+%&x^XZjBHdc@2vsM(Tyc2=vshHQ5w+obmp>tuWT(t4BTUGAQw zxeI$UGSLUBg=WFbF;4f@4=^P2AgY@CFn8A`bcC=_&~)fiDe)#cUARRBzJ^k|%X)69 z+{Cb`wq}Rsg%B62CC_tK!AV(W{(MV?#mndR46CU#BUN<{8e?*oT+!pE5wF#O#TR#a z$9qRT)tpbw8zAI~QQJg2C3|6$I%(T(;`zOMy6SO+&;pG=c#2P|P-WZn$$DpWJlC3U z3*nvmz zwP{u~r$L?-m3uqp9I1+#3yE|3M$(s-BEtih=LQ>`qYoiktOop(wi%!;yh%+Rm z{e|xntY<{q!1F1Z6MKtngPm-p-4|H&+3m4AVE3_AyiHm6Tzlf4M(*ht*%YrezJ6kr zHGj45pc?64*$Cm%-zseWMA`x;)v*~jA=i}szqts9xmQkS`M11|(H7bTXAycsXU53+ zJ?120SRZeyiFjW7enPN`bxk$IaWV3o48oJF7D&2ysoY;6(s6%6vVfaYd&mC=erK!) zNGI^7upQgN)53OHe_VE<@J+G8*Y|p*)zB2Thdi}+YR<5QWHm!|a_*AoZXuv7)$xe| zm3Q$D7{|#}{m4X&UY!6(ZhyYi2(5JLzGE$H)W6BQklnjPMwn<Yvv7Z*TVWwD*=E3QpH37* z#lqXJA0A~J9T_<^W5smspmDg2p6ac5Bjn+~LAoow%1TCdZ*$K8`O zw_$HaCi+0N&@7la#_7KL5r$+QL{)Pi=I&aDjt~|Knht#`CEi4*3%97i_fSfASlwUz0=3V0GCxY}z81UC-nP=CGt2OqYV$ zoRCo+qM9YX*3FFORLC=E3B~S@+KROyk4r5 yX7?DaslDfIebqXgC!KKp4IYy+W~X?ddE6o=`A+x#x0AK&6MF#W&AXxbRrv+SX}PNa diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html deleted file mode 100644 index 83de433..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-charset.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - UTF-8 BOM vs meta charset - - - - - - - - - - - -

UTF-8 BOM vs meta charset

- - -
- - -
 
- - - - - -
-

A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta charset attribute declares a different encoding.

-

The page contains an encoding declaration in a meta charset attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-038
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html deleted file mode 100644 index 501aac2..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/UTF-8-BOM-vs-meta-content.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - UTF-8 BOM vs meta content - - - - - - - - - - - -

UTF-8 BOM vs meta content

- - -
- - -
 
- - - - - -
-

A page with a UTF-8 BOM will be recognized as UTF-8 even if the meta content attribute declares a different encoding.

-

The page contains an encoding declaration in a meta content attribute that attempts to set the character encoding to ISO 8859-15, but the file starts with a UTF-8 signature.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ýäè. This matches the sequence of bytes above when they are interpreted as UTF-8. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-037
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html deleted file mode 100644 index 2d7d25a..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-charset-attribute.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - meta charset attribute - - - - - - - - - - - -

meta charset attribute

- - -
- - -
 
- - - - - -
-

The character encoding of the page can be set by a meta element with charset attribute.

-

The only character encoding declaration for this HTML file is in the charset attribute of the meta element, which declares the encoding to be ISO 8859-15.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-009
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html b/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html deleted file mode 100644 index 1c3f228..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/charset/testdata/meta-content-attribute.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - meta content attribute - - - - - - - - - - - -

meta content attribute

- - -
- - -
 
- - - - - -
-

The character encoding of the page can be set by a meta element with http-equiv and content attributes.

-

The only character encoding declaration for this HTML file is in the content attribute of the meta element, which declares the encoding to be ISO 8859-15.

The test contains a div with a class name that contains the following sequence of bytes: 0xC3 0xBD 0xC3 0xA4 0xC3 0xA8. These represent different sequences of characters in ISO 8859-15, ISO 8859-1 and UTF-8. The external, UTF-8-encoded stylesheet contains a selector .test div.ÜÀÚ. This matches the sequence of bytes above when they are interpreted as ISO 8859-15. If the class name matches the selector then the test will pass.

-
-
-
HTML5
-

the-input-byte-stream-007
Result summary & related tests
Detailed results for this test
Link to spec

-
Assumptions:
  • The default encoding for the browser you are testing is not set to ISO 8859-15.
  • -
  • The test is read from a server that supports HTTP.
-
- - - - - - diff --git a/src/imagemagick/vendor/golang.org/x/net/html/entity_test.go b/src/imagemagick/vendor/golang.org/x/net/html/entity_test.go deleted file mode 100644 index b53f866..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/entity_test.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2010 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 html - -import ( - "testing" - "unicode/utf8" -) - -func TestEntityLength(t *testing.T) { - // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key). - // The +1 comes from the leading "&". This property implies that the length of - // unescaped text is <= the length of escaped text. - for k, v := range entity { - if 1+len(k) < utf8.RuneLen(v) { - t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v)) - } - if len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' { - t.Errorf("entity name %s is %d characters, but longestEntityWithoutSemicolon=%d", k, len(k), longestEntityWithoutSemicolon) - } - } - for k, v := range entity2 { - if 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) { - t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v[0]) + string(v[1])) - } - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/escape_test.go b/src/imagemagick/vendor/golang.org/x/net/html/escape_test.go deleted file mode 100644 index b405d4b..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/escape_test.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2013 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 html - -import "testing" - -type unescapeTest struct { - // A short description of the test case. - desc string - // The HTML text. - html string - // The unescaped text. - unescaped string -} - -var unescapeTests = []unescapeTest{ - // Handle no entities. - { - "copy", - "A\ttext\nstring", - "A\ttext\nstring", - }, - // Handle simple named entities. - { - "simple", - "& > <", - "& > <", - }, - // Handle hitting the end of the string. - { - "stringEnd", - "& &", - "& &", - }, - // Handle entities with two codepoints. - { - "multiCodepoint", - "text ⋛︀ blah", - "text \u22db\ufe00 blah", - }, - // Handle decimal numeric entities. - { - "decimalEntity", - "Delta = Δ ", - "Delta = Δ ", - }, - // Handle hexadecimal numeric entities. - { - "hexadecimalEntity", - "Lambda = λ = λ ", - "Lambda = λ = λ ", - }, - // Handle numeric early termination. - { - "numericEnds", - "&# &#x €43 © = ©f = ©", - "&# &#x €43 © = ©f = ©", - }, - // Handle numeric ISO-8859-1 entity replacements. - { - "numericReplacements", - "Footnote‡", - "Footnote‡", - }, -} - -func TestUnescape(t *testing.T) { - for _, tt := range unescapeTests { - unescaped := UnescapeString(tt.html) - if unescaped != tt.unescaped { - t.Errorf("TestUnescape %s: want %q, got %q", tt.desc, tt.unescaped, unescaped) - } - } -} - -func TestUnescapeEscape(t *testing.T) { - ss := []string{ - ``, - `abc def`, - `a & b`, - `a&b`, - `a & b`, - `"`, - `"`, - `"<&>"`, - `"<&>"`, - `3&5==1 && 0<1, "0<1", a+acute=á`, - `The special characters are: <, >, &, ' and "`, - } - for _, s := range ss { - if got := UnescapeString(EscapeString(s)); got != s { - t.Errorf("got %q want %q", got, s) - } - } -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/example_test.go b/src/imagemagick/vendor/golang.org/x/net/html/example_test.go deleted file mode 100644 index 0b06ed7..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2012 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. - -// This example demonstrates parsing HTML data and walking the resulting tree. -package html_test - -import ( - "fmt" - "log" - "strings" - - "golang.org/x/net/html" -) - -func ExampleParse() { - s := `

Links:

` - doc, err := html.Parse(strings.NewReader(s)) - if err != nil { - log.Fatal(err) - } - var f func(*html.Node) - f = func(n *html.Node) { - if n.Type == html.ElementNode && n.Data == "a" { - for _, a := range n.Attr { - if a.Key == "href" { - fmt.Println(a.Val) - break - } - } - } - for c := n.FirstChild; c != nil; c = c.NextSibling { - f(c) - } - } - f(doc) - // Output: - // foo - // /bar/baz -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/node_test.go b/src/imagemagick/vendor/golang.org/x/net/html/node_test.go deleted file mode 100644 index 471102f..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/node_test.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2010 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 html - -import ( - "fmt" -) - -// checkTreeConsistency checks that a node and its descendants are all -// consistent in their parent/child/sibling relationships. -func checkTreeConsistency(n *Node) error { - return checkTreeConsistency1(n, 0) -} - -func checkTreeConsistency1(n *Node, depth int) error { - if depth == 1e4 { - return fmt.Errorf("html: tree looks like it contains a cycle") - } - if err := checkNodeConsistency(n); err != nil { - return err - } - for c := n.FirstChild; c != nil; c = c.NextSibling { - if err := checkTreeConsistency1(c, depth+1); err != nil { - return err - } - } - return nil -} - -// checkNodeConsistency checks that a node's parent/child/sibling relationships -// are consistent. -func checkNodeConsistency(n *Node) error { - if n == nil { - return nil - } - - nParent := 0 - for p := n.Parent; p != nil; p = p.Parent { - nParent++ - if nParent == 1e4 { - return fmt.Errorf("html: parent list looks like an infinite loop") - } - } - - nForward := 0 - for c := n.FirstChild; c != nil; c = c.NextSibling { - nForward++ - if nForward == 1e6 { - return fmt.Errorf("html: forward list of children looks like an infinite loop") - } - if c.Parent != n { - return fmt.Errorf("html: inconsistent child/parent relationship") - } - } - - nBackward := 0 - for c := n.LastChild; c != nil; c = c.PrevSibling { - nBackward++ - if nBackward == 1e6 { - return fmt.Errorf("html: backward list of children looks like an infinite loop") - } - if c.Parent != n { - return fmt.Errorf("html: inconsistent child/parent relationship") - } - } - - if n.Parent != nil { - if n.Parent == n { - return fmt.Errorf("html: inconsistent parent relationship") - } - if n.Parent == n.FirstChild { - return fmt.Errorf("html: inconsistent parent/first relationship") - } - if n.Parent == n.LastChild { - return fmt.Errorf("html: inconsistent parent/last relationship") - } - if n.Parent == n.PrevSibling { - return fmt.Errorf("html: inconsistent parent/prev relationship") - } - if n.Parent == n.NextSibling { - return fmt.Errorf("html: inconsistent parent/next relationship") - } - - parentHasNAsAChild := false - for c := n.Parent.FirstChild; c != nil; c = c.NextSibling { - if c == n { - parentHasNAsAChild = true - break - } - } - if !parentHasNAsAChild { - return fmt.Errorf("html: inconsistent parent/child relationship") - } - } - - if n.PrevSibling != nil && n.PrevSibling.NextSibling != n { - return fmt.Errorf("html: inconsistent prev/next relationship") - } - if n.NextSibling != nil && n.NextSibling.PrevSibling != n { - return fmt.Errorf("html: inconsistent next/prev relationship") - } - - if (n.FirstChild == nil) != (n.LastChild == nil) { - return fmt.Errorf("html: inconsistent first/last relationship") - } - if n.FirstChild != nil && n.FirstChild == n.LastChild { - // We have a sole child. - if n.FirstChild.PrevSibling != nil || n.FirstChild.NextSibling != nil { - return fmt.Errorf("html: inconsistent sole child's sibling relationship") - } - } - - seen := map[*Node]bool{} - - var last *Node - for c := n.FirstChild; c != nil; c = c.NextSibling { - if seen[c] { - return fmt.Errorf("html: inconsistent repeated child") - } - seen[c] = true - last = c - } - if last != n.LastChild { - return fmt.Errorf("html: inconsistent last relationship") - } - - var first *Node - for c := n.LastChild; c != nil; c = c.PrevSibling { - if !seen[c] { - return fmt.Errorf("html: inconsistent missing child") - } - delete(seen, c) - first = c - } - if first != n.FirstChild { - return fmt.Errorf("html: inconsistent first relationship") - } - - if len(seen) != 0 { - return fmt.Errorf("html: inconsistent forwards/backwards child list") - } - - return nil -} diff --git a/src/imagemagick/vendor/golang.org/x/net/html/parse_test.go b/src/imagemagick/vendor/golang.org/x/net/html/parse_test.go deleted file mode 100644 index b16d69a..0000000 --- a/src/imagemagick/vendor/golang.org/x/net/html/parse_test.go +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright 2010 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 html - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "runtime" - "sort" - "strings" - "testing" - - "golang.org/x/net/html/atom" -) - -// readParseTest reads a single test case from r. -func readParseTest(r *bufio.Reader) (text, want, context string, err error) { - line, err := r.ReadSlice('\n') - if err != nil { - return "", "", "", err - } - var b []byte - - // Read the HTML. - if string(line) != "#data\n" { - return "", "", "", fmt.Errorf(`got %q want "#data\n"`, line) - } - for { - line, err = r.ReadSlice('\n') - if err != nil { - return "", "", "", err - } - if line[0] == '#' { - break - } - b = append(b, line...) - } - text = strings.TrimSuffix(string(b), "\n") - b = b[:0] - - // Skip the error list. - if string(line) != "#errors\n" { - return "", "", "", fmt.Errorf(`got %q want "#errors\n"`, line) - } - for { - line, err = r.ReadSlice('\n') - if err != nil { - return "", "", "", err - } - if line[0] == '#' { - break - } - } - - if string(line) == "#document-fragment\n" { - line, err = r.ReadSlice('\n') - if err != nil { - return "", "", "", err - } - context = strings.TrimSpace(string(line)) - line, err = r.ReadSlice('\n') - if err != nil { - return "", "", "", err - } - } - - // Read the dump of what the parse tree should be. - if string(line) != "#document\n" { - return "", "", "", fmt.Errorf(`got %q want "#document\n"`, line) - } - inQuote := false - for { - line, err = r.ReadSlice('\n') - if err != nil && err != io.EOF { - return "", "", "", err - } - trimmed := bytes.Trim(line, "| \n") - if len(trimmed) > 0 { - if line[0] == '|' && trimmed[0] == '"' { - inQuote = true - } - if trimmed[len(trimmed)-1] == '"' && !(line[0] == '|' && len(trimmed) == 1) { - inQuote = false - } - } - if len(line) == 0 || len(line) == 1 && line[0] == '\n' && !inQuote { - break - } - b = append(b, line...) - } - return text, string(b), context, nil -} - -func dumpIndent(w io.Writer, level int) { - io.WriteString(w, "| ") - for i := 0; i < level; i++ { - io.WriteString(w, " ") - } -} - -type sortedAttributes []Attribute - -func (a sortedAttributes) Len() int { - return len(a) -} - -func (a sortedAttributes) Less(i, j int) bool { - if a[i].Namespace != a[j].Namespace { - return a[i].Namespace < a[j].Namespace - } - return a[i].Key < a[j].Key -} - -func (a sortedAttributes) Swap(i, j int) { - a[i], a[j] = a[j], a[i] -} - -func dumpLevel(w io.Writer, n *Node, level int) error { - dumpIndent(w, level) - level++ - switch n.Type { - case ErrorNode: - return errors.New("unexpected ErrorNode") - case DocumentNode: - return errors.New("unexpected DocumentNode") - case ElementNode: - if n.Namespace != "" { - fmt.Fprintf(w, "<%s %s>", n.Namespace, n.Data) - } else { - fmt.Fprintf(w, "<%s>", n.Data) - } - attr := sortedAttributes(n.Attr) - sort.Sort(attr) - for _, a := range attr { - io.WriteString(w, "\n") - dumpIndent(w, level) - if a.Namespace != "" { - fmt.Fprintf(w, `%s %s="%s"`, a.Namespace, a.Key, a.Val) - } else { - fmt.Fprintf(w, `%s="%s"`, a.Key, a.Val) - } - } - if n.Namespace == "" && n.DataAtom == atom.Template { - io.WriteString(w, "\n") - dumpIndent(w, level) - level++ - io.WriteString(w, "content") - } - case TextNode: - fmt.Fprintf(w, `"%s"`, n.Data) - case CommentNode: - fmt.Fprintf(w, "", n.Data) - case DoctypeNode: - fmt.Fprintf(w, "") - case scopeMarkerNode: - return errors.New("unexpected scopeMarkerNode") - default: - return errors.New("unknown node type") - } - io.WriteString(w, "\n") - for c := n.FirstChild; c != nil; c = c.NextSibling { - if err := dumpLevel(w, c, level); err != nil { - return err - } - } - return nil -} - -func dump(n *Node) (string, error) { - if n == nil || n.FirstChild == nil { - return "", nil - } - var b bytes.Buffer - for c := n.FirstChild; c != nil; c = c.NextSibling { - if err := dumpLevel(&b, c, 0); err != nil { - return "", err - } - } - return b.String(), nil -} - -var testDataDirs = []string{"testdata/webkit/", "testdata/go/"} - -func TestParser(t *testing.T) { - for _, testDataDir := range testDataDirs { - testFiles, err := filepath.Glob(testDataDir + "*.dat") - if err != nil { - t.Fatal(err) - } - for _, tf := range testFiles { - f, err := os.Open(tf) - if err != nil { - t.Fatal(err) - } - defer f.Close() - r := bufio.NewReader(f) - - for i := 0; ; i++ { - text, want, context, err := readParseTest(r) - if err == io.EOF { - break - } - if err != nil { - t.Fatal(err) - } - - err = testParseCase(text, want, context) - - if err != nil { - t.Errorf("%s test #%d %q, %s", tf, i, text, err) - } - } - } - } -} - -// Issue 16318 -func TestParserWithoutScripting(t *testing.T) { - text := `

` - want := `| -| -|