commit 47dbefd0db784d8268d1835868a3052effd7e893
parent 31c5c5f73532bdf6c6fa1de8f0dc47a8ad2f35e9
Author: William Casarin <jb55@jb55.com>
Date: Sat, 22 Jul 2023 11:13:22 -0700
test: check for unescaped content
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/test.c b/test.c
@@ -110,8 +110,20 @@ static void test_parse_contact_list()
assert(size > 0);
assert(size == 59058);
- printf("contacts content '%s'\n", ndb_note_content(note));
+ const char* expected_content =
+ "{\"wss://nos.lol\":{\"write\":true,\"read\":true},"
+ "\"wss://relay.damus.io\":{\"write\":true,\"read\":true},"
+ "\"ws://monad.jb55.com:8080\":{\"write\":true,\"read\":true},"
+ "\"wss://nostr.wine\":{\"write\":true,\"read\":true},"
+ "\"wss://welcome.nostr.wine\":{\"write\":true,\"read\":true},"
+ "\"wss://eden.nostr.land\":{\"write\":true,\"read\":true},"
+ "\"wss://relay.mostr.pub\":{\"write\":true,\"read\":true},"
+ "\"wss://nostr-pub.wellorder.net\":{\"write\":true,\"read\":true}}";
+
+ assert(!strcmp(expected_content, ndb_note_content(note)));
+
write_file("test_contacts_ndb_note", (unsigned char *)note, size);
+ printf("wrote test_contacts_ndb_note (raw ndb_note)\n");
free(json);
free(buf);