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)
示例#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)
    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)
示例#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)