From 186e97c21b16fe55ded63aa2071c7c96423e0da8 Mon Sep 17 00:00:00 2001 From: Mohamed Elhefni Date: Sat, 5 Mar 2022 21:38:36 +0200 Subject: [PATCH] indent code and add testcases for runes --- rune_trie.go | 6 +++--- trie_test.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rune_trie.go b/rune_trie.go index 2053f52..23d393e 100644 --- a/rune_trie.go +++ b/rune_trie.go @@ -71,9 +71,9 @@ func (trie *RuneTrie) Delete(key string) bool { if node.isLeaf() { // iterate backwards over path for i := len(key) - 1; i >= 0; i-- { - if path[i].node == nil { - continue - } + if path[i].node == nil { + continue + } parent := path[i].node r := path[i].r delete(parent.children, r) diff --git a/trie_test.go b/trie_test.go index 4a1a45e..207d404 100644 --- a/trie_test.go +++ b/trie_test.go @@ -125,6 +125,8 @@ func testTrie(t *testing.T, trie Trier) { {"/caterpillar", 4}, {"/cat/gideon", 5}, {"/cat/giddy", 6}, + {"مسار", 7}, + {"這是第三個值", 8}, } // get missing keys