Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"finanalyst aka Richard Hainsworth"
],
"auth": "zef:finanalyst",
"depends": {
"depends": [{
"by-kernel.name": {
"macos": "MacOS::NativeLib:ver<0.0.5>:auth<zef:lizmat>",
"": ""
}
},
}],
"test-depends": [
"Test"
],
Expand Down Expand Up @@ -88,4 +88,4 @@
"gui"
],
"source-url": "git://github.com/finanalyst/GTK-Simple.git"
}
}
23 changes: 20 additions & 3 deletions t/02-export-subs.rakutest
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use v6.d;
use v6.*;
use Test;

plan *;

use GTK::Simple :subs;

if %*ENV<DISPLAY> or $*DISTRO.is-win {
my Str @issues;

# We need to create app first
my $app;
lives-ok { $app = app }, "There is a subroutine in scope called 'app'";
Expand All @@ -22,10 +24,25 @@ if %*ENV<DISPLAY> or $*DISTRO.is-win {
next if skip-test($sub-name);

my $widget;
lives-ok { $widget = ::{$sub-name}(:label("For Button(s)"), :uri("For LinkButton"), :path("/for/image.png")) },
"There is a subroutine in scope called '$sub-name'";
lives-ok {
$widget =
::{$sub-name}(:label("For Button(s)"),
:uri("For LinkButton"),
:path("/for/image.png"));

CATCH {
@issues.push: "Missing required named argument for '$sub-name' ({$class.^name}) in test constructor";
}
}, "There is a subroutine in scope called '$sub-name'";

ok $widget ~~ $class, "'$sub-name' returns a { $class.^name } object";
}

if @issues {
diag "+++ ISSUES WITH EXPORT SUB TEST HARNESS +++";
diag @issues.join("\n");
diag "+++++++++++++++++++++++++++++++++++++++++++";
}
}

done-testing;