Commit 52da10d9 authored by Ryan Pavlik's avatar Ryan Pavlik

Clean up tests and test the helper filter too

parent 09a4968b
......@@ -65,7 +65,7 @@ def test_do_prefix_block_full_blank_full():
# Specifying blank line prefix here should change middle line
eq_(do_prefix_block('A\n\nB\n', line_prefix='prefix', block_begin='BEGIN', block_end='END', blank_line_prefix='blank'),
('BEGINprefixA\nblank\nprefixB\nEND'))
intext = """Copyright (c) 2018 Collabora, Ltd.
block_intext = """Copyright (c) 2018 Collabora, Ltd.
SPDX-License-Identifier: Apache-2.0
......@@ -80,7 +80,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License."""
expected = """/*
block_expected = """/*
** Copyright (c) 2018 Collabora, Ltd.
**
** SPDX-License-Identifier: Apache-2.0
......@@ -98,7 +98,14 @@ expected = """/*
** limitations under the License.
*/"""
def test_real_text():
eq_(do_prefix_block(intext, line_prefix='** ', blank_line_prefix='**', block_begin='/*\n', block_end='\n*/'), expected)
eq_(
do_prefix_block(block_intext, line_prefix='** ', blank_line_prefix='**', block_begin='/*\n', block_end='\n*/'),
block_expected)
def test_real_text_c_block_comment():
eq_(
do_c_block_comment(block_intext, line_prefix='** ', begin_chars='/*\n', end_chars='\n*/'),
block_expected)
def test_identifier():
eq_(do_make_identifier('asdf'), 'asdf')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment