Beispiel #1
0
    def test_get_magic_marks(self):
        ms = get_magic_marks('.+')
        assert ms == ['+']

        ms = get_magic_marks('.~')
        assert ms == ['~']

        ms = get_magic_marks('.`a b`')
        assert ms == ['`a b`']
Beispiel #2
0
    def test_get_magic_marks_bad_text(self):
        ms = get_magic_marks('')
        assert ms is None

        ms = get_magic_marks('foo')
        assert ms is None

        ms = get_magic_marks('.foo')
        assert ms is None

        ms = get_magic_marks('.foo+~``')
        assert ms is None
Beispiel #3
0
 def test_get_magic_marks_multiple(self):
     ms = get_magic_marks('.+~`a b c`')
     assert ms == ['+', '~', '`a b c`']
Beispiel #4
0
    def test_get_magic_marks_special(self):
        ms = get_magic_marks('++foo')
        assert ms == '++'

        ms = get_magic_marks('--foo\nbar')
        assert ms == '--'
Beispiel #5
0
    def test_get_magic_marks_multiline(self):
        ms = get_magic_marks('.+foo\nbar')
        assert ms == ['+']

        ms = get_magic_marks('++foo\nbar\nbaz')
        assert ms == '++'