Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: client/dom/scripts/idlrenderer_test.py

Issue 9706084: Add conditional feature to templates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/dom/scripts/idlrenderer.py ('k') | client/dom/scripts/templateloader.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 import idlnode 6 import idlnode
7 import idlparser 7 import idlparser
8 import idlrenderer 8 import idlrenderer
9 import logging.config 9 import logging.config
10 import unittest 10 import unittest
(...skipping 25 matching lines...) Expand all
36 getter attribute int get_attr; 36 getter attribute int get_attr;
37 setter attribute int set_attr; 37 setter attribute int set_attr;
38 38
39 [A,B=123] void function(in long x, in optional boolean y); 39 [A,B=123] void function(in long x, in optional boolean y);
40 40
41 const boolean CONST = 1; 41 const boolean CONST = 1;
42 42
43 @A @B() @C(x) @D(x=1) @E(x,y=2) 43 @A @B() @C(x) @D(x=1) @E(x,y=2)
44 void something(); 44 void something();
45 }; 45 };
46 };
47 @X module M2 {
48 @Y interface I {};
46 };''' 49 };'''
47 50
48 expected_text = \ 51 expected_text = \
49 '''module M { 52 '''module M {
50 [Constructor(in long x)] interface I : 53 [Constructor(in long x)]
51 @A J, 54 interface I :
52 K { 55 @A J,
56 K {
53 57
54 /* Constants */ 58 /* Constants */
55 const boolean CONST = 1; 59 const boolean CONST = 1;
56 60
57 /* Attributes */ 61 /* Attributes */
58 attribute int attr; 62 attribute int attr;
59 attribute long attr2; 63 attribute long attr2;
60 getter attribute int get_attr; 64 getter attribute int get_attr;
61 setter attribute int set_attr; 65 setter attribute int set_attr;
62 66
63 /* Operations */ 67 /* Operations */
64 [A, B=123] void function(in long x, in optional boolean y); 68 [A, B=123] void function(in long x, in optional boolean y);
65 @A @B @C(x) @D(x=1) @E(x, y=2) void something(); 69 @A @B @C(x) @D(x=1) @E(x, y=2) void something();
66 }; 70 };
67 }; 71 };
72 @X module M2 {
73 @Y
74 interface I {
75 };
76 };
68 ''' 77 '''
69 self._run_test(input_text, expected_text) 78 self._run_test(input_text, expected_text)
70 79
71 if __name__ == "__main__": 80 if __name__ == "__main__":
72 logging.config.fileConfig("logging.conf") 81 logging.config.fileConfig("logging.conf")
73 if __name__ == '__main__': 82 if __name__ == '__main__':
74 unittest.main() 83 unittest.main()
OLDNEW
« no previous file with comments | « client/dom/scripts/idlrenderer.py ('k') | client/dom/scripts/templateloader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698