Ejemplo n.º 1
0
    def test_goto_definition_of_module(self):

        cmd = GotoDefinitionAtCursorCommand()
        (window, view) = default_mock_window()
        cmd.view = view

        cmd._handle_response(putStrLn_span_info.get('contents'))

        self.assertEqual("Cannot navigate to putStrLn, it is imported from Prelude", sublime.current_status)
Ejemplo n.º 2
0
    def test_goto_definition_of_module(self):

        cmd = GotoDefinitionAtCursorCommand()
        (window, view) = default_mock_window()
        cmd.view = view

        cmd._handle_response(putStrLn_span_info.get('contents'))

        self.assertEqual(
            "Cannot navigate to putStrLn, it is imported from Prelude",
            sublime.current_status)
Ejemplo n.º 3
0
    def test_goto_definition_at_cursor(self):

        cmd = GotoDefinitionAtCursorCommand()
        (window, view) = default_mock_window()
        cmd.view = view

        setup_fake_backend(window, {'RequestGetSpanInfo': someFunc_span_info})

        cmd.run(None)

        window.open_file.assert_called_with(cur_dir + "/projects/helloworld/src/Lib.hs:9:1", sublime.ENCODED_POSITION)
Ejemplo n.º 4
0
    def test_goto_definition_at_cursor(self):

        cmd = GotoDefinitionAtCursorCommand()
        (window, view) = default_mock_window()
        cmd.view = view

        setup_fake_backend(window, {'RequestGetSpanInfo': someFunc_span_info})

        cmd.run(None)

        window.open_file.assert_called_with(
            cur_dir + "/projects/helloworld/src/Lib.hs:9:1",
            sublime.ENCODED_POSITION)