From 781514e1c7f1fece3e4fee12e21815ebcab18f71 Mon Sep 17 00:00:00 2001
From: Guus Sliepen <guus@meshlink.io>
Date: Sun, 23 Feb 2020 01:47:11 +0100
Subject: [PATCH] Check that importing the same data twice is fine, but
 importing garbage is not.

---
 test/import-export.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/import-export.c b/test/import-export.c
index bffe0fc4..392f1dac 100644
--- a/test/import-export.c
+++ b/test/import-export.c
@@ -55,9 +55,15 @@ int main() {
 	data = meshlink_export(mesh2);
 	assert(data);
 
+	assert(meshlink_import(mesh1, data));
+
+	// Check that importing twice is fine
 	assert(meshlink_import(mesh1, data));
 	free(data);
 
+	// Check that importing garbage is not fine
+	assert(!meshlink_import(mesh1, "Garbage\n"));
+
 	// Check that foo knows bar, but that it is not reachable.
 
 	time_t last_reachable;
-- 
2.39.5