| Index: tools/lexer_generator/code_generator_test.py
|
| diff --git a/WATCHLISTS b/tools/lexer_generator/code_generator_test.py
|
| similarity index 77%
|
| copy from WATCHLISTS
|
| copy to tools/lexer_generator/code_generator_test.py
|
| index 9c2bce9c5589c22649b4a2c94837f00c8d669be1..92ed6f971228b37e3baf0dd5842807c800f0d9ac 100644
|
| --- a/WATCHLISTS
|
| +++ b/tools/lexer_generator/code_generator_test.py
|
| @@ -25,22 +25,20 @@
|
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -# Watchlist Rules
|
| -# Refer: http://dev.chromium.org/developers/contributing-code/watchlists
|
| +import unittest
|
| +from code_generator import CodeGenerator
|
| +from rule_parser import RuleProcessor
|
|
|
| -# IMPORTANT: The regular expression filepath is tested against each path using
|
| -# re.search, so it is not usually necessary to add .*.
|
| +class CodeGeneratorTestCase(unittest.TestCase):
|
|
|
| -{
|
| - 'WATCHLIST_DEFINITIONS': {
|
| - 'public_api': {
|
| - 'filepath': 'include/',
|
| - },
|
| - },
|
| + def test_simple(self):
|
| + rules = '''
|
| + <default>
|
| + "(" { LBRACE }
|
| + ")" { RBRACE }
|
|
|
| - 'WATCHLISTS': {
|
| - 'public_api': [
|
| - 'phajdan.jr@chromium.org',
|
| - ],
|
| - },
|
| -}
|
| + "foo" { FOO }
|
| + eof <<terminate>>'''
|
| + rule_processor = RuleProcessor.parse(rules)
|
| + (nfa, dfa) = rule_processor.default_automata()
|
| + CodeGenerator.dfa_to_code(dfa)
|
|
|