Fixing tests.

This commit is contained in:
sergiotarxz 2022-07-09 11:19:04 +02:00
parent 0d90b26603
commit 78e8b38f50
2 changed files with 6 additions and 3 deletions

View File

@ -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);

View File

@ -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);
}