def test_spill_format(spill):
    """Confirms $SPILLOVER value has correct format.
    [# channels], [ch 1,...,ch n], [val 1, ..., val n**2]
    """

    if ',' not in spill and not spill[0].isdigit():
        return False

    spill_sep = spill.split(',')
    n_par = int(spill_sep[0])
    if len(spill_sep) != (1 + n_par + n_par**2):
        return False

    for val in spill_sep[n_par + 1:]:
        try:
            float(val)
        except ValueError:
            return False

    return True