11//
22// DISCLAIMER
33//
4- // Copyright 2018-2023 ArangoDB GmbH, Cologne, Germany
4+ // Copyright 2018-2024 ArangoDB GmbH, Cologne, Germany
55//
66// Licensed under the Apache License, Version 2.0 (the "License");
77// you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import (
2828 "github.com/stretchr/testify/require"
2929
3030 "github.com/arangodb/go-driver"
31+ "github.com/arangodb/go-driver/util"
3132)
3233
3334func newInt (v int ) * int {
@@ -139,7 +140,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
139140 Properties : driver.ArangoSearchAnalyzerProperties {
140141 Min : newInt64 (1 ),
141142 Max : newInt64 (14 ),
142- PreserveOriginal : newBool (false ),
143+ PreserveOriginal : util . NewType (false ),
143144 },
144145 },
145146 },
@@ -152,7 +153,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
152153 Properties : driver.ArangoSearchAnalyzerProperties {
153154 Min : newInt64 (1 ),
154155 Max : newInt64 (14 ),
155- PreserveOriginal : newBool (false ),
156+ PreserveOriginal : util . NewType (false ),
156157 },
157158 },
158159 ExpectedDefinition : & driver.ArangoSearchAnalyzerDefinition {
@@ -161,7 +162,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
161162 Properties : driver.ArangoSearchAnalyzerProperties {
162163 Min : newInt64 (1 ),
163164 Max : newInt64 (14 ),
164- PreserveOriginal : newBool (false ),
165+ PreserveOriginal : util . NewType (false ),
165166
166167 // Check defaults for 3.6
167168 StartMarker : newString ("" ),
@@ -179,7 +180,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
179180 Properties : driver.ArangoSearchAnalyzerProperties {
180181 Min : newInt64 (1 ),
181182 Max : newInt64 (14 ),
182- PreserveOriginal : newBool (false ),
183+ PreserveOriginal : util . NewType (false ),
183184 StartMarker : newString ("^" ),
184185 EndMarker : newString ("^" ),
185186 StreamType : newArangoSearchNGramStreamType (driver .ArangoSearchNGramStreamUTF8 ),
@@ -199,7 +200,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
199200 Properties : driver.ArangoSearchAnalyzerProperties {
200201 Min : newInt64 (1 ),
201202 Max : newInt64 (14 ),
202- PreserveOriginal : newBool (false ),
203+ PreserveOriginal : util . NewType (false ),
203204 StartMarker : newString ("^" ),
204205 EndMarker : newString ("^" ),
205206 StreamType : newArangoSearchNGramStreamType (driver .ArangoSearchNGramStreamUTF8 ),
@@ -217,11 +218,11 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
217218 Type : driver .ArangoSearchAnalyzerTypeAQL ,
218219 Properties : driver.ArangoSearchAnalyzerProperties {
219220 QueryString : `FOR year IN [ 2011, 2012, 2013 ] FOR quarter IN [ 1, 2, 3, 4 ] RETURN { year, quarter, formatted: CONCAT(quarter, " / ", year)}` ,
220- CollapsePositions : newBool (true ),
221- KeepNull : newBool (false ),
222- BatchSize : newInt (10 ),
221+ CollapsePositions : util . NewType (true ),
222+ KeepNull : util . NewType (false ),
223+ BatchSize : util . NewType (10 ),
223224 ReturnType : driver .ArangoSearchAnalyzerAQLReturnTypeString .New (),
224- MemoryLimit : newInt (1024 * 1024 ),
225+ MemoryLimit : util . NewType (1024 * 1024 ),
225226 },
226227 },
227228 },
@@ -233,9 +234,9 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
233234 Type : driver .ArangoSearchAnalyzerTypeGeoPoint ,
234235 Properties : driver.ArangoSearchAnalyzerProperties {
235236 Options : & driver.ArangoSearchAnalyzerGeoOptions {
236- MaxCells : newInt (20 ),
237- MinLevel : newInt (4 ),
238- MaxLevel : newInt (23 ),
237+ MaxCells : util . NewType (20 ),
238+ MinLevel : util . NewType (4 ),
239+ MaxLevel : util . NewType (23 ),
239240 },
240241 Latitude : []string {},
241242 Longitude : []string {},
@@ -250,9 +251,9 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
250251 Type : driver .ArangoSearchAnalyzerTypeGeoJSON ,
251252 Properties : driver.ArangoSearchAnalyzerProperties {
252253 Options : & driver.ArangoSearchAnalyzerGeoOptions {
253- MaxCells : newInt (20 ),
254- MinLevel : newInt (4 ),
255- MaxLevel : newInt (23 ),
254+ MaxCells : util . NewType (20 ),
255+ MinLevel : util . NewType (4 ),
256+ MaxLevel : util . NewType (23 ),
256257 },
257258 Type : driver .ArangoSearchAnalyzerGeoJSONTypeShape .New (),
258259 },
@@ -267,9 +268,9 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
267268 Properties : driver.ArangoSearchAnalyzerProperties {
268269 Format : driver .FormatLatLngInt .New (),
269270 Options : & driver.ArangoSearchAnalyzerGeoOptions {
270- MaxCells : newInt (20 ),
271- MinLevel : newInt (4 ),
272- MaxLevel : newInt (23 ),
271+ MaxCells : util . NewType (20 ),
272+ MinLevel : util . NewType (4 ),
273+ MaxLevel : util . NewType (23 ),
273274 },
274275 Type : driver .ArangoSearchAnalyzerGeoJSONTypeShape .New (),
275276 },
@@ -280,9 +281,9 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
280281 Properties : driver.ArangoSearchAnalyzerProperties {
281282 Format : driver .FormatLatLngInt .New (),
282283 Options : & driver.ArangoSearchAnalyzerGeoOptions {
283- MaxCells : newInt (20 ),
284- MinLevel : newInt (4 ),
285- MaxLevel : newInt (23 ),
284+ MaxCells : util . NewType (20 ),
285+ MinLevel : util . NewType (4 ),
286+ MaxLevel : util . NewType (23 ),
286287 },
287288 Type : driver .ArangoSearchAnalyzerGeoJSONTypeShape .New (),
288289 },
@@ -326,7 +327,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
326327 Name : "my-stopWords" ,
327328 Type : driver .ArangoSearchAnalyzerTypeStopwords ,
328329 Properties : driver.ArangoSearchAnalyzerProperties {
329- Hex : newBool (true ),
330+ Hex : util . NewType (true ),
330331 Stopwords : []string {
331332 "616e64" ,
332333 "746865" ,
@@ -337,7 +338,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
337338 Name : "my-stopWords" ,
338339 Type : driver .ArangoSearchAnalyzerTypeStopwords ,
339340 Properties : driver.ArangoSearchAnalyzerProperties {
340- Hex : newBool (true ),
341+ Hex : util . NewType (true ),
341342 Stopwords : []string {
342343 "616e64" ,
343344 "746865" ,
@@ -356,7 +357,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
356357 Analyzer : & driver.ArangoSearchAnalyzerDefinition {
357358 Type : driver .ArangoSearchAnalyzerTypeStopwords ,
358359 Properties : driver.ArangoSearchAnalyzerProperties {
359- Hex : newBool (true ),
360+ Hex : util . NewType (true ),
360361 Stopwords : []string {
361362 "616e64" ,
362363 "746865" ,
@@ -373,7 +374,7 @@ func TestArangoSearchAnalyzerEnsureAnalyzer(t *testing.T) {
373374 Analyzer : & driver.ArangoSearchAnalyzerDefinition {
374375 Type : driver .ArangoSearchAnalyzerTypeStopwords ,
375376 Properties : driver.ArangoSearchAnalyzerProperties {
376- Hex : newBool (true ),
377+ Hex : util . NewType (true ),
377378 Stopwords : []string {
378379 "616e64" ,
379380 "746865" ,
@@ -450,7 +451,7 @@ func TestArangoSearchAnalyzerGet(t *testing.T) {
450451 Properties : driver.ArangoSearchAnalyzerProperties {
451452 Min : newInt64 (1 ),
452453 Max : newInt64 (14 ),
453- PreserveOriginal : newBool (false ),
454+ PreserveOriginal : util . NewType (false ),
454455 },
455456 }
456457 ensureAnalyzer (ctx , db , def , t )
@@ -484,7 +485,7 @@ func TestArangoSearchAnalyzerGetAll(t *testing.T) {
484485 Properties : driver.ArangoSearchAnalyzerProperties {
485486 Min : newInt64 (1 ),
486487 Max : newInt64 (14 ),
487- PreserveOriginal : newBool (false ),
488+ PreserveOriginal : util . NewType (false ),
488489 },
489490 }
490491 ensureAnalyzer (ctx , db , def , t )
@@ -524,7 +525,7 @@ func TestArangoSearchAnalyzerRemove(t *testing.T) {
524525 Properties : driver.ArangoSearchAnalyzerProperties {
525526 Min : newInt64 (1 ),
526527 Max : newInt64 (14 ),
527- PreserveOriginal : newBool (false ),
528+ PreserveOriginal : util . NewType (false ),
528529 },
529530 }
530531 a := ensureAnalyzer (ctx , db , def , t )
0 commit comments