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 InList and NotInList #256

Merged
merged 38 commits into from
Feb 1, 2023
Merged

Conversation

fahimbagar
Copy link
Contributor

This PR does the following:

  • Add InList and NotInList for given types:
    • Value
    • Object
    • Array
    • String
    • Number
    • Boolean (just for completeness)
    • Duration
    • DateTime
      -Since AssertionList rejects a single slice as a param, single array param in InList will behave like IsEqual and NotInList will behave like NotEqual. Addressed in commit 649ee8c

if len(lst) == 1 && reflect.ValueOf(lst[0]).Kind() == reflect.Slice {
return errors.New(
"AssertionList should contain a list of values," +
" but it contains a single element which itself is a list")
}

For issue #250

@coveralls
Copy link
Collaborator

coveralls commented Jan 30, 2023

Coverage Status

Coverage: 94.8% (+0.2%) from 94.555% when pulling 0d5cba1 on fahimbagar:add-InList-and-NotInList into 86f366a on gavv:master.

@gavv gavv added the ready for review Pull request can be reviewed label Jan 30, 2023
@gavv

This comment was marked as resolved.

@gavv

This comment was marked as resolved.

@fahimbagar

This comment was marked as resolved.

Copy link
Owner

@gavv gavv left a comment

Choose a reason for hiding this comment

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

Thanks for update! A few comments

array.go Outdated Show resolved Hide resolved
array.go Outdated Show resolved Hide resolved
array.go Outdated Show resolved Hide resolved
array.go Outdated Show resolved Hide resolved
array.go Outdated Show resolved Hide resolved
boolean.go Outdated Show resolved Hide resolved
array.go Outdated Show resolved Hide resolved
boolean.go Outdated Show resolved Hide resolved
@gavv gavv removed the ready for review Pull request can be reviewed label Feb 1, 2023
@gavv gavv added the needs revision Pull request should be revised by its author label Feb 1, 2023
@gavv gavv linked an issue Feb 1, 2023 that may be closed by this pull request
@fahimbagar fahimbagar requested a review from gavv February 1, 2023 12:03
@gavv
Copy link
Owner

gavv commented Feb 1, 2023

Thanks!

@gavv gavv merged commit 0688f00 into gavv:master Feb 1, 2023
@gavv
Copy link
Owner

gavv commented Feb 1, 2023

Small follow-up commit: 8fe2ffb

@gavv gavv removed the needs revision Pull request should be revised by its author label Feb 1, 2023
@fahimbagar fahimbagar deleted the add-InList-and-NotInList branch February 1, 2023 15:16
@gavv
Copy link
Owner

gavv commented Feb 1, 2023

PS. If you like chat format, welcome to our discord :)

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.

Implement InList and NotInList methods
3 participants