def splitline(text):
    """
    Splits the given text at newline.
    
        >>> splitline('foo\\nbar')
        ('foo\\n', 'bar')
        >>> splitline('foo')
        ('foo', '')
        >>> splitline('')
        ('', '')
    """
    index = text.find('\n') + 1
    if index:
        return text[:index], text[index:]
    else:
        return text, ''
