### ----------------------------------------------------
### -- Gnome::Gio
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: t/FileIcon.rakutest
### ----------------------------------------------------
use v6;
use NativeCall;
use Test;

use Gnome::Gio::File:api<1>;
use Gnome::Gio::FileIcon:api<1>;

#use Gnome::N::X:api<1>;
#Gnome::N::debug(:on);

#-------------------------------------------------------------------------------
my Gnome::Gio::File $f .= new(:path<LICENSE>);
my Gnome::Gio::File() $f2;
my Gnome::Gio::FileIcon $fi;

#-------------------------------------------------------------------------------
subtest 'ISA test', {
  $fi .= new(:file($f));
  isa-ok $fi, Gnome::Gio::FileIcon, '.new(:file)';
}


#-------------------------------------------------------------------------------
# set environment variable 'raku-test-all' if rest must be tested too.
unless %*ENV<raku_test_all>:exists {
  done-testing;
  exit;
}

#-------------------------------------------------------------------------------
subtest 'Manipulations', {
  like my Str $fstring = $fi.to-string, / 'LICENSE' /, '.to-string()';

  my Gnome::Gio::FileIcon $fi2 .= new(:string($fstring));
  ok $fi2.equal($fi), '.new(:string)';

  $f2 = $fi.get-file;
  is $f2.get-basename, 'LICENSE', '.get-file()';
}

#-------------------------------------------------------------------------------
done-testing;
=finish


