示例#1
0
    def test_equationExtract_inline_02(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$...$} {$a=b$} {$...$}'
        position = 10

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, 'a=b')
示例#2
0
    def test_equationExtract_empty(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = ''
        position = 0

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, '')
示例#3
0
    def test_equationExtract_block_miss_02(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$$a=b$$}'
        position = 9

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, '')
示例#4
0
    def test_equationExtract_inline_02(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$...$} {$a=b$} {$...$}'
        position = 10

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, 'a=b')
示例#5
0
    def test_equationExtract_block_miss_02(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$$a=b$$}'
        position = 9

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, '')
示例#6
0
    def test_equationExtract_empty(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = ''
        position = 0

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, '')
示例#7
0
    def test_equationExtract_block_03(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$$a=b$$}'
        position = 7

        equation, blockMode = ToolsWindowController.extractEquation(text,
                                                                    position)
        self.assertEqual(equation, 'a=b')
        self.assertTrue(blockMode)
示例#8
0
    def test_equationExtract_inline_01(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$a=b$}'
        position = 2

        equation, blockMode = ToolsWindowController.extractEquation(text,
                                                                    position)
        self.assertEqual(equation, 'a=b')
        self.assertFalse(blockMode)
示例#9
0
    def test_equationExtract_block_03(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$$a=b$$}'
        position = 7

        equation, blockMode = ToolsWindowController.extractEquation(text,
                                                                    position)
        self.assertEqual(equation, 'a=b')
        self.assertTrue(blockMode)
示例#10
0
    def test_equationExtract_inline_01(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = '{$a=b$}'
        position = 2

        equation, blockMode = ToolsWindowController.extractEquation(text,
                                                                    position)
        self.assertEqual(equation, 'a=b')
        self.assertFalse(blockMode)