create macro in memory + tests