-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix LazyList.range [ci: last-only]
#10767
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
base: 2.13.x
Are you sure you want to change the base?
Changes from 2 commits
6de2bf8
91088b5
bd3db0d
f7745a4
2028dae
fbc2623
1ac4f64
b4eb90a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -444,8 +444,20 @@ class LazyListTest { | |
| LazyList(1).lazyAppendedAll({ count += 1; Seq(2)}).toList | ||
| assertEquals(1, count) | ||
| } | ||
|
|
||
| @Test | ||
| def lazyRangeAllowsMoreThanIntMaxValue(): Unit = { | ||
| val totalElements: Long = Int.MaxValue.toLong + 2L | ||
| val count: Long = | ||
| LazyList | ||
| .range(start = 0L, end = totalElements) | ||
| .foldLeft(0L) { case (acc, _) => | ||
| acc + 1L | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even with inlining turned on, it's a lot to ask of a unit test. Maybe it's sufficient to test construction and head.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I was wondering the same. So not sure if there is a smart way to test this without it being a CPU trap.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a reverse |
||
| assertEquals(totalElements, count) | ||
| } | ||
| } | ||
|
|
||
| object LazyListTest { | ||
| var serializationForceCount = 0 | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.