From 0931211f09ae1ab802fcd56b6f6d81ba51cd2044 Mon Sep 17 00:00:00 2001 From: Slaven Rezic Date: Sun, 5 Nov 2023 16:14:40 +0100 Subject: [PATCH] check for existence of None and ControlMask in Tk::X (GH #87) --- t/X.t | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/t/X.t b/t/X.t index 398058e5..d1692e38 100644 --- a/t/X.t +++ b/t/X.t @@ -1,20 +1,12 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' +use strict; +use warnings; -######################### We start with some black magic to print on failure. +use Scalar::Util qw(looks_like_number); +use Test::More qw(no_plan); -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) - -BEGIN { $| = 1; print "1..1\n"; } -END {print "not ok 1\n" unless $loaded;} -use Tk::X; -$loaded = 1; -print "ok 1\n"; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): +use_ok 'Tk::X'; +if ($^O =~ m{^(MSWin32|linux|freebsd)$}) { + ok looks_like_number Tk::X::None(), 'None is defined and a number'; + ok looks_like_number Tk::X::ControlMask(), 'ControlMask is defined and a number'; +}