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

Dict bool keys #1771

Merged
merged 4 commits into from
May 13, 2023
Merged

Dict bool keys #1771

merged 4 commits into from
May 13, 2023

Conversation

kabra1110
Copy link
Collaborator

Work in progress. Towards #1710.

@kabra1110 kabra1110 marked this pull request as draft May 10, 2023 17:26
Copy link
Collaborator

@czgdp1807 czgdp1807 left a comment

Choose a reason for hiding this comment

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

Add tests like looping and writing/reading again and again from a bool dictionary. Value can be of different types like, integer, float, string, etc.

Copy link
Collaborator

@czgdp1807 czgdp1807 May 13, 2023

Choose a reason for hiding this comment

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

We are doing d[True] and d[False]. Let's also do something like,

d[i%2 == 0] += 1

And check the count of odd and even numbers for some range [0, n). To make sure things work correctly for runtime boolean keys.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like += isn't currently supported for dict yet. I have added this test with =.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No worries.

Looks like += isn't currently supported for dict yet.

Let's support this in a separate PR, once you complete this and your other open PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you generate these by hand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I added (and later removed) a test in ./tests/tests.toml with asr and asr_json options.

Copy link
Collaborator

@czgdp1807 czgdp1807 May 13, 2023

Choose a reason for hiding this comment

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

Ah I see.Then you can remove these .stdout and .json files. Not needed any more.

I added (and later removed) a test in ./tests/tests.toml

Correct thing to do.

@kabra1110 kabra1110 force-pushed the dict_bool branch 2 times, most recently from 1adf567 to 330efef Compare May 13, 2023 09:59
Copy link
Collaborator

@czgdp1807 czgdp1807 left a comment

Choose a reason for hiding this comment

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

If llvm test is enabled in integration_tests/CMakeLists.txt then most of the time registering the same test in .toml file is not needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Delete this as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This one too.

@czgdp1807 czgdp1807 marked this pull request as ready for review May 13, 2023 10:33
@czgdp1807 czgdp1807 enabled auto-merge (squash) May 13, 2023 10:34
@czgdp1807 czgdp1807 merged commit b9850da into lcompilers:main May 13, 2023
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.

3 participants