Skip to content

Commit 4d2a1fb

Browse files
committed
add test case
1 parent 1a5c867 commit 4d2a1fb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_issue_53.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import unittest
2+
from pathlib import Path
3+
4+
from striprtf.striprtf import rtf_to_text
5+
6+
RTF = r"""{\rtf1\fbidis\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}{\f1\fswiss\fcharset134 Microsoft YaHei;}{\f2\fnil Microsoft Sans Serif;}}
7+
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
8+
\pard\ltrpar\f0\fs17
9+
00:00:44:22\par
10+
00:00:48:05\par
11+
\f1\'b8\'f9\'be\'dd\'d5\'e6\'ca\'b5\'b9\'ca\'ca\'c2\'b4\'b4\'d7\'f7\f0\par"""
12+
13+
14+
class Table(unittest.TestCase):
15+
def test_parse_w_fontbl(self):
16+
result = rtf_to_text(RTF)
17+
self.assertEqual("00:00:44:22\n00:00:48:05\n根据真实故事创作\n", result)

0 commit comments

Comments
 (0)