# SPDX-FileCopyrightText: Stone Tickle <lattis@mochiro.moe>
# SPDX-License-Identifier: GPL-3.0-only

assert('test@asdf'.format() == 'test@asdf')

assert('a b  c d '.split() == ['a', 'b', 'c', 'd'])
assert('a b  c d '.split(' ') == ['a', 'b', '', 'c', 'd', ''])

assert('asdf' == 'asdf')
assert('as\0df' == '\0'.join(['as', 'df']))
assert('a b c d e f g'.split().length() == 7)
assert('a\0b\0c\0d\0e\0f\0g'.split('\0') == ['a', 'b', 'c', 'd', 'e', 'f', 'g'])

assert(''.join('hello\0\0world'.split('\0')) == 'helloworld')

dict = {'\0': 1, 'x\0y': 2, 'xy': 3, '': 4}

assert(dict['aabb\0baba'.strip('ab')] == 1)
assert(dict['\0'.join(['x', 'y'])] == 2)
assert(dict[''.join(['x', 'y'])] == 3)
assert(dict[''.join(['', ''])] == 4)

str64 = 'x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x '
str128 = str64 + str64
str256 = str128 + str128
str512 = str256 + str256
str1024 = str512 + str512
str2048 = str1024 + str1024
str4096 = str2048 + str2048
str8192 = str4096 + str4096

assert(str8192.split().length() == 8192 / 2)

assert('@0@ < @INPUT@'.format('a') == 'a < @INPUT@')

f = 'asdf'
assert(f'HAVE_@f@'.to_upper() == 'HAVE_ASDF')
