| Giorgi Lekveishvili | 1caed36 | 2023-12-13 16:29:43 +0400 | [diff] [blame^] | 1 | package welcome |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | const rec = ` |
| 9 | t40.lekva.me. 3600 IN DS 43870 13 2 9ADA4E046EC0473383035B7BDB6443B8D869A9C8B35D000B8038ABF3F3864621 |
| 10 | ns1.t40.lekva.me. 10800 IN A 135.181.48.180 |
| 11 | ns2.t40.lekva.me. 10800 IN A 65.108.39.172 |
| 12 | t40.lekva.me. 10800 IN NS ns1.t40.lekva.me. |
| 13 | t40.lekva.me. 10800 IN NS ns2.t40.lekva.me. |
| 14 | ` |
| 15 | |
| 16 | func TestParse(t *testing.T) { |
| 17 | zone := "lekva.me." |
| 18 | recs, err := ParseRecords(zone, strings.Split(rec, "\n")) |
| 19 | if err != nil { |
| 20 | t.Fatal(err) |
| 21 | } |
| 22 | if len(recs) != 5 { |
| 23 | t.Fatalf("Expected 5 records, got %d", len(recs)) |
| 24 | } |
| 25 | } |