1 | // Copyright (C) 2008 Google Inc. |
2 | // |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | // you may not use this file except in compliance with the License. |
5 | // You may obtain a copy of the License at |
6 | // |
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
8 | // |
9 | // Unless required by applicable law or agreed to in writing, software |
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | // See the License for the specific language governing permissions and |
13 | // limitations under the License. |
14 | |
15 | package com.google.caja.render; |
16 | |
17 | import com.google.caja.lexer.TokenConsumer; |
18 | import com.google.caja.lexer.InputSource; |
19 | import com.google.caja.reporting.MessageContext; |
20 | import com.google.caja.reporting.RenderContext; |
21 | |
22 | import java.util.Map; |
23 | |
24 | /** |
25 | * @author ihab.awad@gmail.com |
26 | */ |
27 | public class SourceSnippetRendererTest extends OrigSourceRendererTestCase { |
28 | public final void testRendering() throws Exception { |
29 | runTest( |
30 | "ss-golden.js", "ss-rewritten-tokens.txt", |
31 | "ss-test-input.js"); |
32 | } |
33 | |
34 | @Override |
35 | protected TokenConsumer createRenderer( |
36 | Map<InputSource, ? extends CharSequence> originalSource, |
37 | MessageContext mc, RenderContext rc) { |
38 | return new SourceSnippetRenderer(originalSource, mc, rc); |
39 | } |
40 | } |