File: PangoTestHelper.pm

package info (click to toggle)
libpango-perl 1.227-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 572 kB
  • sloc: perl: 1,116; ansic: 35; makefile: 9
file content (35 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package PangoTestHelper;

use Test::More;

my $REQ_GTK2_VERSION = 1.220;

sub import {
  my $class = shift;
  my %options = @_;

  if ($options{need_gtk}) {
    unless (eval "use Gtk2 $REQ_GTK2_VERSION; Gtk2->init_check;") {
      plan skip_all =>
        "This test needs Gtk2 >= $REQ_GTK2_VERSION and a display";
    }
  }

  if (exists $options{tests}) {
    plan tests => $options{tests};
  }
}

package main;

use Glib qw/TRUE FALSE/;
use Pango;
use Test::More;

# Inspired by Test::Number::Delta
sub delta_ok ($$;$) {
	my ($a, $b, $msg) = @_;
	ok (abs ($a - $b) < 1e-6, $msg);
}

1;