#!/usr/bin/env python3

import glob
import os.path

for f in glob.glob('tests/invalid/*/*.multi'):
    base = os.path.dirname(f[:-6])
    for l in open(f, 'rb').readlines():
        name = l.split(b'=')[0].strip().decode()
        if name == '' or name[0] == '#':
            continue
        path = base + "/" + name + '.toml'
        with open(path, 'wb+') as fp:
            fp.write(l)
