import unittest
from fixed import total

class WhitespaceTests(unittest.TestCase):
    def test_single_and_repeated_spaces(self):
        self.assertEqual(total("10 20 30"), 60)
        self.assertEqual(total("10  20 30"), 60)

    def test_other_whitespace(self):
        self.assertEqual(total(" 10\t20\n30 "), 60)

    def test_empty_input_is_zero(self):
        self.assertEqual(total("   "), 0)

    def test_invalid_tokens_are_not_silently_skipped(self):
        with self.assertRaises(ValueError):
            total("10 apples 30")

if __name__ == "__main__":
    unittest.main()
