Skip to content

Conversation

@ColmBhandal
Copy link
Owner

Description

Fixed bug in the ContainsKeyTuple method

@ColmBhandal ColmBhandal linked an issue Feb 1, 2021 that may be closed by this pull request
public abstract NonnegativeInteger Arity { get; }
public abstract IEnumerable<IList<TKey>> Keyset();

public IEnumerable<(IList<TKey>, TVal)> KeyValuePairs() =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is worth adding a couple of tests for these new methods (KeyValuePairs and Values). Just to make sure they return the expected keys and do not fail on empty dictionaries.

TVal this[params TKey[] keyTuple] { get; }
IEnumerable<IList<TKey>> Keyset();
IEnumerable<(IList<TKey>, TVal)> KeyValuePairs();
IEnumerable<TVal> Values();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these be methods or properties? The standard C# dictionaries expose Keys and Values as properties. Is there a particular reason you made these methods instead?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah I originally had Keys as a property, but it felt like a lie to the user as the enumeration was walking through each individual item... However, I suppose that's the way for most enumerable properties... I'll change em to properties so

Added tests for empty dictionary case
Added tests for checking enumerables after adding known entries
@ColmBhandal ColmBhandal merged commit 3254f66 into develop Feb 1, 2021
@ColmBhandal ColmBhandal deleted the feature/curry-dictionary-updates branch February 1, 2021 16:58
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.

ContainsKeyTuple False Case Failing

3 participants