def test_lex_mangling_bang():
 entry = tokenize('foo!')
 assert (entry == [HySymbol('foo_bang')])
 entry = tokenize('!')
 assert (entry == [HySymbol('!')])
 entry = tokenize('im!foo')
 assert (entry == [HySymbol('im!foo')])
 entry = tokenize('.foo!')
 assert (entry == [HySymbol('.foo_bang')])
 entry = tokenize('foo.bar!')
 assert (entry == [HySymbol('foo.bar_bang')])
 entry = tokenize('foo!.bar')
 assert (entry == [HySymbol('foo_bang.bar')])
 entry = tokenize('.foo!.bar.baz!')
 assert (entry == [HySymbol('.foo_bang.bar.baz_bang')])

def test_lex_mangling_bang ( ) : entry = tokenize ( 'foo!' ) assert ( entry == [ HySymbol ( 'foo_bang' ) ] ) entry = tokenize ( '!' ) assert ( entry == [ HySymbol ( '!' ) ] ) entry = tokenize ( 'im!foo' ) assert ( entry == [ HySymbol ( 'im!foo' ) ] ) entry = tokenize ( '.foo!' ) assert ( entry == [ HySymbol ( '.foo_bang' ) ] ) entry = tokenize ( 'foo.bar!' ) assert ( entry == [ HySymbol ( 'foo.bar_bang' ) ] ) entry = tokenize ( 'foo!.bar' ) assert ( entry == [ HySymbol ( 'foo_bang.bar' ) ] ) entry = tokenize ( '.foo!.bar.baz!' ) assert ( entry == [ HySymbol ( '.foo_bang.bar.baz_bang' ) ] )
ensure that identifiers ending with a bang get mangled ok .