Skip to content

Commit

Permalink
Fixing some of the tests due to the line breaks added by spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorpamplona committed Jan 6, 2024
1 parent 6e99e6f commit eb08d48
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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%))",
Expand Down Expand Up @@ -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%)",
Expand Down Expand Up @@ -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)",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit eb08d48

Please sign in to comment.