tests/test-lrucachedict.py
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 06 Sep 2018 11:37:27 -0700
changeset 39564 5d75a3c16193
parent 39563 b31b01f93b11
child 39565 2dcc68c7d25b
permissions -rw-r--r--
util: make capacity a public attribute on lrucachedict So others can query it. Useful for operations that may want to verify the cache has capacity for N items before it performs an operation that may cause cache eviction. Differential Revision: https://phab.mercurial-scm.org/D4499
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28931
ba0e4789bd2e tests: make test-lrucachedict use print_function
Pulkit Goyal <7895pulkit@gmail.com>
parents: 28930
diff changeset
     1
from __future__ import absolute_import, print_function
28930
e3f01188d439 tests: make test-lrucachedict use absolute_import
Pulkit Goyal <7895pulkit@gmail.com>
parents: 27576
diff changeset
     2
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
     3
import unittest
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
     4
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
     5
import silenttestrunner
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
     6
28930
e3f01188d439 tests: make test-lrucachedict use absolute_import
Pulkit Goyal <7895pulkit@gmail.com>
parents: 27576
diff changeset
     7
from mercurial import (
e3f01188d439 tests: make test-lrucachedict use absolute_import
Pulkit Goyal <7895pulkit@gmail.com>
parents: 27576
diff changeset
     8
    util,
e3f01188d439 tests: make test-lrucachedict use absolute_import
Pulkit Goyal <7895pulkit@gmail.com>
parents: 27576
diff changeset
     9
)
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    10
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    11
class testlrucachedict(unittest.TestCase):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    12
    def testsimple(self):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    13
        d = util.lrucachedict(4)
39564
5d75a3c16193 util: make capacity a public attribute on lrucachedict
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39563
diff changeset
    14
        self.assertEqual(d.capacity, 4)
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    15
        d['a'] = 'va'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    16
        d['b'] = 'vb'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    17
        d['c'] = 'vc'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    18
        d['d'] = 'vd'
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    19
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    20
        self.assertEqual(d['a'], 'va')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    21
        self.assertEqual(d['b'], 'vb')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    22
        self.assertEqual(d['c'], 'vc')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    23
        self.assertEqual(d['d'], 'vd')
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    24
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    25
        # 'a' should be dropped because it was least recently used.
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    26
        d['e'] = 've'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    27
        self.assertNotIn('a', d)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    28
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    29
        self.assertIsNone(d.get('a'))
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    30
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    31
        self.assertEqual(d['b'], 'vb')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    32
        self.assertEqual(d['c'], 'vc')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    33
        self.assertEqual(d['d'], 'vd')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    34
        self.assertEqual(d['e'], 've')
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    35
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    36
        # Touch entries in some order (both get and set).
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    37
        d['e']
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    38
        d['c'] = 'vc2'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    39
        d['d']
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    40
        d['b'] = 'vb2'
29828
79add5a4e857 util: properly implement lrucachedict.get()
Gregory Szorc <gregory.szorc@gmail.com>
parents: 28931
diff changeset
    41
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    42
        # 'e' should be dropped now
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    43
        d['f'] = 'vf'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    44
        self.assertNotIn('e', d)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    45
        self.assertEqual(d['b'], 'vb2')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    46
        self.assertEqual(d['c'], 'vc2')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    47
        self.assertEqual(d['d'], 'vd')
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    48
        self.assertEqual(d['f'], 'vf')
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    49
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    50
        d.clear()
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    51
        for key in ('a', 'b', 'c', 'd', 'e', 'f'):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    52
            self.assertNotIn(key, d)
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
    53
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    54
    def testunfull(self):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    55
        d = util.lrucachedict(4)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    56
        d['a'] = 1
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    57
        d['b'] = 2
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    58
        d['a']
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    59
        d['b']
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    60
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    61
        for key in ('a', 'b'):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    62
            self.assertIn(key, d)
19710
887ffa22fd0d lrucachedict: implement clear()
Siddharth Agarwal <sid0@fb.com>
parents: 18603
diff changeset
    63
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    64
    def testcopypartial(self):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    65
        d = util.lrucachedict(4)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    66
        d['a'] = 'va'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    67
        d['b'] = 'vb'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    68
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    69
        dc = d.copy()
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    70
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    71
        self.assertEqual(len(dc), 2)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    72
        for key in ('a', 'b'):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    73
            self.assertIn(key, dc)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    74
            self.assertEqual(dc[key], 'v%s' % key)
27371
45d996a566d7 util: reimplement lrucachedict
Gregory Szorc <gregory.szorc@gmail.com>
parents: 19710
diff changeset
    75
39563
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    76
        self.assertEqual(len(d), 2)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    77
        for key in ('a', 'b'):
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    78
            self.assertIn(key, d)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    79
            self.assertEqual(d[key], 'v%s' % key)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    80
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    81
        d['c'] = 'vc'
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    82
        del d['b']
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    83
        dc = d.copy()
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    84
        self.assertEqual(len(dc), 2)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    85
        for key in ('a', 'c'):
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    86
            self.assertIn(key, dc)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    87
            self.assertEqual(dc[key], 'v%s' % key)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    88
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    89
    def testcopyempty(self):
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    90
        d = util.lrucachedict(4)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    91
        dc = d.copy()
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    92
        self.assertEqual(len(dc), 0)
b31b01f93b11 util: properly copy lrucachedict instances
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39562
diff changeset
    93
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    94
    def testcopyfull(self):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    95
        d = util.lrucachedict(4)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    96
        d['a'] = 'va'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    97
        d['b'] = 'vb'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    98
        d['c'] = 'vc'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
    99
        d['d'] = 'vd'
27576
6cd3044985c2 lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents: 27371
diff changeset
   100
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   101
        dc = d.copy()
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   102
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   103
        for key in ('a', 'b', 'c', 'd'):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   104
            self.assertIn(key, dc)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   105
            self.assertEqual(dc[key], 'v%s' % key)
27576
6cd3044985c2 lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents: 27371
diff changeset
   106
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   107
        # 'a' should be dropped because it was least recently used.
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   108
        dc['e'] = 've'
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   109
        self.assertNotIn('a', dc)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   110
        for key in ('b', 'c', 'd', 'e'):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   111
            self.assertIn(key, dc)
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   112
            self.assertEqual(dc[key], 'v%s' % key)
27576
6cd3044985c2 lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents: 27371
diff changeset
   113
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   114
        # Contents and order of original dict should remain unchanged.
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   115
        dc['b'] = 'vb_new'
27576
6cd3044985c2 lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents: 27371
diff changeset
   116
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   117
        self.assertEqual(list(iter(d)), ['d', 'c', 'b', 'a'])
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   118
        for key in ('a', 'b', 'c', 'd'):
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   119
            self.assertEqual(d[key], 'v%s' % key)
27576
6cd3044985c2 lrucachedict: add copy method
Eric Sumner <ericsumner@fb.com>
parents: 27371
diff changeset
   120
18603
2251b3184e6e util: add an LRU cache dict
Siddharth Agarwal <sid0@fb.com>
parents:
diff changeset
   121
if __name__ == '__main__':
39562
067f7d2c7d60 tests: rewrite test-lrucachedict.py to use unittest
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29828
diff changeset
   122
    silenttestrunner.main(__name__)