Skip to content

Add iterative tests #22

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

Merged
merged 6 commits into from
Nov 29, 2021
Merged

Add iterative tests #22

merged 6 commits into from
Nov 29, 2021

Conversation

curran
Copy link
Collaborator

@curran curran commented Nov 28, 2021

Based on some downstream development work, I became suspicious that there might be some bug in the string support with JSON1. So I double checked all the tests here to make sure everything was covered. I noticed several issues with the tests and fixed them here in this PR.

  • The new modifications I did to the test runner earlier were only applied to the last set of tests. This PR makes it so all the tests are actually verified.
  • In tests.js, the input was being mutated by json0, so the json1 tests were actually all just getting the same object as input and as output. This PR fixes that.
  • I added some new tests for equivalent input and output, and also for strings. They all passed out of the box.

I'm happy to report that all of the tests do in fact pass, and no bug in the implementation was found.

@curran curran mentioned this pull request Nov 28, 2021
@curran
Copy link
Collaborator Author

curran commented Nov 28, 2021

After this change:

image

image

image

I think the new ops are valid, just different from the expected ones becase we are using diff-match-patch.

@curran curran marked this pull request as ready for review November 28, 2021 11:41
Copy link
Owner

@kbadk kbadk left a comment

Choose a reason for hiding this comment

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

Looks good! 👍🏻

@kbadk kbadk changed the title Iterate Tests Add iterative tests Nov 29, 2021
@kbadk kbadk merged commit def5864 into kbadk:master Nov 29, 2021
@@ -10,7 +10,7 @@ let textUnicode = require("ot-text-unicode");
var jsondiff = require("./index.js");

var tests = [
//tests of equality
// Tests of equality
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! It might be nice to adopt Prettier so these things don't come up in the future.

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.

2 participants