How to use eq method of diff Package

Best Got code snippet using diff.eq

Run Got automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

deltas.go

Source: deltas.go Github

copy
1package diff
2
3import (
4	"bytes"
5	"fmt"
6	"github.com/j-keck/go-diff/diffmatchpatch"
7)
8
9// DeltaType classifies a patch action like 'delete', 'equal' or 'insert'
10type DeltaType int
11
12const (
13	// Del represents a deleted patch chunk
14	Del DeltaType = (iota - 1)
15	// Eq represents a not changed patch chunk
16	Eq
17	// Ins represents a added patch chunk
18	Ins
19)
20
21// Delta represents a patch chunk
22type Delta struct {
23	Type           DeltaType `json:"kind"`
24	LineNrFrom     int       `json:"lineNrFrom"`
25	LineNrTarget   int       `json:"lineNrTarget"`
26	StartPosFrom   int64     `json:"startPosFrom"`
27	StartPosTarget int64     `json:"startPosTarget"`
28	Text           string    `json:"text"`
29}
30
31func (d *Delta) String() string {
32	var t string
33	switch d.Type {
34	case Ins:
35		t = "+"
36	case Del:
37		t = "-"
38	case Eq:
39		t = "="
40	default:
41		panic("Unexpected DeltaType")
42	}
43	return fmt.Sprintf("{%s:%d,%d:%d,%d:%s}", t, d.LineNrFrom, d.LineNrTarget,
44		d.StartPosFrom, d.StartPosTarget, d.Text)
45}
46
47// Deltas represents all patch chunks of a file
48type Deltas []Delta
49
50func (deltas Deltas) String() string {
51	var buffer bytes.Buffer
52	for idx, delta := range deltas {
53		if idx > 0 {
54			buffer.WriteString(",")
55		}
56		buffer.WriteString(delta.String())
57	}
58	return buffer.String()
59}
60
61func createDeltasFromDiffs(diffs []diffmatchpatch.Diff, contextSize int) Deltas {
62	var deltas Deltas
63	var lineNrFrom, lineNrTarget int = 1, 1       // first line is line nr. 1
64	var startPosFrom, startPosTarget int64 = 1, 1 // first char ist at pos 1
65
66	idx := 0
67	nextDiffIfTypeIs := func(diffType diffmatchpatch.Operation) (diffmatchpatch.Diff, bool) {
68		if idx < len(diffs) && diffs[idx].Type == diffType {
69			next := diffs[idx]
70			idx++
71			return next, true
72		}
73		return diffmatchpatch.Diff{}, false
74	}
75
76	createPrevEqDelta := func(diff diffmatchpatch.Diff) Delta {
77		lineCount := countNewLines(diff.Text)
78		lines := splitText(diff.Text)
79
80		var text string
81		if lineCount > contextSize {
82			fromIndex := lineCount - contextSize
83			text = joinLines(lines[fromIndex:])
84		} else {
85			text = diff.Text
86		}
87		count := countNewLines(text)
88		length := int64(len(text))
89
90		return Delta{
91			Eq,
92			lineNrFrom - count,
93			lineNrTarget - count,
94			startPosFrom - length,
95			startPosTarget - length,
96			text,
97		}
98	}
99
100	createAfterEqDelta := func(diff diffmatchpatch.Diff) (Delta, bool) {
101		lineCount := countNewLines(diff.Text)
102		lines := splitText(diff.Text)
103
104		var text string
105		nextPrevEqMerged := false
106		if idx < len(diffs) && lineCount < contextSize*2 {
107			// merge - but not the last element
108			text = diff.Text
109			nextPrevEqMerged = true
110		} else if lineCount < contextSize {
111			text = diff.Text
112		} else {
113			text = joinLines(lines[:contextSize])
114		}
115
116		return Delta{
117			Eq,
118			lineNrFrom,
119			lineNrTarget,
120			startPosFrom,
121			startPosTarget,
122			text,
123		}, nextPrevEqMerged
124	}
125
126	// first equal block if there is one
127	if diff, ok := nextDiffIfTypeIs(diffmatchpatch.DiffEqual); ok {
128		lineCount := countNewLines(diff.Text)
129		textLength := int64(len(diff.Text))
130
131		lineNrFrom += lineCount
132		lineNrTarget += lineCount
133		startPosFrom += textLength
134		startPosTarget += textLength
135
136		if contextSize > 0 {
137			deltas = append(deltas, createPrevEqDelta(diff))
138		}
139	}
140	for idx < len(diffs) {
141		var delDiff, insDiff diffmatchpatch.Diff
142		var hasDel, hasIns bool
143
144		// add del-delta if there is a delete
145		delDiff, hasDel = nextDiffIfTypeIs(diffmatchpatch.DiffDelete)
146		if hasDel {
147			deltas = append(deltas, Delta{
148				Del,
149				lineNrFrom,
150				lineNrTarget,
151				startPosFrom,
152				startPosTarget,
153				delDiff.Text,
154			})
155		}
156
157		// add ins-delta if there is a insert
158		insDiff, hasIns = nextDiffIfTypeIs(diffmatchpatch.DiffInsert)
159		if hasIns {
160			deltas = append(deltas, Delta{
161				Ins,
162				lineNrFrom,
163				lineNrTarget,
164				startPosFrom,
165				startPosTarget,
166				insDiff.Text,
167			})
168
169		}
170
171		// update lineNr / startPos
172		//   * after the delta additions!
173		//   * if not after, a text replace has the wrong lineNr / startPos
174		//     in the ins-delta
175		if hasDel {
176			lineCount := countNewLines(delDiff.Text)
177			textLength := int64(len(delDiff.Text))
178
179			lineNrFrom += lineCount
180			startPosFrom += textLength
181		}
182		if hasIns {
183			lineCount := countNewLines(insDiff.Text)
184			textLength := int64(len(insDiff.Text))
185
186			lineNrTarget += lineCount
187			startPosTarget += textLength
188		}
189
190		// handle equal
191		//   * add after context
192		//   * update line / pos
193		//   * add prev context for the next
194		if diff, ok := nextDiffIfTypeIs(diffmatchpatch.DiffEqual); ok {
195			lineCount := countNewLines(diff.Text)
196			textLength := int64(len(diff.Text))
197
198			var afterEqDelta Delta
199			var nextPrevEqMerged bool
200			if contextSize > 0 {
201				afterEqDelta, nextPrevEqMerged = createAfterEqDelta(diff)
202				deltas = append(deltas, afterEqDelta)
203			}
204
205			lineNrFrom += lineCount
206			lineNrTarget += lineCount
207			startPosFrom += textLength
208			startPosTarget += textLength
209
210			// don't add prevEq if
211			//  * no context requested
212			//  * we are at the end
213			//  * the afterEqDelta has merged the next (this) prevEqDelta, because the context overlap
214			//  * the afterEqDelta contains the whole text
215			if contextSize > 0 && idx < len(diffs) && !nextPrevEqMerged && afterEqDelta.Text != diff.Text {
216				deltas = append(deltas, createPrevEqDelta(diff))
217			}
218		}
219	}
220
221	return deltas
222}
223
Full Screen

