{"id":18981392,"url":"https://github.com/awncorp/test-ability","last_synced_at":"2026-06-19T06:31:57.482Z","repository":{"id":56839149,"uuid":"254217530","full_name":"awncorp/test-ability","owner":"awncorp","description":"Property-Based Testing for Perl 5","archived":false,"fork":false,"pushed_at":"2020-04-19T13:23:58.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-11T06:23:19.609Z","etag":null,"topics":["automation","perl","perl5","property-based-testing","testing"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Test::Ability","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awncorp.png","metadata":{"files":{"readme":"README","changelog":"CHANGES","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-08T22:46:39.000Z","updated_at":"2022-07-24T21:01:33.000Z","dependencies_parsed_at":"2022-08-29T04:52:49.072Z","dependency_job_id":null,"html_url":"https://github.com/awncorp/test-ability","commit_stats":null,"previous_names":["iamalnewkirk/test-ability"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/awncorp/test-ability","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awncorp%2Ftest-ability","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awncorp%2Ftest-ability/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awncorp%2Ftest-ability/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awncorp%2Ftest-ability/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awncorp","download_url":"https://codeload.github.com/awncorp/test-ability/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awncorp%2Ftest-ability/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34520431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","perl","perl5","property-based-testing","testing"],"created_at":"2024-11-08T16:09:43.345Z","updated_at":"2026-06-19T06:31:57.463Z","avatar_url":"https://github.com/awncorp.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n\n    Test::Ability\n\nABSTRACT\n\n    Property-Based Testing for Perl 5\n\nSYNOPSIS\n\n      package main;\n    \n      use Test::Ability;\n    \n      my $t = Test::Ability-\u003enew;\n\nDESCRIPTION\n\n    This package provides methods for generating values and test-cases,\n    providing a framework for performing property-based testing.\n\nINTEGRATES\n\n    This package integrates behaviors from:\n\n    Data::Object::Role::Buildable\n\n    Data::Object::Role::Stashable\n\nLIBRARIES\n\n    This package uses type constraints from:\n\n    Types::Standard\n\nSCENARIOS\n\n    This package supports the following scenarios:\n\n stash\n\n      # given: synopsis\n    \n      $t-\u003estash(direction =\u003e sub {\n        my ($self) = @_;\n    \n        {\n          move =\u003e ('forward', 'reverse')[rand(1)],\n          time =\u003e time\n        }\n      });\n\n    The package provides a stash object for default and user-defined value\n    generators. You can easily extend the default generators by adding your\n    own. Once defined, custom generators can be specified in the gen-spec\n    (generator specification) arrayref provided to the test method (and\n    others).\n\nATTRIBUTES\n\n    This package has the following attributes:\n\n arguments\n\n      arguments(ArrayRef)\n\n    This attribute is read-only, accepts (ArrayRef) values, and is\n    optional.\n\n invocant\n\n      invocant(Object)\n\n    This attribute is read-only, accepts (Object) values, and is optional.\n\nMETHODS\n\n    This package implements the following methods:\n\n array\n\n      array(Maybe[Int] $min, Maybe[Int] $max) : ArrayRef\n\n    The array method returns a random array reference.\n\n    array example #1\n\n        # given: synopsis\n      \n        $t-\u003earray;\n\n array_object\n\n      array_object(Maybe[Int] $min, Maybe[Int] $max) : Object\n\n    The array_object method returns a random array object.\n\n    array_object example #1\n\n        # given: synopsis\n      \n        $t-\u003earray_object;\n\n choose\n\n      choose(ArrayRef[ArrayRef] $args) : Any\n\n    The choose method returns a random value from the set of specified\n    generators.\n\n    choose example #1\n\n        # given: synopsis\n      \n        $t-\u003echoose([['datetime'], ['words', [2,3]]]);\n\n code\n\n      code(Maybe[Int] $min, Maybe[Int] $max) : CodeRef\n\n    The code method returns a random code reference.\n\n    code example #1\n\n        # given: synopsis\n      \n        $t-\u003ecode;\n\n code_object\n\n      code_object(Maybe[Int] $min, Maybe[Int] $max) : Object\n\n    The code_object method returns a random code object.\n\n    code_object example #1\n\n        # given: synopsis\n      \n        $t-\u003ecode_object;\n\n date\n\n      date(Maybe[Str] $min, Maybe[Str] $max) : Str\n\n    The date method returns a random date.\n\n    date example #1\n\n        # given: synopsis\n      \n        $t-\u003edate;\n\n datetime\n\n      datetime(Maybe[Str] $min, Maybe[Str] $max) : Str\n\n    The datetime method returns a random date and time.\n\n    datetime example #1\n\n        # given: synopsis\n      \n        $t-\u003edatetime;\n\n hash\n\n      hash(Maybe[Int] $min, Maybe[Int] $max) : HashRef\n\n    The hash method returns a random hash reference.\n\n    hash example #1\n\n        # given: synopsis\n      \n        $t-\u003ehash;\n\n hash_object\n\n      hash_object(Maybe[Int] $min, Maybe[Int] $max) : Object\n\n    The hash_object method returns a random hash object.\n\n    hash_object example #1\n\n        # given: synopsis\n      \n        $t-\u003ehash_object;\n\n maybe\n\n      maybe(ArrayRef[ArrayRef] $args) : Any\n\n    The maybe method returns a random choice using the choose method, or\n    the undefined value.\n\n    maybe example #1\n\n        # given: synopsis\n      \n        $t-\u003emaybe([['date'], ['time']]);\n\n number\n\n      number(Maybe[Int] $min, Maybe[Int] $max) : Int\n\n    The number method returns a random number.\n\n    number example #1\n\n        # given: synopsis\n      \n        $t-\u003enumber;\n\n number_object\n\n      number_object(Maybe[Int] $min, Maybe[Int] $max) : Object\n\n    The number_object method returns a random number object.\n\n    number_object example #1\n\n        # given: synopsis\n      \n        $t-\u003enumber_object;\n\n object\n\n      object() : Object\n\n    The object method returns a random object.\n\n    object example #1\n\n        # given: synopsis\n      \n        $t-\u003eobject;\n\n regexp\n\n      regexp(Maybe[Str] $exp) : RegexpRef\n\n    The regexp method returns a random regexp.\n\n    regexp example #1\n\n        # given: synopsis\n      \n        $t-\u003eregexp;\n\n regexp_object\n\n      regexp_object(Maybe[Str] $exp) : Object\n\n    The regexp_object method returns a random regexp object.\n\n    regexp_object example #1\n\n        # given: synopsis\n      \n        $t-\u003eregexp_object;\n\n scalar\n\n      scalar(Maybe[Int] $min, Maybe[Int] $max) : Ref\n\n    The scalar method returns a random scalar reference.\n\n    scalar example #1\n\n        # given: synopsis\n      \n        $t-\u003escalar;\n\n scalar_object\n\n      scalar_object(Maybe[Int] $min, Maybe[Int] $max) : Object\n\n    The scalar_object method returns a random scalar object.\n\n    scalar_object example #1\n\n        # given: synopsis\n      \n        $t-\u003escalar_object;\n\n string\n\n      string(Maybe[Int] $min, Maybe[Int] $max) : Str\n\n    The string method returns a random string.\n\n    string example #1\n\n        # given: synopsis\n      \n        $t-\u003estring;\n\n string_object\n\n      string_object(Maybe[Int] $min, Maybe[Int] $max) : Object\n\n    The string_object method returns a random string object.\n\n    string_object example #1\n\n        # given: synopsis\n      \n        $t-\u003estring_object;\n\n test\n\n      test(Str $name, Int $cycles, ArrayRef[ArrayRef] $spec, CodeRef $callback) : Undef\n\n    The test method generates subtests using \"subtest\" in Test::More,\n    optionally generating and passing random values to each iteration as\n    well as a Data::Object::Try object for easy execution of callbacks and\n    interception of exceptions. This callback expected should have the\n    signature ($tryable, @arguments) where @arguments gets assigned the\n    generated values in the order specified. The callback must return the\n    $tryable object, which is called for you automatically, executing the\n    subtest logic you've implemented.\n\n    test example #1\n\n        # given: synopsis\n      \n        # use Test::More;\n      \n        sub is_an_adult {\n          my ($age) = @_;\n      \n          $age \u003e= 18;\n        }\n      \n        $t-\u003etest('is_an_adult', 100, [['number', [10, 30]]], sub {\n          my ($tryable, $age) = @_;\n      \n          $tryable-\u003ecall(sub {\n            if ($age \u003e= 18) {\n              ok is_an_adult($age),\n                \"age is $age, is an adult\";\n            }\n            else {\n              ok !is_an_adult($age),\n                \"age is $age, is not an adult\";\n            }\n          });\n      \n          $tryable\n        });\n\n time\n\n      time(Maybe[Str] $min, Maybe[Str] $max) : Str\n\n    The time method returns a random time.\n\n    time example #1\n\n        # given: synopsis\n      \n        $t-\u003etime;\n\n undef\n\n      undef() : Undef\n\n    The undef method returns the undefined value.\n\n    undef example #1\n\n        # given: synopsis\n      \n        $t-\u003eundef;\n\n undef_object\n\n      undef_object() : Object\n\n    The undef_object method returns the undefined value as an object.\n\n    undef_object example #1\n\n        # given: synopsis\n      \n        $t-\u003eundef_object;\n\n word\n\n      word() : Str\n\n    The word method returns a random word.\n\n    word example #1\n\n        # given: synopsis\n      \n        $t-\u003eword;\n\n words\n\n      words(Maybe[Int] $min, Maybe[Int] $max) : Str\n\n    The words method returns random words.\n\n    words example #1\n\n        # given: synopsis\n      \n        $t-\u003ewords;\n\nAUTHOR\n\n    Al Newkirk, awncorp@cpan.org\n\nLICENSE\n\n    Copyright (C) 2011-2019, Al Newkirk, et al.\n\n    This is free software; you can redistribute it and/or modify it under\n    the terms of the The Apache License, Version 2.0, as elucidated in the\n    \"license file\"\n    \u003chttps://github.com/iamalnewkirk/foobar/blob/master/LICENSE\u003e.\n\nPROJECT\n\n    Wiki \u003chttps://github.com/iamalnewkirk/foobar/wiki\u003e\n\n    Project \u003chttps://github.com/iamalnewkirk/foobar\u003e\n\n    Initiatives \u003chttps://github.com/iamalnewkirk/foobar/projects\u003e\n\n    Milestones \u003chttps://github.com/iamalnewkirk/foobar/milestones\u003e\n\n    Contributing\n    \u003chttps://github.com/iamalnewkirk/foobar/blob/master/CONTRIBUTE.md\u003e\n\n    Issues \u003chttps://github.com/iamalnewkirk/foobar/issues\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawncorp%2Ftest-ability","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawncorp%2Ftest-ability","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawncorp%2Ftest-ability/lists"}