aboutsummaryrefslogtreecommitdiffstats
path: root/utils/merkletrie
diff options
context:
space:
mode:
Diffstat (limited to 'utils/merkletrie')
-rw-r--r--utils/merkletrie/difftree.go10
-rw-r--r--utils/merkletrie/internal/frame/frame.go4
-rw-r--r--utils/merkletrie/internal/fsnoder/doc.go2
-rw-r--r--utils/merkletrie/internal/fsnoder/file.go2
-rw-r--r--utils/merkletrie/internal/fsnoder/new_test.go4
-rw-r--r--utils/merkletrie/iter_test.go2
6 files changed, 12 insertions, 12 deletions
diff --git a/utils/merkletrie/difftree.go b/utils/merkletrie/difftree.go
index d57ed13..77ba5a8 100644
--- a/utils/merkletrie/difftree.go
+++ b/utils/merkletrie/difftree.go
@@ -8,7 +8,7 @@ package merkletrie
// type defined in this same package; we will iterate over both
// trees at the same time, while comparing the current noders in
// each iterator. Depending on how they differ we will output the
-// corresponding chages and move the iterators further over both
+// corresponding changes and move the iterators further over both
// trees.
//
// The table bellow show all the possible comparison results, along
@@ -69,7 +69,7 @@ package merkletrie
//
// ### C. To was created: 01, 02, 03, 04, 05, 06
// - check: `DifferentName() && ToBeforeFrom()`
-// - action: inserRecursively(to)
+// - action: insertRecursively(to)
// - advance: `ToNext()`
//
// ### D. From was deleted: 10, 20, 30, 40, 50, 60
@@ -131,13 +131,13 @@ package merkletrie
// - action: `DeleteDir(from); InsertFile(to)`
// - advance: `FromNext(); ToNext()`
//
-// ### J. file with contents to dir with contetns: 25, 26, 35, 36
+// ### J. file with contents to dir with contents: 25, 26, 35, 36
// - check: `SameName() && DifferentHash() && FromIsFile() &&
// FromIsNotEmpty() && ToIsDir() && ToIsNotEmpty()`
// - action: `DeleteFile(from); InsertDirRecursively(to)`
// - advance: `FromNext(); ToNext()`
//
-// ### J'. dir with contetns to file with contents: 52, 62, 53, 63
+// ### J'. dir with contents to file with contents: 52, 62, 53, 63
// - check: `SameName() && DifferentHash() && FromIsDir() &&
// FromIsNotEmpty() && ToIsFile() && ToIsNotEmpty()`
// - action: `DeleteDirRecursively(from); InsertFile(to)`
@@ -216,7 +216,7 @@ package merkletrie
// 1 0 1 0 1 0 | a() | a<1> | I' | f | delete(from); insert(to); NN
// 1 0 1 0 1 1 | a() | a<> | F' | f | delete(from); insert(to); NN
// 1 0 1 1 0 0 | a(...) | a(;;;) | L | g | nothing; SS
-// 1 0 1 1 0 1 | a(...) | a() | K' | h | deleteChidren(from); NN
+// 1 0 1 1 0 1 | a(...) | a() | K' | h | deleteChildren(from); NN
// 1 0 1 1 1 0 | a() | a(...) | K | i | insertChildren(to); NN
// 1 0 1 1 1 1 | ---- | ---- | | |
// 1 1 0 0 0 0 | a<1> | a<1> | B | b | nothing; NN
diff --git a/utils/merkletrie/internal/frame/frame.go b/utils/merkletrie/internal/frame/frame.go
index a0b042e..77a3de4 100644
--- a/utils/merkletrie/internal/frame/frame.go
+++ b/utils/merkletrie/internal/frame/frame.go
@@ -38,7 +38,7 @@ func New(n noder.Noder) (*Frame, error) {
}
// String returns the quoted names of the noders in the frame sorted in
-// alphabeticall order by name, surrounded by square brackets and
+// alphabetical order by name, surrounded by square brackets and
// separated by comas.
//
// Examples:
@@ -61,7 +61,7 @@ func (f *Frame) String() string {
}
// First returns, but dont extract, the noder with the alphabetically
-// smaller name in the frame and true if the frame was not empy.
+// smaller name in the frame and true if the frame was not empty.
// Otherwise it returns nil and false.
func (f *Frame) First() (noder.Noder, bool) {
if f.Len() == 0 {
diff --git a/utils/merkletrie/internal/fsnoder/doc.go b/utils/merkletrie/internal/fsnoder/doc.go
index 3f55b5f..c79ac59 100644
--- a/utils/merkletrie/internal/fsnoder/doc.go
+++ b/utils/merkletrie/internal/fsnoder/doc.go
@@ -30,7 +30,7 @@ Directories are expressed as:
- its elements between parents, separated with spaces, in any order.
-- (optionally) the root directory can be unnamed, by skiping its name.
+- (optionally) the root directory can be unnamed, by skipping its name.
Examples:
diff --git a/utils/merkletrie/internal/fsnoder/file.go b/utils/merkletrie/internal/fsnoder/file.go
index c975a60..686a675 100644
--- a/utils/merkletrie/internal/fsnoder/file.go
+++ b/utils/merkletrie/internal/fsnoder/file.go
@@ -60,7 +60,7 @@ const (
fileEndMark = '>'
)
-// String returns a string formated as: name<contents>.
+// String returns a string formatted as: name<contents>.
func (f *file) String() string {
var buf bytes.Buffer
buf.WriteString(f.name)
diff --git a/utils/merkletrie/internal/fsnoder/new_test.go b/utils/merkletrie/internal/fsnoder/new_test.go
index 805772f..a2c474a 100644
--- a/utils/merkletrie/internal/fsnoder/new_test.go
+++ b/utils/merkletrie/internal/fsnoder/new_test.go
@@ -176,7 +176,7 @@ func (s *FSNoderSuite) TestEmptyDir(c *C) {
check(c, input, expected)
}
-func (s *FSNoderSuite) TestDirWithEmtpyFile(c *C) {
+func (s *FSNoderSuite) TestDirWithEmptyFile(c *C) {
input := "(A(a<>))"
a, err := newFile("a", "")
@@ -189,7 +189,7 @@ func (s *FSNoderSuite) TestDirWithEmtpyFile(c *C) {
check(c, input, expected)
}
-func (s *FSNoderSuite) TestDirWithEmtpyFileSameName(c *C) {
+func (s *FSNoderSuite) TestDirWithEmptyFileSameName(c *C) {
input := "(A(A<>))"
f, err := newFile("A", "")
diff --git a/utils/merkletrie/iter_test.go b/utils/merkletrie/iter_test.go
index b334cf1..3b24043 100644
--- a/utils/merkletrie/iter_test.go
+++ b/utils/merkletrie/iter_test.go
@@ -95,7 +95,7 @@ func (t test) run(c *C, iter *merkletrie.Iter,
}
// A testsCollection value represents a tree and a collection of tests
-// we want to perfrom on iterators of that tree.
+// we want to perform on iterators of that tree.
//
// Example:
//