App-Test-Generator

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

      methods (Pass 3)
    - App::Test::Generator: added relationships_code emission so schemas
      containing relationship metadata produced by SchemaExtractor are
      serialised into the generated test file
    - Template test.tt: added semantic type test cases for filepath
      (including Windows paths, reserved device names, UNC paths),
      email, date_string, and iso8601_string; added relationship test
      loop covering all six relationship types (mutually_exclusive,
      required_group, conditional_requirement, dependency,
      value_constraint, value_conditional); added float edge cases for
      Inf, -Inf, and NaN with correct status handling based on whether
      max is defined

0.32	Sun Apr 12 08:16:47 EDT 2026

    - Added detect_scattered_failures() root cause detector. Surfaces a
      weak-confidence advisory when failures and passes coexist across
      2 or more common Perl series with no detectable version cliff or
      OS pattern, suggesting flaky tests, optional dependency
      differences, or CGI environment assumptions rather than a
      compatibility issue. Complements detect_universal_failure() which

README.md  view on Meta::CPAN


Values can be strings or numbers; strings will be properly quoted.
Note that this only works with routines that take named parameters.

### `%type_edge_cases`

An optional hash mapping types to arrayrefs of extra values to try for any field of that type:

        type_edge_cases:
                string: [ '', ' ', "\t", "\n", "\0", 'long' x 1024, chr(0x1F600) ]
                number: [ 0, 1.0, -1.0, 1e308, -1e308, 1e-308, -1e-308, 'NaN', 'Infinity' ]
                integer: [ 0, 1, -1, 2**31-1, -(2**31), 2**63-1, -(2**63) ]

### `%edge_case_array`

Specify edge case values for routines that accept a single unnamed parameter.
This is specifically designed for simple functions that take one argument without a parameter name.
These edge cases supplement the normal random string generation, ensuring specific problematic values are always tested.
During fuzzing iterations, there's a 40% probability that a test case will use a value from edge\_case\_array instead of randomly generated data.

    ---

lib/App/Test/Generator.pm  view on Meta::CPAN


Values can be strings or numbers; strings will be properly quoted.
Note that this only works with routines that take named parameters.

=head3 C<%type_edge_cases>

An optional hash mapping types to arrayrefs of extra values to try for any field of that type:

	type_edge_cases:
		string: [ '', ' ', "\t", "\n", "\0", 'long' x 1024, chr(0x1F600) ]
		number: [ 0, 1.0, -1.0, 1e308, -1e308, 1e-308, -1e-308, 'NaN', 'Infinity' ]
		integer: [ 0, 1, -1, 2**31-1, -(2**31), 2**63-1, -(2**63) ]

=head3 C<%edge_case_array>

Specify edge case values for routines that accept a single unnamed parameter.
This is specifically designed for simple functions that take one argument without a parameter name.
These edge cases supplement the normal random string generation, ensuring specific problematic values are always tested.
During fuzzing iterations, there's a 40% probability that a test case will use a value from edge_case_array instead of randomly generated data.

  ---

lib/App/Test/Generator/Template.pm  view on Meta::CPAN

	if((!defined $spec->{min}) || ($spec->{min} <= 43.56)) {
		push @cases, { %{$mandatory_args}, ( $arg_name => 43.56 ) };
	}

	[% IF module %]
		# Send wrong data type - builtins aren't good at checking this
		push @cases,
			{ %{$mandatory_args}, ( $arg_name => "test string in float field $arg_name", _STATUS => 'DIES', _LINE => __LINE__ ) },
			{ %{$mandatory_args}, ( $arg_name => {}, _STATUS => 'DIES', _LINE => __LINE__ ) },
			{ %{$mandatory_args}, ( $arg_name => \42.1, _STATUS => 'DIES' ) },	# Scalar ref
			# NaN and Inf are valid according to looks_like_number() so we
			# cannot assume they die
			# { %{$mandatory_args}, ( $arg_name => "NaN", _STATUS => 'DIES' ) },
			{ %{$mandatory_args}, ( $arg_name => [], _STATUS => 'DIES', _LINE => __LINE__ ) };
	[% END %]

	# min/max numeric boundaries
	if (defined $spec->{min}) {
		my $min = $spec->{min};
		push @cases,
			{ %{$mandatory_args}, ( $arg_name => $min - 0.001, _STATUS => 'DIES' ) },
			{ %{$mandatory_args}, ( $arg_name => $min, _LINE => __LINE__ ) },	# border
			{ %{$mandatory_args}, ( $arg_name => $min + 0.001 ) };	# just inside



( run in 0.806 second using v1.01-cache-2.11-cpan-39bf76dae61 )