---
name: "Test::Data::Array"
section: "3pm"
platform: "linux"
package: "libtest-data-perl"
version: "1.248-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test::Data::Array"
---

# Test::Data::Array(3pm)

## NAME

Test::Data::Array -- test functions for array variables

## SYNOPSIS

use Test::Data qw(Array);

## DESCRIPTION

### Functions

- array\_any\_ok( ITEM, ARRAY \[, NAME\] )

  Ok if any element of ARRAY is ITEM.

- array\_none\_ok( ITEM, ARRAY \[, NAME\] )

  Ok if no element of ARRAY is ITEM.

- array\_once\_ok( ITEM, ARRAY \[, NAME\] )

  Ok if only one element of ARRAY is ITEM.

- array\_multiple\_ok( ITEM, ARRAY \[, NAME\] )

  Ok if more than one element of ARRAY is ITEM.

- array\_max\_ok( NUMBER, ARRAY \[, NAME\] )

  Ok if all elements of ARRAY are numerically less than or equal to NUMBER.

- array\_min\_ok( NUMBER, ARRAY \[, NAME\] )

  Ok if all elements of ARRAY are numerically greater than or equal to NUMBER.

- array\_maxstr\_ok( ITEM, ARRAY \[, NAME\] )

  Ok if all elements of ARRAY are asciibetically less than or equal to MAX.

- array\_minstr\_ok( ITEM, ARRAY \[, NAME\] )

  Ok if all elements of ARRAY are asciibetically greater than or equal to MAX.

- array\_sum\_ok( SUM, ARRAY \[, NAME\] )

  Ok if the numerical sum of ARRAY is SUM.

- array\_empty\_ok( ARRAY \[, NAME\] )

  Ok if the array contains no elements.

- array\_length\_ok( ARRAY, LENGTH \[, NAME\] )

  Ok if the array contains LENGTH number of elements.

- array\_sortedstr\_ascending\_ok( ARRAY, \[, NAME\] )

  Ok if each succeeding element is asciibetically greater than or equal to the one before.

- array\_sortedstr\_descending\_ok( ARRAY, \[, NAME\] )

  Ok if each succeeding element is asciibetically less than or equal to the one before.

- array\_sorted\_ascending\_ok( ARRAY, \[, NAME\] )

  Ok if each succeeding element is numerically greater than or equal to the one before.

- array\_sorted\_descending\_ok( ARRAY, \[, NAME\] )

  Ok if each succeeding element is numerically less than or equal to the one before.

## SEE ALSO

Test::Data, Test::Data::Scalar, Test::Data::Function, Test::Data::Hash, Test::Builder

## SOURCE AVAILABILITY

This source is in Github:

```
        https://github.com/briandfoy/test-data
```

## AUTHOR

brian d foy, `"<briandfoy@pobox.com>"`

## COPYRIGHT AND LICENSE

Copyright © 2002-2025, brian d foy \<briandfoy@pobox.com\>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
