From: Reuben Thomas Date: Wed, 17 Jan 2018 14:34:41 +0000 (+0000) Subject: t40_java.py: fix qp to Java test X-Git-Tag: v3.7~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b994d6c953fbd19886db60fa402a2c2c342d95e;p=recode t40_java.py: fix qp to Java test When converting individual characters in Java source, we don’t add BOMs, so don’t require them in the output. test_2 ends up only doing one direction, but that’s OK because test_1 does the other. --- diff --git a/tests/t40_java.py b/tests/t40_java.py index 50824ea..056a9b8 100644 --- a/tests/t40_java.py +++ b/tests/t40_java.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import common -from common import setup_module, teardown_module +from common import setup_module, teardown_module, Recode, outer, assert_or_diff input = '''\ Dear =DEorvard=F0ur, @@ -26,6 +26,12 @@ class Test: common.validate(input, output) def test_2(self): - # Block of lines to Java and back. - common.request('l1/qp..java') - common.validate_back(input) + # Block of lines from Java, without requiring BOM for each Unicode character. + request = Recode.Request(outer) + request.scan('java..l1/qp') + task = Recode.Task(request) + task.set_byte_order_mark(False) + task.set_input(output) + task.perform() + task_output = task.get_output() + assert_or_diff(task_output, input)