Skip to content

Commit 7dc815c

Browse files
committed
test: remove redundant test name prefixes
1 parent 8a0b48d commit 7dc815c

File tree

5 files changed

+26
-29
lines changed

5 files changed

+26
-29
lines changed

tests/historic/basic.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ use crate::common::{TestCounter, setup_historic_scanner};
55

66
#[tokio::test]
77
async fn processes_events_within_specified_historical_range() -> anyhow::Result<()> {
8-
let setup = setup_historic_scanner(
9-
Some(0.1),
10-
None,
11-
BlockNumberOrTag::Earliest,
12-
BlockNumberOrTag::Latest,
13-
)
14-
.await?;
8+
let setup =
9+
setup_historic_scanner(None, None, BlockNumberOrTag::Earliest, BlockNumberOrTag::Latest)
10+
.await?;
1511
let contract = setup.contract;
1612
let scanner = setup.scanner;
1713
let mut stream = setup.stream;

tests/latest_events/basic.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::common::{TestCounter, deploy_counter, setup_common, setup_latest_scan
66
use event_scanner::{EventFilter, EventScannerBuilder, assert_closed, assert_next};
77

88
#[tokio::test]
9-
async fn latest_scanner_exact_count_returns_last_events_in_order() -> anyhow::Result<()> {
9+
async fn exact_count_returns_last_events_in_order() -> anyhow::Result<()> {
1010
let count = 5;
1111
let setup = setup_latest_scanner(None, None, count, None, None).await?;
1212
let contract = setup.contract;
@@ -36,7 +36,7 @@ async fn latest_scanner_exact_count_returns_last_events_in_order() -> anyhow::Re
3636
}
3737

3838
#[tokio::test]
39-
async fn latest_scanner_fewer_available_than_count_returns_all() -> anyhow::Result<()> {
39+
async fn fewer_available_than_count_returns_all() -> anyhow::Result<()> {
4040
let count = 5;
4141
let setup = setup_latest_scanner(None, None, count, None, None).await?;
4242
let contract = setup.contract;
@@ -64,7 +64,7 @@ async fn latest_scanner_fewer_available_than_count_returns_all() -> anyhow::Resu
6464
}
6565

6666
#[tokio::test]
67-
async fn latest_scanner_no_events_returns_empty() -> anyhow::Result<()> {
67+
async fn no_events_returns_empty() -> anyhow::Result<()> {
6868
let count = 5;
6969
let setup = setup_latest_scanner(None, None, count, None, None).await?;
7070
let scanner = setup.scanner;
@@ -81,7 +81,7 @@ async fn latest_scanner_no_events_returns_empty() -> anyhow::Result<()> {
8181
}
8282

8383
#[tokio::test]
84-
async fn latest_scanner_respects_range_subset() -> anyhow::Result<()> {
84+
async fn respects_range_subset() -> anyhow::Result<()> {
8585
let (_anvil, provider, contract, default_filter) = setup_common(None, None).await?;
8686
// Mine 6 events, one per tx (auto-mined), then manually mint 2 empty blocks to widen range
8787
contract.increase().send().await?.watch().await?;
@@ -118,8 +118,7 @@ async fn latest_scanner_respects_range_subset() -> anyhow::Result<()> {
118118
}
119119

120120
#[tokio::test]
121-
async fn latest_scanner_multiple_listeners_to_same_event_receive_same_results() -> anyhow::Result<()>
122-
{
121+
async fn multiple_listeners_to_same_event_receive_same_results() -> anyhow::Result<()> {
123122
let count = 5;
124123
let setup = setup_latest_scanner(None, None, count, None, None).await?;
125124
let contract = setup.contract;
@@ -161,7 +160,7 @@ async fn latest_scanner_multiple_listeners_to_same_event_receive_same_results()
161160
}
162161

163162
#[tokio::test]
164-
async fn latest_scanner_different_filters_receive_different_results() -> anyhow::Result<()> {
163+
async fn different_filters_receive_different_results() -> anyhow::Result<()> {
165164
let count = 3;
166165
let setup = setup_latest_scanner(None, None, count, None, None).await?;
167166
let contract = setup.contract;
@@ -216,7 +215,7 @@ async fn latest_scanner_different_filters_receive_different_results() -> anyhow:
216215
}
217216

218217
#[tokio::test]
219-
async fn latest_scanner_mixed_events_and_filters_return_correct_streams() -> anyhow::Result<()> {
218+
async fn mixed_events_and_filters_return_correct_streams() -> anyhow::Result<()> {
220219
let count = 2;
221220
let setup = setup_latest_scanner(None, None, count, None, None).await?;
222221
let contract = setup.contract;
@@ -259,7 +258,7 @@ async fn latest_scanner_mixed_events_and_filters_return_correct_streams() -> any
259258
}
260259

261260
#[tokio::test]
262-
async fn latest_scanner_ignores_non_tracked_contract() -> anyhow::Result<()> {
261+
async fn ignores_non_tracked_contract() -> anyhow::Result<()> {
263262
// Manual setup to deploy two contracts
264263
let setup = setup_latest_scanner(None, None, 5, None, None).await?;
265264
let provider = setup.provider;
@@ -294,7 +293,7 @@ async fn latest_scanner_ignores_non_tracked_contract() -> anyhow::Result<()> {
294293
}
295294

296295
#[tokio::test]
297-
async fn latest_scanner_large_gaps_and_empty_ranges() -> anyhow::Result<()> {
296+
async fn large_gaps_and_empty_ranges() -> anyhow::Result<()> {
298297
// Manual setup to mine empty blocks
299298
let (_anvil, provider, contract, default_filter) = setup_common(None, None).await?;
300299

@@ -331,7 +330,7 @@ async fn latest_scanner_large_gaps_and_empty_ranges() -> anyhow::Result<()> {
331330
}
332331

333332
#[tokio::test]
334-
async fn latest_scanner_boundary_range_single_block() -> anyhow::Result<()> {
333+
async fn boundary_range_single_block() -> anyhow::Result<()> {
335334
let (_anvil, provider, contract, default_filter) = setup_common(None, None).await?;
336335

337336
contract.increase().send().await?.watch().await?;

tests/live/basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ async fn signature_matching_ignores_irrelevant_events() -> anyhow::Result<()> {
155155
}
156156

157157
#[tokio::test]
158-
async fn live_filters_malformed_signature_graceful() -> anyhow::Result<()> {
158+
async fn filters_malformed_signature_graceful() -> anyhow::Result<()> {
159159
let setup = setup_live_scanner(Some(0.1), None, 0).await?;
160160
let contract = setup.contract.clone();
161161

tests/live/reorg.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use alloy::{
99
use event_scanner::{ScannerStatus, assert_empty, assert_event_sequence, assert_next};
1010

1111
#[tokio::test]
12-
async fn reorg_rescans_events_within_same_block() -> anyhow::Result<()> {
12+
async fn rescans_events_within_same_block() -> anyhow::Result<()> {
1313
let LiveScannerSetup { provider, contract, scanner, mut stream, anvil: _anvil } =
1414
setup_live_scanner(None, None, 0).await?;
1515

@@ -58,7 +58,7 @@ async fn reorg_rescans_events_within_same_block() -> anyhow::Result<()> {
5858
}
5959

6060
#[tokio::test]
61-
async fn reorg_rescans_events_with_ascending_blocks() -> anyhow::Result<()> {
61+
async fn rescans_events_with_ascending_blocks() -> anyhow::Result<()> {
6262
let LiveScannerSetup { provider, contract, scanner, mut stream, anvil: _anvil } =
6363
setup_live_scanner(None, None, 0).await?;
6464

@@ -107,7 +107,7 @@ async fn reorg_rescans_events_with_ascending_blocks() -> anyhow::Result<()> {
107107
}
108108

109109
#[tokio::test]
110-
async fn reorg_depth_one() -> anyhow::Result<()> {
110+
async fn depth_one() -> anyhow::Result<()> {
111111
let LiveScannerSetup { provider, contract, scanner, mut stream, anvil: _anvil } =
112112
setup_live_scanner(None, None, 0).await?;
113113

@@ -145,7 +145,7 @@ async fn reorg_depth_one() -> anyhow::Result<()> {
145145
}
146146

147147
#[tokio::test]
148-
async fn reorg_depth_two() -> anyhow::Result<()> {
148+
async fn depth_two() -> anyhow::Result<()> {
149149
let LiveScannerSetup { provider, contract, scanner, mut stream, anvil: _anvil } =
150150
setup_live_scanner(None, None, 0).await?;
151151

tests/sync/from_latest.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::common::{TestCounter, setup_sync_from_latest_scanner};
44
use event_scanner::{ScannerStatus, assert_empty, assert_event_sequence, assert_next};
55

66
#[tokio::test]
7-
async fn scan_latest_then_live_happy_path_no_duplicates() -> anyhow::Result<()> {
7+
async fn happy_path_no_duplicates() -> anyhow::Result<()> {
88
let setup = setup_sync_from_latest_scanner(None, None, 3, 0).await?;
99
let contract = setup.contract;
1010
let scanner = setup.scanner;
@@ -49,7 +49,7 @@ async fn scan_latest_then_live_happy_path_no_duplicates() -> anyhow::Result<()>
4949
}
5050

5151
#[tokio::test]
52-
async fn scan_latest_then_live_fewer_historical_then_continues_live() -> anyhow::Result<()> {
52+
async fn fewer_historical_then_continues_live() -> anyhow::Result<()> {
5353
let setup = setup_sync_from_latest_scanner(None, None, 5, 0).await?;
5454
let contract = setup.contract;
5555
let scanner = setup.scanner;
@@ -87,7 +87,7 @@ async fn scan_latest_then_live_fewer_historical_then_continues_live() -> anyhow:
8787
}
8888

8989
#[tokio::test]
90-
async fn scan_latest_then_live_exact_historical_count_then_live() -> anyhow::Result<()> {
90+
async fn exact_historical_count_then_live() -> anyhow::Result<()> {
9191
let setup = setup_sync_from_latest_scanner(None, None, 4, 0).await?;
9292
let contract = setup.contract;
9393
let scanner = setup.scanner;
@@ -120,7 +120,7 @@ async fn scan_latest_then_live_exact_historical_count_then_live() -> anyhow::Res
120120
}
121121

122122
#[tokio::test]
123-
async fn scan_latest_then_live_no_historical_only_live_streams() -> anyhow::Result<()> {
123+
async fn no_historical_only_live_streams() -> anyhow::Result<()> {
124124
let setup = setup_sync_from_latest_scanner(None, None, 5, 0).await?;
125125
let contract = setup.contract;
126126
let scanner = setup.scanner;
@@ -149,7 +149,7 @@ async fn scan_latest_then_live_no_historical_only_live_streams() -> anyhow::Resu
149149
}
150150

151151
#[tokio::test]
152-
async fn scan_latest_then_live_boundary_no_duplication() -> anyhow::Result<()> {
152+
async fn block_gaps_do_not_affect_number_of_events_streamed() -> anyhow::Result<()> {
153153
let setup = setup_sync_from_latest_scanner(None, None, 3, 0).await?;
154154
let provider = setup.provider;
155155
let contract = setup.contract;
@@ -178,16 +178,18 @@ async fn scan_latest_then_live_boundary_no_duplication() -> anyhow::Result<()> {
178178
]
179179
);
180180
assert_next!(stream, ScannerStatus::SwitchingToLive);
181+
let mut stream = assert_empty!(stream);
181182

182183
// Immediately produce a new live event in a new block
183184
contract.increase().send().await?.watch().await?;
185+
184186
assert_next!(stream, &[TestCounter::CountIncreased { newCount: U256::from(4) }]);
185187

186188
Ok(())
187189
}
188190

189191
#[tokio::test]
190-
async fn scan_latest_then_live_waiting_on_live_logs_arriving() -> anyhow::Result<()> {
192+
async fn waiting_on_live_logs_arriving() -> anyhow::Result<()> {
191193
let setup = setup_sync_from_latest_scanner(None, None, 3, 0).await?;
192194
let contract = setup.contract;
193195
let scanner = setup.scanner;

0 commit comments

Comments
 (0)