GitXplorerGitXplorer
i

test-more-bash

public
15 stars
6 forks
0 issues

Commits

List of commits on branch master.
Unverified
c7df24fcb0814fbb62a33d92dc3c8d526ff710f0

Release 0.0.5

iingydotnet committed 4 years ago
Unverified
e691d4de12ef006cc97337ab448be931f4a3512a

Add docker testing for all bash versions

iingydotnet committed 4 years ago
Unverified
d3f0d6a0832aaeb0c7884960e03df3bb06d9e77d

Refactor to modern bash

iingydotnet committed 4 years ago
Unverified
14c34b7ac904b6cdd3b967c7029a5bf5111907cf

git subrepo pull ext/test-tap-bash

iingydotnet committed 4 years ago
Unverified
c169175de66d8cf857a7bcf05551a6f3c844f275

git subrepo pull ext/bashplus

iingydotnet committed 4 years ago
Unverified
5c6764651bdad1379a08bfbdcec406cac5cc7dca

0.0.4 release

iingydotnet committed 4 years ago

README

The README file for this repository.

=pod

=for comment DO NOT EDIT. This Pod was generated by Swim v0.1.48. See http://github.com/ingydotnet/swim-pm#readme

=encoding utf8

=head1 Name

Test::More - TAP Testing for Bash

=for html test-more-bash

=head1 Synopsis

Write a test file like this. Maybe call it C<test/test.t>:

#!/usr/bin/env bash

TEST_MORE_PATH="/path/to/test-more-bash"
BASHLIB="`
    find $TEST_MORE_PATH -type d |
    grep -E '/(bin|lib)$' |
    xargs -n1 printf "%s:"`"
PATH="$BASHLIB$PATH"

source bash+ :std

use Test::More

plan tests 8

some-command
ok $? 'some-command is ok'

# or:
ok "`some-command`" 'some-command is ok'

pass 'This will always pass'

fail 'This will always fail'

is `echo foo` 'foo' 'foo is foo'

isnt foo bar "foo isn't bar"

like food foo 'food is like foo'

unlike team I "There's no 'I' in 'team'"

diag "A message for stderr"

note "A message for stdout"

output=( $(ls) )
expected=(README lib bin)
cmp-array output expected "list files"

Run the test with C like this:

prove test/test.t

Prove knows it's Bash from the first line (the hashbang), and it just works.

=head1 Description

Test::More is the tried and true testing library for Perl. It uses TAP (the Test Anything Protocol). This is the same thing for Bash. For the most part it should work exactly the same.

=head1 Methods

This is the basic usage:

=over

=item * C<plan tests $count>

=item * C<ok $status_code "$label">

=item * C<pass "$label">

=item * C<fail "$label">

=item * C<is "$got" "$want" "label">

=item * C<isnt "$got" "$unwanted" "$label">

=item * C<like "$got" "$regex" "$label">

=item * C<unlike "$got" "$regex" "$label">

=item * C<diag "$message">

=item * C<note "$message">

=item * C<done_testing $count>

=item * C<plan skip_all "$reason">

=item * C<BAIL_OUT "$reason">

=item * `cmp-array output expected "message"

=back

More detailed info coming soon.

=head1 Author

Ingy döt Net ingy@ingy.net

=head1 Copyright & License

Copyright 2013-2020. Ingy döt Net.

The MIT License (MIT)

=cut