lcs_test.go

Source: lcs_test.go Github

copy
1package diff_test
2
3import (
4	"bytes"
5	"context"
6	"strings"
7	"testing"
8	"time"
9
10	"github.com/ysmood/got"
11	"github.com/ysmood/got/lib/diff"
12)
13
14func TestReduce(t *testing.T) {
15	eq := func(x, y string, e string) {
16		t.Helper()
17
18		out := diff.NewWords(diff.Split(x)).Reduce(diff.NewWords(diff.Split(y))).String()
19		if out != e {
20			t.Error(out, "!=", e)
21		}
22	}
23
24	eq("", "", "")
25	eq("", "a", "")
26	eq("a", "", "")
27	eq("abc", "abc", "abc")
28	eq("abc", "acb", "abc")
29	eq("abc", "acbc", "abc")
30	eq("abc", "xxx", "")
31	eq("ac", "bc", "c")
32}
33
34func TestCommon(t *testing.T) {
35	eq := func(x, y string, el, er int) {
36		t.Helper()
37
38		l, r := diff.NewWords(diff.Split(x)).Common(diff.NewWords(diff.Split(y)))
39
40		if l != el || r != er {
41			t.Error(l, r, "!=", el, er)
42		}
43	}
44
45	eq("", "", 0, 0)
46	eq("", "a", 0, 0)
47	eq("a", "", 0, 0)
48	eq("abc", "abc", 3, 0)
49	eq("abc", "acb", 1, 0)
50	eq("abc", "acbc", 1, 2)
51	eq("abc", "xxx", 0, 0)
52	eq("ac", "bc", 0, 1)
53}
54
55func TestLCSString(t *testing.T) {
56	eq := func(x, y, expected string) {
57		t.Helper()
58
59		ctx, cancel := context.WithTimeout(context.Background(), time.Second)
60		defer cancel()
61		lcs := diff.NewWords(split(x)).LCS(ctx, diff.NewWords(split(y)))
62		out := lcs.String()
63
64		if out != expected {
65			t.Error(out, "!=", expected)
66		}
67	}
68
69	eq("", "", "")
70	eq("abc", "acb", "ac")
71	eq("abc", "acbc", "abc")
72	eq("abc", "xxx", "")
73	eq("ac", "bc", "c")
74	eq("gac", "agcat", "gc")
75	eq("agcat", "gac", "ga")
76
77	x := bytes.Repeat([]byte("x"), 100000)
78	y := bytes.Repeat([]byte("y"), 100000)
79	eq(string(x), string(y), "")
80
81	x[len(x)/2] = byte('a')
82	y[len(y)/2] = byte('a')
83	eq(string(x), string(y), "a")
84
85	x[len(x)/2] = byte('y')
86	y[len(y)/2] = byte('x')
87	eq(string(x), string(y), "yx")
88}
89
90func TestLCSRandomString(t *testing.T) {
91	g := got.T(t)
92
93	x := g.ReadFile("fixtures/rand_x.txt").String()
94	y := g.ReadFile("fixtures/rand_y.txt").String()
95
96	res := diff.NewWords(split(x)).LCS(g.Context(), diff.NewWords(split(y)))
97	g.Eq(
98		res.String(),
99		g.ReadFile("fixtures/rand_lcs.txt").String(),
100	)
101}
102
103func TestText(t *testing.T) {
104	g := setup(t)
105	g.Len(diff.NewLines("a"), 1)
106	g.Len(diff.NewLines("a\n"), 2)
107	g.Len(diff.NewLines("a\n\n"), 3)
108	g.Len(diff.NewLines("\na"), 2)
109}
110
111func TestLCSText(t *testing.T) {
112	g := setup(t)
113	eq := func(x, y, expected string) {
114		t.Helper()
115
116		x = strings.Join(strings.Split(x, ""), "\n")
117		y = strings.Join(strings.Split(y, ""), "\n")
118		expected = strings.Join(strings.Split(expected, ""), "\n")
119
120		lcs := diff.NewLines(x).LCS(context.Background(), diff.NewLines(y))
121		g.Eq(lcs.String(), expected)
122	}
123
124	eq("", "", "")
125	eq("abc", "acb", "ac")
126	eq("abc", "acbc", "abc")
127	eq("abc", "xxx", "")
128}
129
130func TestIsIn(t *testing.T) {
131	g := got.T(t)
132
133	y := diff.NewWords(split("abc"))
134
135	g.True(diff.NewWords(split("ab")).IsSubsequenceOf(y))
136	g.True(diff.NewWords(split("ac")).IsSubsequenceOf(y))
137	g.True(diff.NewWords(split("bc")).IsSubsequenceOf(y))
138	g.False(diff.NewWords(split("cb")).IsSubsequenceOf(y))
139	g.False(diff.NewWords(split("ba")).IsSubsequenceOf(y))
140	g.False(diff.NewWords(split("ca")).IsSubsequenceOf(y))
141}
142
143func TestBTreeFindGreater(t *testing.T) {
144	g := got.T(t)
145
146	check := func(x int, ey int, ef bool) {
147		g.Helper()
148
149		y, f := diff.BTreeFindGreater([]int{1, 3, 5, 7, 9, 11}, x)
150		g.Eq(y, ey)
151		g.Eq(f, ef)
152	}
153
154	check(4, 5, true)
155	check(5, 7, true)
156	check(1, 3, true)
157	check(8, 9, true)
158	check(11, 0, false)
159}
160
Full Screen

