### ----------------------------------------------------
### -- IO::Notification::Recursive
### -- Licenses: Artistic-2.0
### -- Authors: Jonathan Scott Duff
### -- File: t/01-basic.rakutest
### ----------------------------------------------------
use Test;
use IO::Notification::Recursive;

plan 1;

my $dir := $*TMPDIR.child("IONR");
mkdir $dir;
my $file := $dir.child("test-file");

watch-recursive($dir).tap: {
    state $seen;
    if .path eq $file {
        pass "we saw the change on $file"
          unless $seen++;
    }
}

sleep 2;  # give it a little time
$file.spurt: "stuff";
sleep 2;  # give it a little time again

END {
    .unlink with $file;
    .rmdir  with $dir;
}

# vim: expandtab shiftwidth=4


