From 78e8b38f501bbf7554579f83f90b6ae9f9b32c37 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Sat, 9 Jul 2022 11:19:04 +0200 Subject: [PATCH] Fixing tests. --- src/owlpath.vala | 7 +++++-- test/00-owlpath.test.vala | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/owlpath.vala b/src/owlpath.vala index 75bf579..077352c 100644 --- a/src/owlpath.vala +++ b/src/owlpath.vala @@ -51,6 +51,10 @@ namespace Owl { GLib.FileUtils.set_contents (this.get_path (), content); } + public void copy (Owl.Path destination) throws GLib.Error { + this.file.copy (destination.file, GLib.FileCopyFlags.OVERWRITE); + } + public void copy_contents (Owl.Path destination) throws GLib.Error { if (!this.is_dir ()) { GLib.critical ("Destination is not a directory at copy_contents.\n"); @@ -64,8 +68,7 @@ namespace Owl { if (!inner_file.is_dir ()) { var dest_file = destination.child(this.get_relative(inner_file)); dest_file.parent ().mkpath (); - inner_file.file.copy (dest_file.file, GLib.FileCopyFlags.OVERWRITE); - + inner_file.copy(dest_file); } } catch (GLib.Error error) { GLib.critical (error.message); diff --git a/test/00-owlpath.test.vala b/test/00-owlpath.test.vala index 1a270d7..291915d 100644 --- a/test/00-owlpath.test.vala +++ b/test/00-owlpath.test.vala @@ -105,7 +105,7 @@ int main (string[] args) { GLib.Test.add_func ("/test/owl/path-cwd", () => { try { var cwd = Owl.Path.cwd (); - assert (cwd.child("src").exists ()); + assert (cwd.child("owlpath.h").exists ()); } catch (GLib.Error error) { GLib.Test.fail_printf ("%s\n", error.message); }