You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
******************** TEST 'Mojo Standard Library :: collections/test_list.mojo' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
Unhandled exception caught during execution: AssertionError: Didn't raise at /Users/runner/work/mojo/mojo/stdlib/test/collections/test_list.mojo:414:23
--
Command Output (stderr):
--
RUN: at line 13: mojo /Users/runner/work/mojo/mojo/stdlib/test/collections/test_list.mojo
+ mojo /Users/runner/work/mojo/mojo/stdlib/test/collections/test_list.mojo
mojo: error: execution exited with a non-zero result: 1
--
********************
Line 414 is the last assert
vartest_list_a= List[Int](10, 20, 30, 40, 50)
# Basic Functionality Tests
assert_equal(test_list_a.index(10), 0)
assert_equal(test_list_a.index(30), 2)
assert_equal(test_list_a.index(50), 4)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(60)
# Tests With Start Parameter
assert_equal(test_list_a.index(30, start=1), 2)
assert_equal(test_list_a.index(30, start=-4), 2)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(30, start=3)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(30, start=5)
# Tests With Start and End Parameters
assert_equal(test_list_a.index(30, start=1, stop=3), 2)
assert_equal(test_list_a.index(30, start=-4, stop=-2), 2)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(30, start=1, stop=2)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(30, start=3, stop=1)
# Tests With End Parameter Only
assert_equal(test_list_a.index(30, stop=3), 2)
assert_equal(test_list_a.index(30, stop=-2), 2)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(30, stop=1)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(30, stop=2)
with assert_raises(contains="ValueError: Given element is not in list"):
_ = test_list_a.index(60, stop=50)
Steps to reproduce
Include relevant code snippet or link to code that did not work as expected.
If applicable, add screenshots to help explain the problem.
If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
Include anything else that might help us debug the issue.
System information
- What OS did you do install Mojo on ?
- Provide version information for Mojo by pasting the output of `mojo -v``mojo 2024.5.1805`
- Provide Modular CLI version by pasting the output of `modular -v`
The text was updated successfully, but these errors were encountered:
martinvuyk
changed the title
[BUG] List test sometimes fails sometimes doesn't in nightly 2024.5.1805
[BUG] [stdlib] [collections] [list] List test sometimes fails sometimes doesn't in nightly 2024.5.1805May 18, 2024
Bug description
Line 414 is the last assert
Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: