Changeset 978
- Timestamp:
- Jun 25, 2012 10:12:12 PM (11 years ago)
- Location:
- specdomain/trunk/src/specdomain/test
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
specdomain/trunk/src/specdomain/test/tester.py
r935 r978 2 2 3 3 # $Id$ 4 5 6 '''test various regular expressions to match macro declarations''' 4 7 5 8 … … 103 106 cdef("config_mac", "{PLOT_CNTRS_MAX = COUNTERS}", "PLOT_Y", 0x10 ) 104 107 ''' 105 f = open('cdef-examples.mac', 'r') 106 buf = f.read() 107 f.close() 108 buf = open('../macros/cdef-examples.mac', 'r').read() 108 109 test_cases += buf 109 110 tester(test_cases, spec_func_re) -
specdomain/trunk/src/specdomain/test/tester2.py
r936 r978 5 5 6 6 """ 7 test various regular expressions to locate arguments 8 to cdef for a particular case from standard.mac 7 9 """ 8 10 … … 38 40 , re.IGNORECASE|re.DOTALL) 39 41 40 for regexp in (arg1_re, arg2_re, arg3_re, arg4_re):42 for i, regexp in enumerate((arg1_re, arg2_re, arg3_re, arg4_re)): 41 43 m = regexp.match(s) 42 44 if m is not None: 43 print m.groups()45 print i, m.groups()
Note: See TracChangeset
for help on using the changeset viewer.