Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for zmpop #605

Merged
merged 4 commits into from May 25, 2022
Merged

Add support for zmpop #605

merged 4 commits into from May 25, 2022

Conversation

gkorland
Copy link
Contributor

@gkorland gkorland commented May 8, 2022

No description provided.

Copy link
Contributor

@jaymell jaymell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi -- thanks for the PR! Fixing clippy warnings is fine, but can we put them in a separate PR for organization's sake?

EDIT: I have since seen other PR for clippy -- apologies for my limited PR buffer size 😹

src/commands.rs Outdated Show resolved Hide resolved
src/commands.rs Outdated Show resolved Hide resolved
@djc
Copy link
Contributor

djc commented May 11, 2022

The OP already has the clippy warnings fixed in #604, so we should get that landed first. :)

@gkorland gkorland requested review from djc and jaymell May 23, 2022 10:50
@gkorland
Copy link
Contributor Author

@djc @jaymell I'm sorry for the broken PR, I guess this is what happens when you don't write tests.
I did review the the tests and I don't see any tests for the APIs.

e.g. looking at the test for SET operations it seems like the test doesn't really test the API, but only test the raw cmd API.

fn test_set_ops() {
    let ctx = TestContext::new();
    let mut con = ctx.connection();

    redis::cmd("SADD").arg("foo").arg(1).execute(&mut con);
    redis::cmd("SADD").arg("foo").arg(2).execute(&mut con);
    redis::cmd("SADD").arg("foo").arg(3).execute(&mut con);

    let mut s: Vec<i32> = redis::cmd("SMEMBERS").arg("foo").query(&mut con).unwrap();
    s.sort_unstable();
    assert_eq!(s.len(), 3);
    assert_eq!(&s, &[1, 2, 3]);

    let set: HashSet<i32> = redis::cmd("SMEMBERS").arg("foo").query(&mut con).unwrap();
    assert_eq!(set.len(), 3);
    assert!(set.contains(&1i32));
    assert!(set.contains(&2i32));
    assert!(set.contains(&3i32));

    let set: BTreeSet<i32> = redis::cmd("SMEMBERS").arg("foo").query(&mut con).unwrap();
    assert_eq!(set.len(), 3);
    assert!(set.contains(&1i32));
    assert!(set.contains(&2i32));
    assert!(set.contains(&3i32));
}

@djc
Copy link
Contributor

djc commented May 23, 2022

Would you mind rebasing this on main so the clippy fixes go away?

@jaymell jaymell merged commit c1e3c97 into redis-rs:main May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants