From 77c9b5518299ee401e95cb81aaf18a27900341c8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 27 Jul 2016 18:07:05 -0400 Subject: Add unit tests for Copy --- src/server/events/Copy.cpp | 2 +- tests/copy_node.ttl | 16 ++++++++++++++++ tests/load_graph.ttl | 8 ++++++++ tests/save_graph.ttl | 8 ++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/copy_node.ttl create mode 100644 tests/load_graph.ttl create mode 100644 tests/save_graph.ttl diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp index e0438c9d..eed68d75 100644 --- a/src/server/events/Copy.cpp +++ b/src/server/events/Copy.cpp @@ -97,7 +97,7 @@ Copy::engine_to_engine() return Event::pre_process_done(Status::BAD_REQUEST); } - // Ensure the new node doesn't already exists + // Ensure the new node doesn't already exist if (_engine.store()->find(new_path) != _engine.store()->end()) { return Event::pre_process_done(Status::EXISTS, new_path); } diff --git a/tests/copy_node.ttl b/tests/copy_node.ttl new file mode 100644 index 00000000..7204f44b --- /dev/null +++ b/tests/copy_node.ttl @@ -0,0 +1,16 @@ +@prefix lv2: . +@prefix patch: . +@prefix ingen: . + + + a patch:Put ; + patch:subject ; + patch:body [ + a ingen:Block ; + lv2:prototype + ] . + + + a patch:Copy ; + patch:subject ; + patch:destination . diff --git a/tests/load_graph.ttl b/tests/load_graph.ttl new file mode 100644 index 00000000..4d21cae8 --- /dev/null +++ b/tests/load_graph.ttl @@ -0,0 +1,8 @@ +@prefix lv2: . +@prefix patch: . +@prefix ingen: . + + + a patch:Copy ; + patch:subject ; + patch:destination . diff --git a/tests/save_graph.ttl b/tests/save_graph.ttl new file mode 100644 index 00000000..840c4950 --- /dev/null +++ b/tests/save_graph.ttl @@ -0,0 +1,8 @@ +@prefix lv2: . +@prefix patch: . +@prefix ingen: . + + + a patch:Copy ; + patch:subject ; + patch:destination . -- cgit v1.2.1