Skip to content

Commit

Permalink
fix trailing whitespace issues
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-schwartz committed Jan 8, 2025
1 parent eb1e52a commit 547dfac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions unittests/platformagnostictests.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def write_file(code: str):
with tempfile.NamedTemporaryFile('w', dir=self.builddir, encoding='utf-8', delete=False) as f:
f.write(code)
return f.name

fname = write_file("option('intminmax', type: 'integer', value: 10, min: 0, max: 5)")
self.assertRaisesRegex(MesonException, 'Value 10 for option "intminmax" is more than maximum value 5.',
interp.process, fname)

fname = write_file("option('array', type: 'array', choices : ['one', 'two', 'three'], value : ['one', 'four'])")
self.assertRaisesRegex(MesonException, 'Value "four" for option "array" is not in allowed choices: "one, two, three"',
interp.process, fname)

fname = write_file("option('array', type: 'array', choices : ['one', 'two', 'three'], value : ['four', 'five', 'six'])")
self.assertRaisesRegex(MesonException, 'Values "four, five, six" for option "array" are not in allowed choices: "one, two, three"',
interp.process, fname)
Expand Down Expand Up @@ -326,7 +326,7 @@ def test_editorconfig_match_path(self):
('a.txt', '{a,b,c}.txt', True),
('a.txt', '*.{txt,tex,cpp}', True),
('a.hpp', '*.{txt,tex,cpp}', False),

('a1.txt', 'a{0..9}.txt', True),
('a001.txt', 'a{0..9}.txt', True),
('a-1.txt', 'a{-10..10}.txt', True),
Expand Down Expand Up @@ -376,22 +376,22 @@ def test_format_empty_file(self) -> None:
for code in ('', '\n'):
formatted = formatter.format(code, Path())
self.assertEqual('\n', formatted)

def test_format_indent_comment_in_brackets(self) -> None:
"""Ensure comments in arrays and dicts are correctly indented"""
formatter = Formatter(None, use_editor_config=False, fetch_subdirs=False)
code = 'a = [\n # comment\n]\n'
formatted = formatter.format(code, Path())
self.assertEqual(code, formatted)

code = 'a = [\n # comment\n 1,\n]\n'
formatted = formatter.format(code, Path())
self.assertEqual(code, formatted)

code = 'a = {\n # comment\n}\n'
formatted = formatter.format(code, Path())
self.assertEqual(code, formatted)

def test_error_configuring_subdir(self):
testdir = os.path.join(self.common_test_dir, '152 index customtarget')
out = self.init(os.path.join(testdir, 'subdir'), allow_fail=True)
Expand Down

0 comments on commit 547dfac

Please sign in to comment.