1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 from pylib
.utils
import proguard
9 class TestParse(unittest
.TestCase
):
12 actual
= proguard
.Parse(
13 ['- Program class: org/example/Test',
14 ' Superclass: java/lang/Object'])
18 'class': 'org.example.Test',
19 'superclass': 'java.lang.Object',
25 self
.assertEquals(expected
, actual
)
28 actual
= proguard
.Parse(
29 ['- Program class: org/example/Test',
30 'Methods (count = 1):',
31 '- Method: <init>()V'])
35 'class': 'org.example.Test',
47 self
.assertEquals(expected
, actual
)
49 def testClassAnnotation(self
):
50 actual
= proguard
.Parse(
51 ['- Program class: org/example/Test',
52 ' - Annotation [Lorg/example/Annotation;]:',
53 ' - Annotation [Lorg/example/AnnotationWithValue;]:',
54 ' - Constant element value [attr \'13\']',
59 'class': 'org.example.Test',
63 'AnnotationWithValue': 'val'
69 self
.assertEquals(expected
, actual
)
71 def testMethodAnnotation(self
):
72 actual
= proguard
.Parse(
73 ['- Program class: org/example/Test',
74 'Methods (count = 1):',
76 ' - Annotation [Lorg/example/Annotation;]:',
77 ' - Annotation [Lorg/example/AnnotationWithValue;]:',
78 ' - Constant element value [attr \'13\']',
83 'class': 'org.example.Test',
91 'AnnotationWithValue': 'val'
98 self
.assertEquals(expected
, actual
)