from pathlib import Path


def make_mess(d):
    """
    Creates a mess of symlinked files and directories in d
    """
    real_filenames = set()

    (d / 'xxx.txt').write_text('xxx')
    real_filenames.add(Path('xxx.txt'))

    foobar = d / 'foo' / 'bar'
    yyy_txt = foobar / 'yyy.txt'

    foobar.mkdir(parents = True)
    yyy_txt.write_text('yyy')
    real_filenames.add(Path('foo') / 'bar' / 'yyy.txt')

    (d / 'dir_shortcut').symlink_to(foobar)
    (d / 'file_shortcut').symlink_to(yyy_txt)

    symlinks = {
        'file_shortcut': 'foo/bar/yyy.txt',
        'dir_shortcut/yyy.txt': 'foo/bar/yyy.txt',
    }

    return real_filenames, symlinks