-
-
Notifications
You must be signed in to change notification settings - Fork 550
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
High-Scores: Add immutability test #1486
Conversation
This proposed addition seems similar to what was removed in #1459. |
Sorry to have overlooked this history. I am back to request a test that calls latest() twice, due to a solution that used pop() to implement it. |
No problem. Can you post the code that has driven you to want a test added? It may be that the test need only be added for that track. But lets see what you have. I don't quite follow your reasoning for a new case at this point. |
I can't find it in my lists, but briefly the solution stores the results in a list, and then calls pop(), which removes and returns the last item on the list. Like the issue with sorting, this method destroys the integrity of the data. |
This does sound like you want a track-specific test. The current canonical data describes the expected output of running functions in isolation. So if you'd like to test that a function is immutable, our current canonical data format assumes them to be and doesn't really support this explicitly. Also, I don't think it should. If mentors/maintainers of other tracks disagree, feel free to object to this. But I do think you should add a test for this in your track if this is something you expect to occur again. |
It looks like a perfect Talking Point to add to the Mentor Notes, rather than adding a test. |
There is already note about this in the python mentoring guide. The problem of making sure the representation provides an accurate version of the state seems like the kind of thing that would be useful to test, especially as we try to automate what we can. Is it difficult to make two calls inside a test? Is the reluctance to test this driven by technology or by pedagogy? |
Perhaps this would be acceptable: {
"description": "Recent after a call to sort",
"property": "latest",
"input": {
"personalTopThree": {
"scores": [10, 20, 30, 40, 25]
}
},
"expected": [25]
} The test would need to be last and probably shouldn't fall within the grouping of |
My implementation of this test would look like: procedure THighScoresTest.Recent_after_a_call_to_sort;
var
Scores: IScores;
begin
Scores := NewScores([10, 20, 30, 40, 25]);
Scores := NewScores(Scores.personalTopThree.ToArray);
Assert.AreEqual(25, Scores.latest);
end; Only |
as you have seen, and as I will also now point you to #1225 to see, the schema optimises for this comment should not be taken as a recommendation (either positive or negative) on whether this case should be added |
I agree with @sshine. I understand the thoughts behind the test case, but I'm not in favor of adding it to the canonical data. |
No, but do you mean inside a test file for an exercise on a language track, or in canonical-data.json?
Technology, entirely! My main point of objection would be that the schema of canonical-data.json is challenged up to a point where we wrap a bunch of human-readable sentences in JSON and rule out automated unit test generation. So while some tracks may benefit from the added tests, other tracks for which automated test generation based on canonical-data.json can no longer run their test generator. This exercise was implemented by the following tracks: scala, ecmascript, delphi, nim, javascript, fsharp, csharp, python, ruby. According to exercism/discussions#155, scala, csharp and ruby have test generators. I think your (property) test should be added to canonical-data.json. But I'd prefer if canonical-data.json supported properties, then. I suppose we could
As a last note, I have to admit that I already abused canonical-data.json to store property-based tests in dnd-character; I reasoned that because this was a new exercise, it wouldn't break existing test generators, and because it operates on randomness, testing becomes very track-specific (mocking? injecting seed? property-based?), making test generation difficult if not impossible. But this still violates at least one argument I'm using against adding a property-based test to high-scores. I'm not sure how we proceed from here. I withdraw my objection and am open to proceed in any way. |
@jeffdparker Are you still interested in working on this? |
Yes, I am interested. I’m out of town now, but will be back at my desk
Monday
Jeff Parker
On Wed, Jan 5, 2022 at 4:24 AM Erik Schierboom ***@***.***> wrote:
@jeffdparker <https://github.com/jeffdparker> Are you still interested in
working on this?
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CLK3S4EBSWLXKKAOYLUURICJANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
- Jeff Parker
|
Great. Let's discuss what needs to happen when you're back. |
@jeffdparker Which monday? ;) |
I am back, but I thought I saw that the bug was closed.
I assume that what is needed is a new test: something like this
def test_do_not_reorder(self):
scores = [10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 33]
expected = 33
self.assertEqual(latest(scores), expected)
expected = [100, 90, 70]
self.assertEqual(personal_top_three(scores), expected)
expected = 33
self.assertEqual(latest(scores), expected)
expected = 100
self.assertEqual(personal_best(scores), expected)
expected = 33
self.assertEqual(latest(scores), expected)
I don't know how to insert such a test, but would be happy to learn
jdp
…On Sun, Jan 23, 2022 at 8:13 PM Victor Goff ***@***.***> wrote:
Yes, I am interested. I’m out of town now, but will be back at my desk
Monday
@jeffdparker <https://github.com/jeffdparker> Which monday? ;)
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CNMQ5NHI7EKCPFJ6RTUXS7VHANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This is what groovy does:
But I don't know how to express that with the canonical-data-schema |
Glen
If exercism is still using the same form of Unit tests, the test I provided
above would work.
It might be better to split it into to, to test best and top three
separately
def test_bet_does_not_reorder(self):
scores = [10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 33]
expected = 33
self.assertEqual(latest(scores), expected)
expected = 100
self.assertEqual(personal_best(scores), expected)
expected = 33
self.assertEqual(latest(scores), expected)
def test_top_does_not_reorder(self):
scores = [10, 30, 90, 30, 100, 20, 10, 0, 30, 40, 40, 70, 33]
expected = 33
self.assertEqual(latest(scores), expected)
expected = [100, 90, 70]
self.assertEqual(personal_top_three(scores), expected)
expected = 33
self.assertEqual(latest(scores), expected)
…On Mon, Jan 24, 2022 at 7:53 AM Glenn Jackman ***@***.***> wrote:
This is what groovy does
<https://github.com/exercism/groovy/blob/main/exercises/practice/high-scores/src/test/groovy/HighScoresSpec.groovy#L84>
:
def "Personal top three does not mutate"() {
given:
def hs = new HighScores(scores)
def top3 = hs.personalTopThree()
expect:
hs.latest() == expected
where:
scores || expected
[40, 20, 10, 30] || 30
}
But I don't know how to express that with the canonical-data-schema
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CPB54AY42X2ZYWETKLUXVRUZANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@jeffdparker A separate PR added two test cases to verify immutability: https://github.com/exercism/problem-specifications/blob/main/exercises/high-scores/canonical-data.json#L87-L110 Could you check to see if those work for your suggestion too? |
Erik -
Yes, those are the two test cases I'm concerned about. I see the language,
but I don't see how that is translated into test cases.
jdp
PS Briefly, there are three calls: latest(), ..._best() and
..._top_three(). There is no temptation to modify the list in
implementing latest(), but there is for the other two, and we should check
that calling each does not modify the list, which we can measure by calling
latest()
…On Tue, Jan 25, 2022 at 4:42 AM Erik Schierboom ***@***.***> wrote:
@jeffdparker <https://github.com/jeffdparker> A separate PR added two
test cases to verify immutability:
https://github.com/exercism/problem-specifications/blob/main/exercises/high-scores/canonical-data.json#L87-L110
Could you check to see if those work for your suggestion too?
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CJULLKN5S5XFMJE5ADUX2EBVANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Erik
We are out of town: I will take a look at this later this weekend
Jeff
On Tue, Feb 1, 2022 at 1:25 AM Erik Schierboom ***@***.***> wrote:
I think ynfle's suggestion has one tiny bug, and that is that git push
will fail after rebasing. Once you've rebased, you'll have to do git push
--force. The fact that the contents in this PR are not updated makes
sense as the push will have failed to update it. Could you try force
pushing (note: this is generally discouraged, but necessary are rebasing a
branch and pushing to an existing remote branch).
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CMABKZX6UDDOMD3D23UY6KHRANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
- Jeff Parker
|
I'm looking at my system, and I see no trace of my changes or my pull
request in the exercism branch.
1) I believe that I made the changes, but in a parallel repository, csci1,
with the same problem statement.
2) If Erik thinks there is a problem, what does he think the solution is?
Why would it fail after rebasing?
3) If I didn't make the changes to the exercism branch, do you have any
advice on the next steps?
jeff parker
…On Thu, Feb 3, 2022 at 10:11 AM Jeff Parker ***@***.***> wrote:
Erik
We are out of town: I will take a look at this later this weekend
Jeff
On Tue, Feb 1, 2022 at 1:25 AM Erik Schierboom ***@***.***>
wrote:
> I think ynfle's suggestion has one tiny bug, and that is that git push
> will fail after rebasing. Once you've rebased, you'll have to do git
> push --force. The fact that the contents in this PR are not updated
> makes sense as the push will have failed to update it. Could you try force
> pushing (note: this is generally discouraged, but necessary are rebasing a
> branch and pushing to an existing remote branch).
>
> —
> Reply to this email directly, view it on GitHub
> <#1486 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEHO6CMABKZX6UDDOMD3D23UY6KHRANCNFSM4HAWDTWA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
--
- Jeff Parker
|
This is likely the problem.
That's git protecting you from overwriting remote changes with local changes. In essence:
The branch for this PR is in this repo: https://github.com/jeffdparker/problem-specifications/tree/patch-2 The changes should be applied to the branch of this repo and then pushed. |
Thanks, Erik
…On Tue, Feb 8, 2022 at 1:20 AM Erik Schierboom ***@***.***> wrote:
1. I believe that I made the changes, but in a parallel repository,
csci1,
with the same problem statement.
This is likely the problem.
1. If Erik thinks there is a problem, what does he think the solution
is?
Why would it fail after rebasing?
That's git protecting you from overwriting remote changes with local
changes. In essence: git rebase will have changed the history which means
that git has no way of merging the remote changes with the local changes
because they are two different trees.
1. If I didn't make the changes to the exercism branch, do you have any
advice on the next steps?
The branch for this PR is in this repo:
https://github.com/jeffdparker/problem-specifications/tree/patch-2 The
changes should be applied to the branch of this repo and then pushed.
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6COXJS5UCUAC2YZJDJLU2DG5LANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Add tests for immutability after calling personal best Some solutions sort the array to find the largest. This breaks any subsequent call for recent scores, and isn't as fast as calling max. These two tests call recent and scores to verify that the scores have not changed.
Erik -
I have edited the file and pushed to patch-2. Let me know if more is
needed.
I'm curious to know how I could check the syntax before committing. I did
it by eye, but would prefer some validation
Jeff
…On Tue, Feb 8, 2022 at 1:20 AM Erik Schierboom ***@***.***> wrote:
1. I believe that I made the changes, but in a parallel repository,
csci1,
with the same problem statement.
This is likely the problem.
1. If Erik thinks there is a problem, what does he think the solution
is?
Why would it fail after rebasing?
That's git protecting you from overwriting remote changes with local
changes. In essence: git rebase will have changed the history which means
that git has no way of merging the remote changes with the local changes
because they are two different trees.
1. If I didn't make the changes to the exercism branch, do you have any
advice on the next steps?
The branch for this PR is in this repo:
https://github.com/jeffdparker/problem-specifications/tree/patch-2 The
changes should be applied to the branch of this repo and then pushed.
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6COXJS5UCUAC2YZJDJLU2DG5LANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Add missing commas
Erik -
I see that there is an automated check.
There were a couple of commas missing - one in a prior checkin. I've tried
to fix and recommit
Jeff
…On Tue, Feb 8, 2022 at 1:20 AM Erik Schierboom ***@***.***> wrote:
1. I believe that I made the changes, but in a parallel repository,
csci1,
with the same problem statement.
This is likely the problem.
1. If Erik thinks there is a problem, what does he think the solution
is?
Why would it fail after rebasing?
That's git protecting you from overwriting remote changes with local
changes. In essence: git rebase will have changed the history which means
that git has no way of merging the remote changes with the local changes
because they are two different trees.
1. If I didn't make the changes to the exercism branch, do you have any
advice on the next steps?
The branch for this PR is in this repo:
https://github.com/jeffdparker/problem-specifications/tree/patch-2 The
changes should be applied to the branch of this repo and then pushed.
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6COXJS5UCUAC2YZJDJLU2DG5LANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @jeffdparker, It seems that your push didn't fix it. Check out https://github.com/exercism/problem-specifications#automated-tests for running at least some of the tests locally. Good luck |
It seems that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comma missing I believe.
@@ -112,6 +112,30 @@ | |||
}, | |||
"expected": [25] | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a comma missing here.
}, | ||
{ | ||
"description": "Recent after a call to sort", | ||
"property": "personalTopThree", "latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not valid JSON. Is this test case still needed? I sort of assumed that the two newer ones would handle this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property
value must be a string. This looks like an array, but without the [
and ]
characters.
This is not valid JSON.
Sorry - what is the issue with this?
Is it "scenarios"?
Is it the two properties on the last line? Was that something I changed?
It does not appear in the most recent diffs
Is this test case still needed? I sort of assumed that the two newer ones
would handle this.
There are two issues: immutability after calling latest, and immutability
after calling top three. The old test checked immutability after calling
personal_best(), while the new tests check immutability after calling
personal_top_three(). We should check immutability in both cases: you
could argue that we don't need two tests to check the one thing.
The tests come in pairs: one of these tests checks the most recent (last)
element of the list. The other test in each pair asks for the full list,
and checks that it is unchanged. The tests that use the latest score have
the advantage that they don't need access beyond the API.
Jeff
…On Thu, Feb 10, 2022 at 12:30 AM Erik Schierboom ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In exercises/high-scores/canonical-data.json
<#1486 (comment)>
:
> @@ -103,6 +103,38 @@
},
"expected": [30, 50, 20, 70],
"scenarios": ["immutable"]
+ },
+ {
+ "description": "Recent after a call to sort",
+ "property": "personalTopThree", "latest",
This is not valid JSON. Is this test case still needed? I sort of assumed
that the two newer ones would handle this.
—
Reply to this email directly, view it on GitHub
<#1486 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CMAKIZVFERGUFNCCXDU2NSRRANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests come in pairs: one of these tests checks the most recent (last)
element of the list. The other test in each pair asks for the full list,
and checks that it is unchanged. The tests that use the latest score have
the advantage that they don't need access beyond the API.
Correct, but the PR is now adding three tests. I think the first one should be removed, right?
}, | ||
{ | ||
"description": "Recent after a call to sort", | ||
"property": "personalTopThree", "latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property
value must be a string. This looks like an array, but without the [
and ]
characters.
Agreed.
…On Fri, Feb 11, 2022 at 12:48 AM Erik Schierboom ***@***.***> wrote:
***@***.**** commented on this pull request.
The tests come in pairs: one of these tests checks the most recent (last)
element of the list. The other test in each pair asks for the full list,
and checks that it is unchanged. The tests that use the latest score have
the advantage that they don't need access beyond the API.
Correct, but the PR is now adding three tests. I think the first one
should be removed, right?
------------------------------
In exercises/high-scores/canonical-data.json
<#1486 (comment)>
:
> @@ -103,6 +103,38 @@
},
"expected": [30, 50, 20, 70],
"scenarios": ["immutable"]
+ },
+ {
+ "description": "Recent after a call to sort",
+ "property": "personalTopThree", "latest",
The property value must be a string. This looks like an array, but
without the [ and ] characters.
—
Reply to this email directly, view it on GitHub
<#1486 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CLCELGQ7KW4IQZHRGLU2S5MZANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Removed redundant test that two property strings, rather than one "property": "personalTopThree", "latest",
Erik -
I removed the first test, as you suggested, in canonical-data.json
I received an error message about the file, and chided me for not using
prettier.
I have downloaded npm and prettier, and run
npx prettier -c canonical-data.json
on my local file system. I am told
All matched files use Prettier code style!
Is there a better validation flag I should be using?
jdp
…On Fri, Feb 11, 2022 at 12:48 AM Erik Schierboom ***@***.***> wrote:
***@***.**** commented on this pull request.
The tests come in pairs: one of these tests checks the most recent (last)
element of the list. The other test in each pair asks for the full list,
and checks that it is unchanged. The tests that use the latest score have
the advantage that they don't need access beyond the API.
Correct, but the PR is now adding three tests. I think the first one
should be removed, right?
------------------------------
In exercises/high-scores/canonical-data.json
<#1486 (comment)>
:
> @@ -103,6 +103,38 @@
},
"expected": [30, 50, 20, 70],
"scenarios": ["immutable"]
+ },
+ {
+ "description": "Recent after a call to sort",
+ "property": "personalTopThree", "latest",
The property value must be a string. This looks like an array, but
without the [ and ] characters.
—
Reply to this email directly, view it on GitHub
<#1486 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CLCELGQ7KW4IQZHRGLU2S5MZANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Erik -
I had added the new tests as part of a case statement for the top-three
API.
I have moved the tests two braces out, and the system is silently dreaming
up a new challenge.
jdp
…On Fri, Feb 11, 2022 at 12:48 AM Erik Schierboom ***@***.***> wrote:
***@***.**** commented on this pull request.
The tests come in pairs: one of these tests checks the most recent (last)
element of the list. The other test in each pair asks for the full list,
and checks that it is unchanged. The tests that use the latest score have
the advantage that they don't need access beyond the API.
Correct, but the PR is now adding three tests. I think the first one
should be removed, right?
------------------------------
In exercises/high-scores/canonical-data.json
<#1486 (comment)>
:
> @@ -103,6 +103,38 @@
},
"expected": [30, 50, 20, 70],
"scenarios": ["immutable"]
+ },
+ {
+ "description": "Recent after a call to sort",
+ "property": "personalTopThree", "latest",
The property value must be a string. This looks like an array, but
without the [ and ] characters.
—
Reply to this email directly, view it on GitHub
<#1486 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CLCELGQ7KW4IQZHRGLU2S5MZANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
/format |
seems already addressed by #1767 . |
This is a new addition. |
seems already addressed by #1767
<#1767> .
There are two calls in the API that need to be checked: this change checks
the other one. As noted above:
Briefly, there are three calls: latest(), ..._best() and
..._top_three(). There is no temptation to modify the list in
implementing latest(), but there is for the other two, and we should check
that calling each does not modify the list...
…On Tue, Feb 15, 2022 at 3:17 AM Erik Schierboom ***@***.***> wrote:
seems already addressed by #1767
<#1767> .
This is a new addition.
—
Reply to this email directly, view it on GitHub
<#1486 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEHO6CL5X6Z372WF3UYN56TU3IR23ANCNFSM4HAWDTWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I don't know the syntax, but would like to add a test that asks for top three (causing a sort) followed by a latest to see if the program sorted in place.