| Index: tools/lexer_generator/transition_key_test.py
|
| diff --git a/WATCHLISTS b/tools/lexer_generator/transition_key_test.py
|
| similarity index 73%
|
| copy from WATCHLISTS
|
| copy to tools/lexer_generator/transition_key_test.py
|
| index 9c2bce9c5589c22649b4a2c94837f00c8d669be1..00863bf11dd3e8455dae81c3c4e637723b421704 100644
|
| --- a/WATCHLISTS
|
| +++ b/tools/lexer_generator/transition_key_test.py
|
| @@ -25,22 +25,24 @@
|
| # (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 transition_keys import TransitionKey
|
|
|
| -# IMPORTANT: The regular expression filepath is tested against each path using
|
| -# re.search, so it is not usually necessary to add .*.
|
| +class TransitionKeyTestCase(unittest.TestCase):
|
|
|
| -{
|
| - 'WATCHLIST_DEFINITIONS': {
|
| - 'public_api': {
|
| - 'filepath': 'include/',
|
| - },
|
| - },
|
| + __equal_pairs = [
|
| + (TransitionKey.epsilon(), TransitionKey.epsilon()),
|
| + (TransitionKey.any(), TransitionKey.any()),
|
| + (TransitionKey.single_char('a'), TransitionKey.single_char('a')),
|
| + ]
|
|
|
| - 'WATCHLISTS': {
|
| - 'public_api': [
|
| - 'phajdan.jr@chromium.org',
|
| - ],
|
| - },
|
| -}
|
| + def test_eq(self):
|
| + for (left, right) in self.__equal_pairs:
|
| + self.assertEqual(left, right)
|
| +
|
| + def test_hash(self):
|
| + for (left, right) in self.__equal_pairs:
|
| + self.assertEqual(hash(left), hash(right))
|
| +
|
| +if __name__ == '__main__':
|
| + unittest.main()
|
|
|