def test_ifblock_node_str(): ''' Check the node_str method of the IfBlock class.''' colouredif = colored("If", IfBlock._colour) ifblock = IfBlock() output = ifblock.node_str() assert colouredif+"[]" in output ifblock = IfBlock(annotations=['was_elseif']) output = ifblock.node_str() assert colouredif+"[annotations='was_elseif']" in output
def test_ifblock_node_str(): ''' Check the node_str method of the IfBlock class.''' from psyclone.psyir.nodes.node import colored, SCHEDULE_COLOUR_MAP colouredif = colored("If", SCHEDULE_COLOUR_MAP["If"]) ifblock = IfBlock() output = ifblock.node_str() assert colouredif + "[]" in output ifblock = IfBlock(annotations=['was_elseif']) output = ifblock.node_str() assert colouredif + "[annotations='was_elseif']" in output