|
1 | | -# # |
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +## |
2 | 3 | # Copyright 2013-2020 Ghent University |
3 | 4 | # |
4 | 5 | # This file is part of EasyBuild, |
@@ -2606,6 +2607,26 @@ def __exit__(self, type, value, traceback): |
2606 | 2607 | self.assertErrorRegex(EasyBuildError, error_pattern, self.test_toy_build, |
2607 | 2608 | extra_args=extra_args, raise_error=True, verbose=False) |
2608 | 2609 |
|
| 2610 | + def test_toy_build_unicode_description(self): |
| 2611 | + """Test installation of easyconfig file that has non-ASCII characters in description.""" |
| 2612 | + # cfr. https://github.com/easybuilders/easybuild-framework/issues/3284 |
| 2613 | + |
| 2614 | + test_ecs_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'easyconfigs', 'test_ecs') |
| 2615 | + toy_ec = os.path.join(test_ecs_dir, 't', 'toy', 'toy-0.0.eb') |
| 2616 | + toy_ec_txt = read_file(toy_ec) |
| 2617 | + |
| 2618 | + # the tilde character included here is a Unicode tilde character, not a regular ASCII tilde (~) |
| 2619 | + descr = "This description includes a unicode tilde character: ∼, for your entertainment." |
| 2620 | + self.assertFalse('~' in descr) |
| 2621 | + |
| 2622 | + regex = re.compile(r'^description\s*=.*', re.M) |
| 2623 | + test_ec_txt = regex.sub(r'description = "%s"' % descr, toy_ec_txt) |
| 2624 | + |
| 2625 | + test_ec = os.path.join(self.test_prefix, 'test.eb') |
| 2626 | + write_file(test_ec, test_ec_txt) |
| 2627 | + |
| 2628 | + self.test_toy_build(ec_file=test_ec, raise_error=True) |
| 2629 | + |
2609 | 2630 |
|
2610 | 2631 | def suite(): |
2611 | 2632 | """ return all the tests in this file """ |
|
0 commit comments