gaussian_test.go

Source: gaussian_test.go Github

copy
1package gaussian
2
3import (
4	"math"
5	"testing"
6
7	"github.com/mafredri/go-trueskill/mathextra"
8)
9
10const epsilon = 1e-13 // Precision for floating point comparison
11
12func sq(x float64) float64 { return x * x }
13
14func TestGaussianNewFromMeanAndStdDev(t *testing.T) {
15	mu := 25.0
16	sigma := 25.0 / 3.0
17	g := NewFromMeanAndStdDev(mu, sigma)
18
19	// Values taken from Ralf Herbrich's F# TrueSkill implementation
20	wantPrecisionMean := 0.36
21	wantPrecision := 0.0144
22	wantMean := 25.0
23	wantStdDev := 8.33333333333333
24	wantVariance := 69.4444444444445
25
26	if !mathextra.Float64AlmostEq(wantPrecisionMean, g.PrecisionMean, epsilon) {
27		t.Errorf("PrecisionMean == %.13f, want %.13f", g.PrecisionMean, wantPrecisionMean)
28	}
29
30	if !mathextra.Float64AlmostEq(wantPrecision, g.Precision, epsilon) {
31		t.Errorf("Precision == %.13f, want %.13f", g.Precision, wantPrecision)
32	}
33
34	if !mathextra.Float64AlmostEq(wantMean, g.Mean(), epsilon) {
35		t.Errorf("Mean() == %.13f, want %.13f", g.Mean(), wantMean)
36	}
37
38	if !mathextra.Float64AlmostEq(wantStdDev, g.StdDev(), epsilon) {
39		t.Errorf("StdDev() == %.13f, want %.13f", g.StdDev(), wantStdDev)
40	}
41
42	if !mathextra.Float64AlmostEq(wantVariance, g.Variance(), epsilon) {
43		t.Errorf("Variance() == %.13f, want %.13f", g.Variance(), wantVariance)
44	}
45}
46
47func TestGaussianMult(t *testing.T) {
48	// Values taken from Ralf Herbrich's F# TrueSkill implementation
49	a := NewFromPrecision(0.2879769618430530, 0.0115190784737221)
50	b := NewFromPrecision(0.2319194248106950, 0.0055296783672657)
51
52	prod := a.Mul(b)
53
54	wantPrecisionMean := 0.5198963866537470
55	wantPrecision := 0.0170487568409878
56
57	if !mathextra.Float64AlmostEq(wantPrecisionMean, prod.PrecisionMean, epsilon) {
58		t.Errorf("PrecisionMean == %.13f, want %.13f", prod.PrecisionMean, wantPrecisionMean)
59	}
60
61	if !mathextra.Float64AlmostEq(wantPrecision, prod.Precision, epsilon) {
62		t.Errorf("Precision == %.13f, want %.13f", prod.Precision, wantPrecision)
63	}
64}
65
66func TestGaussianMultNormalAndShifted(t *testing.T) {
67	// From moserware/Skills:
68	// > Verified against the formula at http://www.tina-vision.net/tina-knoppix/tina-memo/2003-003.pdf
69	norm := NewFromMeanAndStdDev(0, 1)
70	shifted := NewFromMeanAndStdDev(2, 3)
71
72	prod := norm.Mul(shifted)
73
74	wantMean := 0.2
75	wantStdDev := 3.0 / math.Sqrt(10)
76
77	if !mathextra.Float64AlmostEq(wantMean, prod.Mean(), epsilon) {
78		t.Errorf("Mean() == %.13f, want %.13f", prod.Mean(), wantMean)
79	}
80
81	if !mathextra.Float64AlmostEq(wantStdDev, prod.StdDev(), epsilon) {
82		t.Errorf("StdDev() == %.13f, want %.13f", prod.StdDev(), wantStdDev)
83	}
84}
85
86func TestGaussianMult4567(t *testing.T) {
87	// From moserware/Skills:
88	// > Verified against the formula at http://www.tina-vision.net/tina-knoppix/tina-memo/2003-003.pdf
89	a := NewFromMeanAndStdDev(4, 5)
90	b := NewFromMeanAndStdDev(6, 7)
91
92	prod := a.Mul(b)
93
94	wantMean := (4*sq(7) + 6*sq(5)) / (sq(5) + sq(7))
95	wantStdDev := math.Sqrt((sq(5) * sq(7)) / (sq(5) + sq(7)))
96
97	if !mathextra.Float64AlmostEq(wantMean, prod.Mean(), epsilon) {
98		t.Errorf("Mean() == %.13f, want %.13f", prod.Mean(), wantMean)
99	}
100
101	if !mathextra.Float64AlmostEq(wantStdDev, prod.StdDev(), epsilon) {
102		t.Errorf("StdDev() == %.13f, want %.13f", prod.StdDev(), wantStdDev)
103	}
104}
105
106func TestGaussianDiv(t *testing.T) {
107	// Values taken from Ralf Herbrich's F# TrueSkill implementation
108	a := NewFromPrecision(0.5198963866537470, 0.0170487568409878)
109	b := NewFromPrecision(0.2319194248106950, 0.0055296783672657)
110
111	prodDiv := a.Div(b)
112
113	wantPrecisionMean := 0.2879769618430530
114	wantPrecision := 0.0115190784737221
115
116	if !mathextra.Float64AlmostEq(wantPrecisionMean, prodDiv.PrecisionMean, epsilon) {
117		t.Errorf("Mean() == %.13f, want %.13f", prodDiv.PrecisionMean, wantPrecisionMean)
118	}
119
120	if !mathextra.Float64AlmostEq(wantPrecision, prodDiv.Precision, epsilon) {
121		t.Errorf("StdDev() == %.13f, want %.13f", prodDiv.Precision, wantPrecision)
122	}
123}
124
125func TestGaussianDivNormal(t *testing.T) {
126	// From moserware/Skills:
127	// > Since the multiplication was worked out by hand, we use the same numbers but work backwards
128	prod := NewFromMeanAndStdDev(0.2, 3.0/math.Sqrt(10))
129	norm := NewFromMeanAndStdDev(0, 1)
130
131	prodDiv := prod.Div(norm)
132
133	wantMean := 2.0
134	wantStdDev := 3.0
135
136	if !mathextra.Float64AlmostEq(wantMean, prodDiv.Mean(), epsilon) {
137		t.Errorf("Mean() == %.13f, want %.13f", prodDiv.Mean(), wantMean)
138	}
139
140	if !mathextra.Float64AlmostEq(wantStdDev, prodDiv.StdDev(), epsilon) {
141		t.Errorf("StdDev() == %.13f, want %.13f", prodDiv.StdDev(), wantStdDev)
142	}
143}
144
145func TestGaussianDiv45(t *testing.T) {
146	// From moserware/Skills:
147	// > Since the multiplication was worked out by hand, we use the same numbers but work backwards
148	prodMu := (4*sq(7) + 6*sq(5)) / (sq(5) + sq(7))
149	prodSigma := math.Sqrt(((sq(5) * sq(7)) / (sq(5) + sq(7))))
150	prod := NewFromMeanAndStdDev(prodMu, prodSigma)
151	m4s5 := NewFromMeanAndStdDev(4, 5)
152
153	prodDiv := prod.Div(m4s5)
154
155	wantMean := 6.0
156	wantStdDev := 7.0
157
158	if !mathextra.Float64AlmostEq(wantMean, prodDiv.Mean(), epsilon) {
159		t.Errorf("Mean() == %.13f, want %.13f", prodDiv.Mean(), wantMean)
160	}
161
162	if !mathextra.Float64AlmostEq(wantStdDev, prodDiv.StdDev(), epsilon) {
163		t.Errorf("StdDev() == %.13f, want %.13f", prodDiv.StdDev(), wantStdDev)
164	}
165}
166
167func TestGaussianAbsDiff(t *testing.T) {
168	// Values taken from Ralf Herbrich's F# TrueSkill implementation
169	a := NewFromPrecision(0.5198963866537470, 0.0170487568409878)
170	b := NewFromPrecision(0.2879769618430530, 0.0115190784737221)
171	diff := AbsDiff(a, b)
172
173	want := 0.2319194248106950
174
175	if !mathextra.Float64AlmostEq(want, diff, epsilon) {
176		t.Errorf("AbsDiff(norm, norm) == %.13f, want %.13f", diff, want)
177	}
178
179}
180
181func TestGaussianAbsDiffNormal(t *testing.T) {
182	// From moserware/Skills:
183	// > Verified with Ralf Herbrich's F# implementation
184	norm := NewFromMeanAndStdDev(0, 1)
185	diff := AbsDiff(norm, norm)
186
187	want := 0.0
188
189	if !mathextra.Float64AlmostEq(want, diff, epsilon) {
190		t.Errorf("AbsDiff(norm, norm) == %.13f, want %.13f", diff, want)
191	}
192}
193
194func TestGaussianAbsDiff1234(t *testing.T) {
195	// From moserware/Skills:
196	// > Verified with Ralf Herbrich's F# implementation
197	a := NewFromMeanAndStdDev(1, 2)
198	b := NewFromMeanAndStdDev(3, 4)
199	diff := AbsDiff(a, b)
200
201	want := 0.4330127018922193
202
203	if !mathextra.Float64AlmostEq(want, diff, epsilon) {
204		t.Errorf("AbsDiff(norm, norm) == %.13f, want %.13f", diff, want)
205	}
206}
207
208func TestLogProdNorm(t *testing.T) {
209	// Values taken from Ralf Herbrich's F# TrueSkill implementation
210	a := NewFromPrecision(0.2879769618430530, 0.0115190784737221)
211	b := NewFromPrecision(0.0445644935525882, 0.0055296783672657)
212	logZ := LogProdNorm(a, b)
213
214	want := -4.2499118707392800
215
216	if !mathextra.Float64AlmostEq(logZ, want, epsilon) {
217		t.Errorf("LogProdNorm(a, a) == %.13f, want %.13f", logZ, want)
218	}
219}
220
221func TestLogProdNormNormal(t *testing.T) {
222	// From moserware/Skills:
223	// > Verified with Ralf Herbrich's F# implementation
224	norm := NewFromMeanAndStdDev(0, 1)
225	logZ := LogProdNorm(norm, norm)
226
227	want := -1.2655121234846454
228
229	if !mathextra.Float64AlmostEq(logZ, want, epsilon) {
230		t.Errorf("LogProdNorm(a, a) == %.13f, want %.13f", logZ, want)
231	}
232}
233
234func TestLogProdNorm1234(t *testing.T) {
235	// From moserware/Skills:
236	// > Verified with Ralf Herbrich's F# implementation
237	a := NewFromMeanAndStdDev(1, 2)
238	b := NewFromMeanAndStdDev(3, 4)
239	logZ := LogProdNorm(a, b)
240
241	want := -2.5168046699816684
242
243	if !mathextra.Float64AlmostEq(logZ, want, epsilon) {
244		t.Errorf("LogProdNorm(a, a) == %.13f, want %.13f", logZ, want)
245	}
246}
247
248func TestLogRatioNorm(t *testing.T) {
249	// Values taken from Ralf Herbrich's F# TrueSkill implementation
250	a := NewFromPrecision(0.5198963866537470, 0.0170487568409878)
251	b := NewFromPrecision(0.2879769618430530, 0.0115190784737221)
252	logZ := LogRatioNorm(a, b)
253
254	want := 4.2499118707392800
255
256	if !mathextra.Float64AlmostEq(logZ, want, epsilon) {
257		t.Errorf("LogProdNorm(a, a) == %.13f, want %.13f", logZ, want)
258	}
259}
260
261func TestLogRatioNorm1234(t *testing.T) {
262	// From moserware/Skills:
263	// > Verified with Ralf Herbrich's F# implementation
264	a := NewFromMeanAndStdDev(1, 2)
265	b := NewFromMeanAndStdDev(3, 4)
266	logZ := LogRatioNorm(a, b)
267
268	want := 2.6157405972171204
269
270	if !mathextra.Float64AlmostEq(logZ, want, epsilon) {
271		t.Errorf("LogProdNorm(a, a) == %.13f, want %.13f", logZ, want)
272	}
273}
274
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Trigger eq code on LambdaTest Cloud Grid

Execute automation tests with eq on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)