From eb08d485e1bbfefd5bf25a4be55431c355b69df4 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 6 Jan 2024 15:11:12 -0500 Subject: [PATCH] Fixing some of the tests due to the line breaks added by spotless --- .../amethyst/RichTextParserTest.kt | 16 +++--- .../com/vitorpamplona/quartz/EventSigCheck.kt | 57 +++++++------------ 2 files changed, 29 insertions(+), 44 deletions(-) diff --git a/app/src/androidTest/java/com/vitorpamplona/amethyst/RichTextParserTest.kt b/app/src/androidTest/java/com/vitorpamplona/amethyst/RichTextParserTest.kt index 711b7c420..1634bfb96 100644 --- a/app/src/androidTest/java/com/vitorpamplona/amethyst/RichTextParserTest.kt +++ b/app/src/androidTest/java/com/vitorpamplona/amethyst/RichTextParserTest.kt @@ -704,7 +704,7 @@ class RichTextParserTest { "RegularText()", "RegularText(Network statistics)", "RegularText()", - "RegularText(New events witnessed (top 110 relays) )", + "RegularText(New events witnessed (top 110 relays))", "RegularText()", "RegularText(Kind, count, (% count), size, (% size))", "RegularText(1, 207.9K, (28.8%), 458.02MB, (9.2%))", @@ -939,15 +939,15 @@ class RichTextParserTest { "๐Ÿšซ (31) ๐Ÿ‘Š๐Ÿป (31) ๐Ÿ˜ก (31) ๐ŸŒŽ (31) ๐Ÿ‘ (30) ๐Ÿ—ž (30) ๐Ÿ€ (30) ๐Ÿฝ (29) ๐Ÿธ (29) ๐Ÿฅš (29) " + "๐Ÿ’ฉ (29) โœŠ๐Ÿพ (29) ๐Ÿ˜ฎ (29) ๐ŸŒก (29) ๐Ÿ™ƒ (28) ๐Ÿ”” (28) ๐Ÿ‡ป๐Ÿ‡ช (28) ๐Ÿ’ฆ (28) ๐ŸŽฏ (28) ๐ŸŽจ (28) " + "๐Ÿ› (28) ๐Ÿ–ผ (27) โ˜๐Ÿป (27) ๐Ÿ›‘ (27) ๐Ÿ™„ (27) ๐Ÿง‘๐Ÿปโ€๐Ÿคโ€๐Ÿง‘๐Ÿฝ (27) ๐ŸŒˆ (27) ๐Ÿฅ‚ (26) ๐Ÿ‡ซ๐Ÿ‡ฎ (26) ๐ŸŽฅ (26) " + - "๐Ÿ˜ฌ (26) ๐Ÿฅฒ (25) ๐Ÿฆพ (24) ๐Ÿคœ (24) ๐Ÿ™‚ (24) ๐Ÿ–• (24) ๐Ÿ˜ฉ (24) )", + "๐Ÿ˜ฌ (26) ๐Ÿฅฒ (25) ๐Ÿฆพ (24) ๐Ÿคœ (24) ๐Ÿ™‚ (24) ๐Ÿ–• (24) ๐Ÿ˜ฉ (24))", "RegularText()", "RegularText(Zap economy)", "RegularText()", - "RegularText(โšก41.7M sats (โ‚ฟ0.417) )", + "RegularText(โšก41.7M sats (โ‚ฟ0.417))", "RegularText(1,816 zappers & 920 zapped (unique pubkeys))", "RegularText(๐ŸŒฉ๏ธ 33,248 zaps, 1,253 sats per zap (avg))", "RegularText()", - "RegularText(Most followed )", + "RegularText(Most followed)", "RegularText()", "HashTag(#1)", "RegularText(30%)", @@ -4003,17 +4003,17 @@ class RichTextParserTest { "RegularText(New events inspected today: 720.71K (4.85GB))", "RegularText(Average events inspected per second: 8.34)", "RegularText(Uptime: Server 99.93%, NostrInspector: 99.93%)", - "RegularText(Spam estimate: )", + "RegularText(Spam estimate:)", "RegularText(74.12 %)", "RegularText()", "RegularText(About the NostrInspector Report)", "RegularText()", - "RegularText(โœ… The 24 Hour NostrInspector Report is generated by listening for new events on the top relays using the Nostr Protocol. The statistics report that )", + "RegularText(โœ… The 24 Hour NostrInspector Report is generated by listening for new events on the top relays using the Nostr Protocol. The statistics report that)", "RegularText(it generates includes de data layer as well as the social layer.)", "RegularText(๐Ÿ’œ To support this free effort share, like, comment or zap.)", - "RegularText(๐Ÿซ‚ Thank you ๐Ÿ™ )", + "RegularText(๐Ÿซ‚ Thank you ๐Ÿ™)", "RegularText()", - "RegularText(๐Ÿ•ต๏ธ @nostrin \"The Nostr Inspector\" )", + "RegularText(๐Ÿ•ต๏ธ @nostrin \"The Nostr Inspector\")", "Bech(npub17m7f7q08k4x746s2v45eyvwppck32dcahw7uj2mu5txuswldgqkqw9zms7)", ) diff --git a/quartz/src/androidTest/java/com/vitorpamplona/quartz/EventSigCheck.kt b/quartz/src/androidTest/java/com/vitorpamplona/quartz/EventSigCheck.kt index 52aefb577..338f08bf3 100644 --- a/quartz/src/androidTest/java/com/vitorpamplona/quartz/EventSigCheck.kt +++ b/quartz/src/androidTest/java/com/vitorpamplona/quartz/EventSigCheck.kt @@ -28,42 +28,27 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class EventSigCheck { val payload1 = - """ -[ - "EVENT", - "40b9", - { - "id":"48a72b485d38338627ec9d427583551f9af4f016c739b8ec0d6313540a8b12cf", - "kind":1, - "pubkey":"3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d", - "created_at":1677940007, - "content":"I got asked about follower count again today. Why does my follower - count go down when I delete public relays (in our list) and replace them with - filter.nostr.wine? \\n\\nIโ€™ll give you one final explanation to rule them all. - First, letโ€™s go over how clients calculate your follower count.\\n\\n1. Your - client sends a request to all your connected relays asking for accounts who - follow you\\n2. Relays answer back with the events requested\\n3. The client - aggregates the event total and displays it\\n\\nEach relay has a set limit on - how many stored events it will return per request. For some relays itโ€™s 500, - others 1000, some as high as 5000. Letโ€™s say for simplicity that all your - public relays use 500 as their limit. If you ask 10 relays for your followers - the max possible answer you can get is 5000. That wonโ€™t change if you have - 20,000 followers or 100,000. You may get back a โ€œdifferentโ€ 5000 each time, - but youโ€™ll still cap out at 5000 because that is the most events your client - will receive.\u2028\u2028Our limit on filter.nostr.wine is 2000 events. If you - replace 10 public relays with only filter.nostr.wine, the MOST followers you - will ever get back from our filter relay is 2000. That doesnโ€™t mean you only - have 2000 followers or that your reach is reduced in any way.\\n\\nAs long as - you are writing to and reading from the same public relays, neither your reach - nor any content was lost. That concludes my TED talk. I hope you all have a - fantastic day and weekend.", - "tags":[ - - ], - "sig":"dcaf8ab98bb9179017b35bd814092850d1062b26c263dff89fb1ae8c019a324139d1729012d9d05ff0a517f76b1117d869b2cc7d36bea8aa5f4b94c5e2548aa8" - } -] - """ + "[\"EVENT\",\"40b9\",{\"id\":\"48a72b485d38338627ec9d427583551f9af4f016c739b8ec0d6313540a8b12cf\"," + + "\"kind\":1,\"pubkey\":\"3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d\"," + + "\"created_at\":1677940007,\"content\":" + + "\"I got asked about follower count again today. Why does my follower count go down when " + + "I delete public relays (in our list) and replace them with filter.nostr.wine? \\n\\nIโ€™ll " + + "give you one final explanation to rule them all. First, letโ€™s go over how clients calculate " + + "your follower count.\\n\\n1. Your client sends a request to all your connected relays asking " + + "for accounts who follow you\\n2. Relays answer back with the events requested\\n3. The client " + + "aggregates the event total and displays it\\n\\nEach relay has a set limit on how many stored " + + "events it will return per request. For some relays itโ€™s 500, others 1000, some as high as 5000. " + + "Letโ€™s say for simplicity that all your public relays use 500 as their limit. If you ask 10 " + + "relays for your followers the max possible answer you can get is 5000. That wonโ€™t change if " + + "you have 20,000 followers or 100,000. You may get back a โ€œdifferentโ€ 5000 each time, but youโ€™ll " + + "still cap out at 5000 because that is the most events your client will receive.\u2028\u2028Our " + + "limit on filter.nostr.wine is 2000 events. If you replace 10 public relays with only " + + "filter.nostr.wine, the MOST followers you will ever get back from our filter relay is 2000. " + + "That doesnโ€™t mean you only have 2000 followers or that your reach is reduced in any way.\\n\\nAs " + + "long as you are writing to and reading from the same public relays, neither your reach nor any " + + "content was lost. That concludes my TED talk. I hope you all have a fantastic day and weekend.\"," + + "\"tags\":[],\"sig\":\"dcaf8ab98bb9179017b35bd814092850d1062b26c263dff89fb1ae8c019a324139d1729012d" + + "9d05ff0a517f76b1117d869b2cc7d36bea8aa5f4b94c5e2548aa8\"}]" @Test fun testUnicode2028and2029ShouldNotBeEscaped() {