aboutsummaryrefslogtreecommitdiff
path: root/client_test.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-02-28 01:07:17 +0700
committerShulhan <m.shulhan@gmail.com>2020-03-02 23:42:00 +0700
commitbf9240a2b91ec855a772c5fdc98ddd89ab28b6e5 (patch)
tree6a11e15f88463b8d82c2a4ca6e6d609fb1d78676 /client_test.go
downloadkamusku-bf9240a2b91ec855a772c5fdc98ddd89ab28b6e5.tar.xz
kbbi: The command line interface and Go library for kbbi.kemdikbud.go.id
Diffstat (limited to 'client_test.go')
-rw-r--r--client_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/client_test.go b/client_test.go
new file mode 100644
index 0000000..9b4e0a6
--- /dev/null
+++ b/client_test.go
@@ -0,0 +1,26 @@
+// Copyright 2020, Shulhan <m.shulhan@gmail.com>. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package kbbi
+
+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 := NewClient()
+
+ got, err := cl.parseHTMLKataDasar(htmlBody)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ t.Logf("Kata dasar: %v", got)
+}