xref: /llvm-project/lldb/test/Shell/ScriptInterpreter/Python/command_import.test (revision 3338819b08faa7f23f65fb4e67154583984ebf5c)
1# RUN: rm -rf %t && mkdir -p %t
2# RUN: echo "print('Rene Magritte')" >> %t/foo.py
3# RUN: echo "print('Jan van Eyck')" >> %t/foo-bar.py
4# RUN: echo "print('Pieter Bruegel the Elder')" >> %t/foo.bar.py
5# RUN: echo "print('Pieter Bruegel the Younger')" >> %t/foo.bar
6
7# RUN: %lldb --script-language python -o 'command script import %t/foo.py' 2>&1 | FileCheck %s --check-prefix MAGRITTE
8# MAGRITTE: Rene Magritte
9
10# RUN: %lldb --script-language python -o 'command script import %t/foo-bar.py' 2>&1 | FileCheck %s --check-prefix VANEYCK
11# VANEYCK-NOT: Jan van Eyck
12# VANEYCK: module importing failed: Python discourages dashes in module names: foo-bar
13
14# RUN: %lldb --script-language python -o 'command script import %t/foo.bar.py' 2>&1 | FileCheck %s --check-prefix BRUEGEL
15# RUN: %lldb --script-language python -o 'command script import %t/foo.bar' 2>&1 | FileCheck %s --check-prefix BRUEGEL
16# BRUEGEL-NOT: Pieter Bruegel the Elder
17# BRUEGEL-NOT: Pieter Bruegel the Younger
18# BRUEGEL: module importing failed: Python does not allow dots in module names: foo.bar
19