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