Ejemplo n.º 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')
Ejemplo n.º 2
0
    def test_equationExtract_empty(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = ''
        position = 0

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, '')
Ejemplo n.º 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, '')
Ejemplo n.º 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')
Ejemplo n.º 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, '')
Ejemplo n.º 6
0
    def test_equationExtract_empty(self):
        from texequation.toolswindowcontroller import ToolsWindowController

        text = ''
        position = 0

        equation = ToolsWindowController.extractEquation(text, position)
        self.assertEqual(equation, '')
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)