Skip to content

Commit 22c2739

Browse files
raklaptudirmsiriak
andauthored
Fix failing tests (#324)
Co-authored-by: Andrii Siriak <[email protected]>
1 parent 204a737 commit 22c2739

File tree

17 files changed

+27
-597
lines changed

17 files changed

+27
-597
lines changed

.github/workflows/golang_lint_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
# specified without patch version: we always use the latest patch version.
1717
# https://github.com/golangci/golangci-lint/releases
1818
version: v1.39
19-
- run: go test $(go list ./... | grep -v /sbom | grep -v /rsa_cipher)
19+
- run: go test ./...

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
2020
* [Polybius](./ciphers/polybius/)
2121
* [Rot13](./ciphers/rot13/)
2222
* [Rsa Cipher](./ciphers/rsa_cipher/)
23-
* [Rsa Cipher Big](./ciphers/rsa_cipher_big/)
2423
* [Xor Cipher](./ciphers/xor_cipher/)
2524

2625
## Conversions
@@ -104,7 +103,6 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
104103
* Multiple String Matching
105104
* [Advanced Aho Corasick](./strings/multiple_string_matching/advanced_aho_corasick/)
106105
* [Aho Corasick](./strings/multiple_string_matching/aho_corasick/)
107-
* [Sbom](./strings/multiple_string_matching/sbom/)
108106
* [Naive String Search](./strings/naive_string_search/)
109107
* Single String Matching
110108
* [Bom](./strings/single_string_matching/bom/)

ciphers/rsa_cipher/rsacipher.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package rsacipher
22

33
import (
4-
//"math/big"
5-
64
"fmt"
75
"math"
86
"math/rand"

ciphers/rsa_cipher/rsacipher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestRSACipher(t *testing.T) {
7474

7575
if actual := decrypted; !reflect.DeepEqual(actual, expected) {
7676
t.Logf("FAIL: %s", test.description)
77-
t.Fatalf("Expecting %v, actual %v", expected, actual)
77+
t.Fatalf("Expecting %v, actual %v", expected, ToRune(actual))
7878
}
7979
})
8080
}

ciphers/rsa_cipher_big/rsacipherbig.go

Lines changed: 0 additions & 133 deletions
This file was deleted.

ciphers/rsa_cipher_big/rsacipherbig_test.go

Lines changed: 0 additions & 62 deletions
This file was deleted.

data_structures/binary_tree/binarytree.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Package binarytree basic binary tree and related operations
22
package binarytree
33

4-
54
/*
65
func main() {
76
t := btree{nil}

data_structures/binary_tree/btree.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@ func LevelOrder(root *Node) {
116116
}
117117
}
118118

119-
120119
// Max Function that returns max of two numbers - possibly already declared.
121120
func Max(a, b int) int {
122121
if a > b {
123122
return a
124123
}
125124
return b
126-
}
125+
}

data_structures/dynamic_array/dynamicarray.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
package dynamicarray
1212

13-
1413
// errors: used to handle CheckRangeFromIndex function with a reasonable error value
1514
import (
1615
"errors"

data_structures/dynamic_array/dynamicarray_test.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package dynamicarray
22

3-
43
// reflect: used for check equal values
54
import (
65
"reflect"
@@ -13,7 +12,7 @@ func TestDynamicArray(t *testing.T) {
1312

1413
// check numbers is empty or nut
1514
t.Run("Check Empty Dynamic Array", func(t *testing.T) {
16-
if numbers.IsEmpty() != true{
15+
if numbers.IsEmpty() != true {
1716
t.Errorf("Expected be true but got %v", numbers.IsEmpty())
1817
}
1918
})
@@ -26,7 +25,7 @@ func TestDynamicArray(t *testing.T) {
2625

2726
// check numbers added to our dynamic array
2827
t.Run("Add Element into Dynamic Array", func(t *testing.T) {
29-
if numbers.IsEmpty() != false{
28+
if numbers.IsEmpty() != false {
3029
t.Errorf("Expected be false but got %v", numbers.IsEmpty())
3130
}
3231
var res []interface{}
@@ -43,7 +42,7 @@ func TestDynamicArray(t *testing.T) {
4342

4443
// Remove an Element inside the dynamic array with the index of array
4544
t.Run("Remove in Dynamic Array", func(t *testing.T) {
46-
if numbers.IsEmpty() != false{
45+
if numbers.IsEmpty() != false {
4746
t.Errorf("Expected be false but got %v", numbers.IsEmpty())
4847
}
4948
var res []interface{}
@@ -55,7 +54,7 @@ func TestDynamicArray(t *testing.T) {
5554
// remove the element by the index
5655
err := numbers.Remove(1)
5756

58-
if err != nil{
57+
if err != nil {
5958
t.Errorf("Expected be [10, 30, 40, 50] but got an Error %v", err)
6059
}
6160

@@ -66,36 +65,35 @@ func TestDynamicArray(t *testing.T) {
6665

6766
// get one element by the index of the dynamic array
6867
t.Run("Get in Dynamic Array", func(t *testing.T) {
69-
if numbers.IsEmpty() != false{
68+
if numbers.IsEmpty() != false {
7069
t.Errorf("Expected be false but got %v", numbers.IsEmpty())
7170
}
7271

7372
// return one element with the index
74-
getOne,_ := numbers.Get(2)
73+
getOne, _ := numbers.Get(2)
7574

7675
if getOne != 40 {
7776
t.Errorf("Expected be 40 but got %v", getOne)
7877
}
7978

8079
})
8180

82-
8381
// Put to add a value to specific index of Dynamic Array
8482
t.Run("Put to Dynamic Array", func(t *testing.T) {
85-
if numbers.IsEmpty() != false{
83+
if numbers.IsEmpty() != false {
8684
t.Errorf("Expected be false but got %v", numbers.IsEmpty())
8785
}
8886

8987
// change value of specific index
9088
err := numbers.Put(0, 100)
91-
if err != nil{
89+
if err != nil {
9290
t.Errorf("Expected be [10, 30, 40, 50] but got an Error %v", err)
9391
}
9492

95-
getOne,_ := numbers.Get(0)
93+
getOne, _ := numbers.Get(0)
9694
if getOne != 100 {
9795
t.Errorf("Expected be 100 but got %v", getOne)
9896
}
9997
})
10098

101-
}
99+
}

0 commit comments

Comments
 (0)