1# Copyright 2011-2023 Free Software Foundation, Inc.
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16# Linespec tests
17
18# We don't currently need our own test case for testing, so grab
19# another one.
20
21if {[prepare_for_testing "failed to prepare" linespecs keywords.c]} {
22  return -1
23}
24
25# PR gdb/12843
26gdb_test "list c:/foo/bar/baz.c:1" "No source file named c:/foo/bar/baz.c."
27gdb_test "list c:/foo/bar/baz.c" "Function \"c:/foo/bar/baz.c\" not defined."
28gdb_test "list fooc:/foo/bar/baz.c:1" "No source file named fooc."
29gdb_test "list fooc:/foo/bar/baz.c" "No source file named fooc."
30
31# PR cli/28665, gdb/28797
32save_vars { env(EDITOR) } {
33    setenv EDITOR true
34
35    foreach cmd {list edit} {
36	gdb_test "${cmd} task 123" \
37	    "Junk at end of line specification\\."
38	gdb_test "${cmd} if (0)" \
39	    "Junk at end of line specification\\."
40	gdb_test "${cmd} thread 1" \
41	    "Junk at end of line specification\\."
42	gdb_test "${cmd} -force-condition" \
43	    "Junk at end of line specification\\."
44	gdb_test "${cmd} ,," \
45	    "Junk at end of line specification\\."
46    }
47}
48