Skip to content

Commit

Permalink
adding new test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nurettintopal committed Jul 6, 2024
1 parent 264005b commit b28a207
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ func TestEqualsOperator(t *testing.T) {
if op.Apply(5, 10) {
t.Errorf("Expected 5 not equals 10")
}

if !op.Apply("a", "a") {
t.Errorf("Expected a equals a")
}
if op.Apply("a", "b") {
t.Errorf("Expected a not equals b")
}
}

func TestNotEqualsOperator(t *testing.T) {
Expand All @@ -22,6 +29,13 @@ func TestNotEqualsOperator(t *testing.T) {
if op.Apply(5, 5) {
t.Errorf("Expected 5 equals 5")
}

if !op.Apply("a", "b") {
t.Errorf("Expected a not equals b")
}
if op.Apply("a", "a") {
t.Errorf("Expected a equals a")
}
}

func TestGreaterThanOperator(t *testing.T) {
Expand Down Expand Up @@ -78,6 +92,18 @@ func TestInOperator(t *testing.T) {
if op.Apply("France", []string{"Turkey", "Germany"}) {
t.Errorf("Expected 'France' not in ['Turkey', 'Germany']")
}
if !op.Apply(100, []int{100, 200}) {
t.Errorf("Expected '100' in [100, 200]")
}
if op.Apply(300, []int{100, 200}) {
t.Errorf("Expected '300' not in [100, 200]")
}
if !op.Apply(100.1, []float64{100.1, 200.1}) {
t.Errorf("Expected '100.1' in [100.1, 200.1]")
}
if op.Apply(300.1, []float64{100.1, 200.1}) {
t.Errorf("Expected '300.1' not in [100.1, 200.1]")
}
}

func TestNotInOperator(t *testing.T) {
Expand Down

0 comments on commit b28a207

Please sign in to comment.