def areTheSame(fn1, fn2, fileHandler):
    """
    Tests that files contain the same data

    If fileHandler is tgio file reader like tgio.openTextgrid then
    we can compare a shortTextgrid and a longTextgrid.

    If fileHandler is readFile or io.open, etc then the raw
    text will be compared.
    """
    data1 = fileHandler(fn1)
    data2 = fileHandler(fn2)

    return data1 == data2