1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
package solution_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Test Example", func() {
It("should test that 12.255.56.1 is correct", func() {
Expect(Is_valid_ip("12.255.56.1")).To(Equal(true))
})
})
var _ = Describe("Test Example", func() {
It("should test that '' is uncorrect", func() {
Expect(Is_valid_ip("")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that abc.def.ghi.jkl is uncorrect", func() {
Expect(Is_valid_ip("abc.def.ghi.jkl")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that 123.456.789.0 is uncorrect", func() {
Expect(Is_valid_ip("123.456.789.0")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that 12.34.56 is uncorrect", func() {
Expect(Is_valid_ip("12.34.56")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that 12.34.56 .1 is uncorrect", func() {
Expect(Is_valid_ip("12.34.56 .1")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that 12.34.56.-1 is uncorrect", func() {
Expect(Is_valid_ip("12.34.56.-1")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that 123.045.067.089 is uncorrect", func() {
Expect(Is_valid_ip("123.045.067.089")).To(Equal(false))
})
})
var _ = Describe("Test Example", func() {
It("should test that 127.1.1.0 is correct", func() {
Expect(Is_valid_ip("127.1.1.0")).To(Equal(true))
})
})
var _ = Describe("Test Example", func() {
It("should test that 0.0.0.0 is correct", func() {
Expect(Is_valid_ip("0.0.0.0")).To(Equal(true))
})
})
var _ = Describe("Test Example", func() {
It("should test that 0.34.82.53 is correct", func() {
Expect(Is_valid_ip("0.34.82.53")).To(Equal(true))
})
})
var _ = Describe("Test Example", func() {
It("should test that 192.168.1.300 is uncorrect", func() {
Expect(Is_valid_ip("192.168.1.300")).To(Equal(false))
})
})
|