From c24a8e688a6312764254beac2b2520bb0c5e998d Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 3 Mar 2009 19:28:42 -0800 Subject: auto import from //depot/cupcake/@135843 --- amend/tests/005-lex-quoted-string/expected.txt | 13 +++++++++++++ amend/tests/005-lex-quoted-string/info.txt | 1 + amend/tests/005-lex-quoted-string/input | 5 +++++ amend/tests/005-lex-quoted-string/input2 | 2 ++ amend/tests/005-lex-quoted-string/input3 | 2 ++ amend/tests/005-lex-quoted-string/run | 19 +++++++++++++++++++ 6 files changed, 42 insertions(+) create mode 100644 amend/tests/005-lex-quoted-string/expected.txt create mode 100644 amend/tests/005-lex-quoted-string/info.txt create mode 100644 amend/tests/005-lex-quoted-string/input create mode 100644 amend/tests/005-lex-quoted-string/input2 create mode 100644 amend/tests/005-lex-quoted-string/input3 create mode 100644 amend/tests/005-lex-quoted-string/run (limited to 'amend/tests/005-lex-quoted-string') diff --git a/amend/tests/005-lex-quoted-string/expected.txt b/amend/tests/005-lex-quoted-string/expected.txt new file mode 100644 index 000000000..9bb5ac485 --- /dev/null +++ b/amend/tests/005-lex-quoted-string/expected.txt @@ -0,0 +1,13 @@ + IDENTIFIER WORD EOL + IDENTIFIER WORD EOL + IDENTIFIER WORD EOL + IDENTIFIER WORD EOL + IDENTIFIER WORD EOL + EOF + EOL + IDENTIFIERline 2: unterminated string at ' +' + ??? <0> + EOL + IDENTIFIERline 2: illegal escape at '\n' + ??? <0> diff --git a/amend/tests/005-lex-quoted-string/info.txt b/amend/tests/005-lex-quoted-string/info.txt new file mode 100644 index 000000000..be458bd36 --- /dev/null +++ b/amend/tests/005-lex-quoted-string/info.txt @@ -0,0 +1 @@ +Test to make sure that quoted strings are tokenized properly. diff --git a/amend/tests/005-lex-quoted-string/input b/amend/tests/005-lex-quoted-string/input new file mode 100644 index 000000000..2b34bbcfa --- /dev/null +++ b/amend/tests/005-lex-quoted-string/input @@ -0,0 +1,5 @@ +test "string" +test "string with spaces" +test "string with \"escaped\" quotes" +test "string with \\escaped\\ backslashes" +test "string with # a comment character" diff --git a/amend/tests/005-lex-quoted-string/input2 b/amend/tests/005-lex-quoted-string/input2 new file mode 100644 index 000000000..09e668957 --- /dev/null +++ b/amend/tests/005-lex-quoted-string/input2 @@ -0,0 +1,2 @@ +# This should fail +test1 "unterminated string diff --git a/amend/tests/005-lex-quoted-string/input3 b/amend/tests/005-lex-quoted-string/input3 new file mode 100644 index 000000000..02f3f8530 --- /dev/null +++ b/amend/tests/005-lex-quoted-string/input3 @@ -0,0 +1,2 @@ +# This should fail +test1 "string with illegal escape \n in the middle" diff --git a/amend/tests/005-lex-quoted-string/run b/amend/tests/005-lex-quoted-string/run new file mode 100644 index 000000000..7b1292a75 --- /dev/null +++ b/amend/tests/005-lex-quoted-string/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright (C) 2007 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. + +amend --debug-lex input +amend --debug-lex input2 +amend --debug-lex input3 -- cgit v1.2.3