aboutsummaryrefslogtreecommitdiff
path: root/kbbi_client_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'kbbi_client_test.go')
-rw-r--r--kbbi_client_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/kbbi_client_test.go b/kbbi_client_test.go
new file mode 100644
index 0000000..d83ab5c
--- /dev/null
+++ b/kbbi_client_test.go
@@ -0,0 +1,29 @@
+// Copyright 2020, Shulhan <ms@kilabit.info>. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package kamusku
+
+import (
+ "io/ioutil"
+ "testing"
+)
+
+func TestClient_parseHTMLKataDasar(t *testing.T) {
+ htmlBody, err := ioutil.ReadFile("testdata/kbbi_dasar.html")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ cl, err := NewKbbiClient()
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ got, err := cl.parseHTMLRootWords(htmlBody)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ t.Logf("Root words: %v", got)
+}