A solution to find the self-descriptive number in base 10.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
349 B

  1. package self_descriptive_number
  2. import "testing"
  3. func TestBase10(t *testing.T) {
  4. numbers, err := Base10()
  5. if err != nil {
  6. t.Fatal(err)
  7. }
  8. if len(numbers) != 1 {
  9. t.Log("number is not 1")
  10. t.Fail()
  11. }
  12. expected := uint64(6210001000)
  13. if numbers[0] != expected {
  14. t.Logf("actual: %v, expected: %v", numbers[0], expected)
  15. t.Fail()
  16. }
  17. }