Fixing tests.
This commit is contained in:
parent
0d90b26603
commit
78e8b38f50
@ -51,6 +51,10 @@ namespace Owl {
|
|||||||
GLib.FileUtils.set_contents (this.get_path (), content);
|
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 {
|
public void copy_contents (Owl.Path destination) throws GLib.Error {
|
||||||
if (!this.is_dir ()) {
|
if (!this.is_dir ()) {
|
||||||
GLib.critical ("Destination is not a directory at copy_contents.\n");
|
GLib.critical ("Destination is not a directory at copy_contents.\n");
|
||||||
@ -64,8 +68,7 @@ namespace Owl {
|
|||||||
if (!inner_file.is_dir ()) {
|
if (!inner_file.is_dir ()) {
|
||||||
var dest_file = destination.child(this.get_relative(inner_file));
|
var dest_file = destination.child(this.get_relative(inner_file));
|
||||||
dest_file.parent ().mkpath ();
|
dest_file.parent ().mkpath ();
|
||||||
inner_file.file.copy (dest_file.file, GLib.FileCopyFlags.OVERWRITE);
|
inner_file.copy(dest_file);
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (GLib.Error error) {
|
} catch (GLib.Error error) {
|
||||||
GLib.critical (error.message);
|
GLib.critical (error.message);
|
||||||
|
@ -105,7 +105,7 @@ int main (string[] args) {
|
|||||||
GLib.Test.add_func ("/test/owl/path-cwd", () => {
|
GLib.Test.add_func ("/test/owl/path-cwd", () => {
|
||||||
try {
|
try {
|
||||||
var cwd = Owl.Path.cwd ();
|
var cwd = Owl.Path.cwd ();
|
||||||
assert (cwd.child("src").exists ());
|
assert (cwd.child("owlpath.h").exists ());
|
||||||
} catch (GLib.Error error) {
|
} catch (GLib.Error error) {
|
||||||
GLib.Test.fail_printf ("%s\n", error.message);
|
GLib.Test.fail_printf ("%s\n", error.message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user