Tor Norbye | 3a2425a5 | 2013-11-04 10:16:08 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2000-2013 JetBrains s.r.o. |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | package com.jetbrains.python; |
| 17 | |
| 18 | import com.jetbrains.python.fixtures.PyLexerTestCase; |
| 19 | import com.jetbrains.python.lexer.PyStringLiteralLexer; |
| 20 | |
| 21 | /** |
| 22 | * @author yole |
| 23 | */ |
| 24 | public class PyStringLiteralLexerTest extends PyLexerTestCase { |
| 25 | public void testBackslashN() { // PY-1313 |
| 26 | PyLexerTestCase.doLexerTest("u\"\\N{LATIN SMALL LETTER B}\"", new PyStringLiteralLexer(PyTokenTypes.SINGLE_QUOTED_UNICODE), |
| 27 | "Py:SINGLE_QUOTED_UNICODE", "VALID_STRING_ESCAPE_TOKEN", "Py:SINGLE_QUOTED_UNICODE"); |
| 28 | } |
Tor Norbye | f88d3e1 | 2013-11-05 17:01:08 -0800 | [diff] [blame] | 29 | |
| 30 | public void testRawBackslashN() { |
| 31 | PyLexerTestCase.doLexerTest("r'[\\w\\']'", new PyStringLiteralLexer(PyTokenTypes.SINGLE_QUOTED_STRING), true, |
| 32 | "r'[\\w\\']'"); |
| 33 | } |
Tor Norbye | 3a2425a5 | 2013-11-04 10:16:08 -0800 | [diff] [blame] | 34 | } |