MCPcopy Create free account
hub / github.com/LissaGreense/GO4SQL / TestIsGreaterThan

Function TestIsGreaterThan

engine/generic_value_test.go:7–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestIsGreaterThan(t *testing.T) {
8 oneInt := IntegerValue{
9 Value: 0,
10 }
11 twoInt := IntegerValue{
12 Value: 2,
13 }
14 oneString := StringValue{
15 Value: "aaa",
16 }
17 twoString := StringValue{
18 Value: "aab",
19 }
20 oneNull := NullValue{}
21 twoNull := NullValue{}
22
23 if oneInt.isGreaterThan(twoInt) {
24 t.Errorf("0 shouldn't be greater than 2")
25 }
26
27 if !twoInt.isGreaterThan(oneInt) {
28 t.Errorf("0 shouldn't be greater than 2")
29 }
30
31 if oneString.isGreaterThan(twoString) {
32 t.Errorf("aaa shouldn't be greater than aab")
33 }
34
35 if !twoString.isGreaterThan(oneString) {
36 t.Errorf("1 shouldn't be greater than 2")
37 }
38
39 if twoNull.isGreaterThan(oneNull) {
40 t.Errorf("null is not greater than null")
41 }
42
43 if !oneInt.isGreaterThan(oneNull) {
44 t.Errorf("Any Int value cannot be smaller than null")
45 }
46
47 if !oneString.isGreaterThan(oneNull) {
48 t.Errorf("Any String value cannot be smaller than null")
49 }
50
51 if oneNull.isGreaterThan(oneInt) {
52 t.Errorf("Null cannot be greater than any int value")
53 }
54
55 if oneNull.isGreaterThan(oneString) {
56 t.Errorf("Null cannot be greater than any string value")
57 }
58}
59
60func TestIsSmallerThan(t *testing.T) {
61 oneInt := IntegerValue{

Callers

nothing calls this directly

Calls 3

isGreaterThanMethod · 0.95
isGreaterThanMethod · 0.95
isGreaterThanMethod · 0.95

Tested by

no test coverage detected