# # Copyright (C) 2023 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #
import copy import json import textwrap import unittest from typing import Any
class VsCodeLaunchGeneratorTest(unittest.TestCase): def setUp(self) -> None: # These tests can generate long diffs, so we remove the limit
self.maxDiff = None
class LaunchConfigInsertTest(unittest.TestCase): def setUp(self) -> None: # These tests can generate long diffs, so we remove the limit
self.maxDiff = None
def test_fail_if_no_begin(self) -> None:
dst = textwrap.dedent("""\
// #lldbclient-generated-end""") with self.assertRaisesRegex(ValueError, 'Did not find begin marker line'):
gdbclient.insert_commands_into_vscode_config(dst, 'foo')
def test_fail_if_no_end(self) -> None:
dst = textwrap.dedent("""\
// #lldbclient-generated-begin""") with self.assertRaisesRegex(ValueError, 'Unterminated begin marker at line 1'):
gdbclient.insert_commands_into_vscode_config(dst, 'foo')
def test_fail_if_begin_has_extra_text(self) -> None:
dst = textwrap.dedent("""\
// #lldbclient-generated-begin text
// #lldbclient-generated-end""") with self.assertRaisesRegex(ValueError, 'Did not find begin marker line'):
gdbclient.insert_commands_into_vscode_config(dst, 'foo')
def test_fail_if_end_has_extra_text(self) -> None:
dst = textwrap.dedent("""\
// #lldbclient-generated-begin
// #lldbclient-generated-end text""") with self.assertRaisesRegex(ValueError, 'Unterminated begin marker at line 1'):
gdbclient.insert_commands_into_vscode_config(dst, 'foo')
def test_fail_if_begin_end_swapped(self) -> None:
dst = textwrap.dedent("""\
// #lldbclient-generated-end
// #lldbclient-generated-begin""") with self.assertRaisesRegex(ValueError, 'Unterminated begin marker at line 2'):
gdbclient.insert_commands_into_vscode_config(dst, 'foo')
if __name__ == '__main__':
unittest.main(verbosity=2)
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.3 Sekunden
(vorverarbeitet am 2026-06-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.