aboutsummaryrefslogtreecommitdiff
path: root/direct_client_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'direct_client_test.go')
-rw-r--r--direct_client_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/direct_client_test.go b/direct_client_test.go
new file mode 100644
index 0000000..894b876
--- /dev/null
+++ b/direct_client_test.go
@@ -0,0 +1,29 @@
+// 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 TestDirectClient_parseHTMLKataDasar(t *testing.T) {
+ htmlBody, err := ioutil.ReadFile("testdata/kbbi_dasar.html")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ cl, err := newDirectClient(nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ got, err := cl.parseHTMLKataDasar(htmlBody)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ t.Logf("Kata dasar: %v", got)
+}