コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)