diff options
author | Damien George <damien.p.george@gmail.com> | 2017-02-10 12:02:02 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-02-10 12:02:02 +1100 |
commit | e08395a35c37fa7f7c0311cc4c7a71537b8b4227 (patch) | |
tree | 77b3131a19b35c3603f779caca9a49cebe1a2ced /tests/misc/print_exception.py | |
parent | cc2dbdd1fe4a5131a40b2ab73195786451314bf8 (diff) | |
download | micropython-e08395a35c37fa7f7c0311cc4c7a71537b8b4227.tar.gz micropython-e08395a35c37fa7f7c0311cc4c7a71537b8b4227.zip |
tests/misc: Add test for line number printing with large bytecode chunk.
Diffstat (limited to 'tests/misc/print_exception.py')
-rw-r--r-- | tests/misc/print_exception.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/misc/print_exception.py b/tests/misc/print_exception.py index 9baac713ee..30a732106c 100644 --- a/tests/misc/print_exception.py +++ b/tests/misc/print_exception.py @@ -41,3 +41,13 @@ try: except Exception as e: print('caught') print_exc(e) + +# Here we have a function with lots of bytecode generated for a single source-line, and +# there is an error right at the end of the bytecode. It should report the correct line. +def f(): + f([1, 2], [1, 2], [1, 2], {1:1, 1:1, 1:1, 1:1, 1:1, 1:1, 1:X}) + return 1 +try: + f() +except Exception as e: + print_exc(e) |