~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ignores.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
50
50
    def test_parse_empty(self):
51
51
        ignored = ignores.parse_ignore_file(StringIO(''))
52
52
        self.assertEqual(set([]), ignored)
 
53
        
 
54
    def test_parse_non_utf8(self):
 
55
        """Lines with non utf 8 characters should be discarded."""
 
56
        ignored = ignores.parse_ignore_file(StringIO(
 
57
                'utf8filename_a\n'
 
58
                'invalid utf8\x80\n'
 
59
                'utf8filename_b\n'
 
60
                ))
 
61
        self.assertEqual(set([
 
62
                        'utf8filename_a',
 
63
                        'utf8filename_b',
 
64
                       ]), ignored)
53
65
 
54
66
 
55
67
class TestUserIgnores(TestCaseInTempDir):