Created
February 10, 2016 16:34
-
-
Save FichteFoll/1c0e61b110da34a74cb5 to your computer and use it in GitHub Desktop.
Draft of tests for Visual Indentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.parametrize( | |
['input', 'expected_output'], | |
[ | |
# Fold in before space | |
(""" | |
func(a, b, c,| d, e, f) | |
""", | |
""" | |
func(a, b, c, | |
|d, e, f) | |
"""), | |
# Fold-in after space (strip?) | |
(""" | |
func(a, b, c, |d, e, f) | |
""", | |
""" | |
func(a, b, c, | |
|d, e, f) | |
"""), | |
# After nested fold-in | |
(""" | |
func(a, (b, c),|) | |
""", | |
""" | |
func(a, (b, c), | |
|) | |
"""), | |
# Block with content | |
(""" | |
l = [|a] | |
""", | |
""" | |
l = [ | |
|a | |
] | |
"""), | |
(""" | |
l = [|a, b | |
c, d] | |
""", | |
""" | |
l = [ | |
|a, b | |
c, d | |
] | |
"""), | |
# Empty block | |
(""" | |
func(|) | |
""", | |
""" | |
func( | |
| | |
) | |
"""), | |
# block in fold-in TOREVIEW | |
(""" | |
func(a, b, (|)) | |
""", | |
""" | |
func(a, b, ( | |
| | |
)) | |
"""), | |
# Multiple nested fold-in brackets | |
(""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground"),| | |
""", | |
""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground"), | |
| | |
"""), | |
(""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground"),|])) | |
""", | |
""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground"), | |
|])) | |
"""), | |
(""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground")]|)) | |
""", | |
""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground")] | |
|)) | |
"""), | |
(""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground")])|) | |
""", | |
""" | |
(DC('tagsOptions', '...'), | |
('tagsOptions', [('IDENT', "foreground")]) | |
|) | |
"""), | |
# Comma-aware | |
(""" | |
a(b + c, d |+) | |
""", | |
""" | |
a(b + c, d | |
|+) | |
"""), | |
# Nested comma-aware (with content) | |
(""" | |
a(b, (c, d |+)) | |
""", | |
""" | |
a(b, (c, d | |
|+)) | |
"""), | |
# Nested comma-aware (without content or closing brackets) | |
(""" | |
a(b, (c, d| | |
""", | |
""" | |
a(b, (c, d | |
| | |
"""), | |
] | |
) | |
def test_(input, expected_output): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment