Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
add a test for find_many
Browse files Browse the repository at this point in the history
  • Loading branch information
lostman committed Nov 22, 2023
1 parent 330675d commit 318e3d1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/fuel-indexer-tests/indexers/fuel-indexer-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,19 @@ mod fuel_indexer_test {
assert_eq!(fs[1].string_value, "find3");
assert_eq!(fs[2].string_value, "find4");
assert_eq!(fs[3].string_value, "find5");

let fs: Vec<FindEntity> = FindEntity::find_many(
FindEntity::string_value()
.gt("f".to_string())
.order_by(FindEntity::value())
.desc(),
);

assert_eq!(fs.len(), 4);
assert_eq!(fs[0].string_value, "find5");
assert_eq!(fs[1].string_value, "find4");
assert_eq!(fs[2].string_value, "find3");
assert_eq!(fs[3].string_value, "find2");
} else if block_data.height == 6 {
// There is no such block. The lookup will fail.
IndexMetadataEntity::find(IndexMetadataEntity::block_height().eq(777))
Expand Down

0 comments on commit 318e3d1

Please sign in to comment.