This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcond_test.go
778 lines (662 loc) · 18.4 KB
/
cond_test.go
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
package stackage
import (
"bytes"
"fmt"
"testing"
)
func ExampleCondition_Auxiliary() {
var c Condition
c.Init()
// one can put anything they wish into this map,
// so we'll do a bytes.Buffer since it is simple
// and commonplace.
var buf *bytes.Buffer = &bytes.Buffer{}
_, _ = buf.WriteString(`some .... data .....`)
// Create our map (one could also use make
// and populate it piecemeal as opposed to
// in-line, as we do below).
c.SetAuxiliary(map[string]any{
`buffer`: buf,
})
// Call our map and call its 'Get' method in one-shot
if val, ok := c.Auxiliary().Get(`buffer`); ok {
fmt.Printf("%s", val)
}
// Output: some .... data .....
}
func ExampleCondition_SetAuxiliary() {
var c Condition
c.Init()
// alloc map
aux := make(Auxiliary, 0)
// populate map
aux.Set(`somethingWeNeed`, struct {
Type string
Value []string
}{
Type: `L`,
Value: []string{
`abc`,
`def`,
},
})
// assign map to condition rcvr
c.SetAuxiliary(aux)
// verify presence
call := c.Auxiliary()
fmt.Printf("%T found, length:%d", call, call.Len())
// Output: stackage.Auxiliary found, length:1
}
/*
This example demonstrates the call and (failed) set of an
uninitialized Auxiliary instance. While no panic ensues,
the map instance is not writable.
The user must instead follow the procedures in the WithInit,
UserInit or ByTypeCast examples.
*/
func ExampleCondition_Auxiliary_noInit() {
var c Condition = Cond(`keyword`, Eq, `value`)
aux := c.Auxiliary()
fmt.Printf("%T found, length:%d",
aux, aux.Set(`testing`, `123`).Len())
// Output: stackage.Auxiliary found, length:0
}
/*
This example continues the concepts within the NoInit example,
except in this case proper initialization occurs and a desirable
outcome is achieved.
*/
func ExampleCondition_Auxiliary_withInit() {
var c Condition = Cond(`keyword`, Eq, `value`)
c.SetAuxiliary() // auto-init
aux := c.Auxiliary()
fmt.Printf("%T found, length was:%d, is now:%d",
aux,
aux.Len(), // check initial (pre-set) length
aux.Set(`testing`, `123`).Len()) // fluent Set/Len in one shot
// Output: stackage.Auxiliary found, length was:0, is now:1
}
/*
This example demonstrates a scenario similar to that of the WithInit
example, except in this case the map instance is entirely created and
populated by the user in a traditional fashion.
*/
func ExampleCondition_Auxiliary_userInit() {
var c Condition = Cond(`keyword`, Eq, `value`)
aux := make(Auxiliary, 0)
// user opts to just use standard map
// key/val set procedure, and avoids
// use of the convenience methods.
// This is totally fine.
aux[`value1`] = []int{1, 2, 3, 4, 5}
aux[`value2`] = [2]any{float64(7.014), rune('#')}
c.SetAuxiliary(aux)
fmt.Printf("%T length:%d", aux, len(aux))
// Output: stackage.Auxiliary length:2
}
/*
This example demonstrates building of the Auxiliary map in its generic
form (map[string]any) before being type cast to Auxiliary.
*/
func ExampleCondition_Auxiliary_byTypeCast() {
var c Condition = Cond(`keyword`, Eq, `value`)
proto := make(map[string]any, 0)
proto[`value1`] = []int{1, 2, 3, 4, 5}
proto[`value2`] = [2]any{float64(7.014), rune('#')}
c.SetAuxiliary(Auxiliary(proto)) // cast proto and assign to stack
aux := c.Auxiliary() // call map to variable
fmt.Printf("%T length:%d", aux, aux.Len())
// Output: stackage.Auxiliary length:2
}
func TestCondition_SetAuxiliary(t *testing.T) {
var c Condition = Cond(`keyword`, Eq, `value`)
// alloc map
aux := make(Auxiliary, 0)
// populate map
aux.Set(`somethingWeNeed`, struct {
Type string
Value []string
}{
Type: `L`,
Value: []string{
`abc`,
`def`,
},
})
// assign map to stack rcvr
c.SetAuxiliary(aux)
// test that it was assigned properly
var call Auxiliary = c.Auxiliary()
if call == nil {
t.Errorf("%s failed: %T nil", t.Name(), call)
return
}
// make sure the contents are present
want := 1
if length := call.Len(); length != want {
t.Errorf("%s failed: unexpected length; want %d, got %d",
t.Name(), want, length)
return
}
}
func ExampleCond() {
fmt.Printf("%s", Cond(`π`, Eq, float64(3.14159265358979323)))
// Output: π = 3.141593
}
func ExampleCondition_CanNest() {
c := Cond(`π`, Eq, float64(3.14159265358979323))
c.NoNesting(true)
fmt.Printf("Can nest: %t", c.CanNest())
// Output: Can nest: false
}
func ExampleCondition_Category() {
c := Cond(`π`, Eq, float64(3.14159265358979323))
c.SetCategory(`mathematical constant`)
fmt.Printf("Category: %s", c.Category())
// Output: Category: mathematical constant
}
func ExampleCondition_SetCategory() {
c := Cond(`π`, Eq, float64(3.14159265358979323))
c.SetCategory(`mathematical constant`)
fmt.Printf("Category: %s", c.Category())
// Output: Category: mathematical constant
}
func ExampleCondition_ID() {
c := Cond(`π`, Eq, float64(3.14159265358979323))
c.SetID(`pi`)
fmt.Printf("ID: %s", c.ID())
// Output: ID: pi
}
func ExampleCondition_SetID() {
c := Cond(`π`, Eq, float64(3.14159265358979323))
c.SetID(`pi`)
fmt.Printf("ID: %s", c.ID())
// Output: ID: pi
}
func ExampleCondition_Encap_doubleQuote() {
var c Condition
c.Init()
c.SetKeyword(`key`)
c.SetOperator(Eq)
c.SetExpression(`value`)
c.Encap(`"`)
fmt.Printf("%s", c)
// Output: key = "value"
}
func ExampleCondition_Encap_tag() {
var c Condition
c.Init()
c.SetKeyword(`key`)
c.SetOperator(Eq)
c.SetExpression(`value`)
c.Encap([]string{`<`, `>`})
fmt.Printf("%s", c)
// Output: key = <value>
}
func ExampleCondition_IsEncap() {
var c Condition = Cond(`key`, Eq, `value`)
c.Encap([]string{`<`, `>`})
fmt.Printf("%T expression is encapsulated: %t", c, c.IsEncap())
// Output: stackage.Condition expression is encapsulated: true
}
func ExampleCondition_Err() {
var c Condition = Cond(``, ComparisonOperator(7), `ThisIsBogus`)
fmt.Printf("%v", c.Err())
// Output: stackage.Condition keyword value is zero
}
/*
This example demonstrates use of the Condition.SetErr method to assign
a custom error to the receiver. This is useful in cases where custom
processing is being conducted, and a custom error needs to be preserved
and accessible to the caller.
*/
func ExampleCondition_SetErr() {
var c Condition = Cond(`mySupposedly`, Eq, `validCondition`)
c.SetErr(fmt.Errorf("Hold on there buddy, this is garbage"))
fmt.Printf("%v", c.Err())
// Output: Hold on there buddy, this is garbage
}
/*
This example demonstrates use of the Condition.SetErr method to clear
an error instance from the receiver. This may be useful in the event
that a problem has potentially been solved and a re-run of testing is
needed.
*/
func ExampleCondition_SetErr_clear() {
var c Condition = Cond(`mySupposedly`, Eq, `validCondition`)
c.SetErr(nil)
fmt.Printf("Nil: %t", c.Err() == nil)
// Output: Nil: true
}
func ExampleCondition_Expression() {
var c Condition
c.Init()
c.SetKeyword(`key`)
c.SetOperator(Eq)
c.SetExpression(`value`)
fmt.Printf("%s", c.Expression())
// Output: value
}
func ExampleCondition_Init() {
var c Condition
c.Init()
fmt.Printf("%T is initialized: %t", c, c.IsInit())
// Output: stackage.Condition is initialized: true
}
func ExampleCondition_IsInit() {
var c Condition
fmt.Printf("%T is initialized: %t", c, c.IsInit())
// Output: stackage.Condition is initialized: false
}
func ExampleCondition_IsFIFO() {
valueStack := And().SetFIFO(true).Push(`this`, `that`, `other`)
c := Cond(`stack`, Eq, valueStack)
fmt.Printf("%T is First-In/First-Out: %t", c, c.IsFIFO())
// Output: stackage.Condition is First-In/First-Out: true
}
func ExampleCondition_IsNesting() {
valueStack := And().Push(`this`, `that`, `other`)
c := Cond(`stack`, Eq, valueStack)
fmt.Printf("%T is nesting: %t", c, c.IsNesting())
// Output: stackage.Condition is nesting: true
}
func ExampleCondition_IsPadded() {
c := Cond(`keyword`, Eq, `value`)
fmt.Printf("%T is padded: %t", c, c.IsPadded())
// Output: stackage.Condition is padded: true
}
type customTestValue struct {
Type string
Value string
}
func (r customTestValue) String() string {
return sprintf("TYPE: %s; VALUE: %s", r.Type, r.Value)
}
type customTestKeyword uint8
const (
testKeyword01 customTestKeyword = 1 << iota
testKeyword02
testKeyword03
testKeyword04
testKeyword05
testKeyword06
)
func (r customTestKeyword) String() string {
switch r {
case testKeyword01:
return `keyword_01`
case testKeyword02:
return `keyword_02`
case testKeyword03:
return `keyword_03`
case testKeyword04:
return `keyword_04`
case testKeyword05:
return `keyword_05`
case testKeyword06:
return `keyword_06`
}
return `<unknown_keyword>`
}
func TestCondition_001(t *testing.T) {
c := Cond(`person`, Eq, `Jesse`)
want := `person = Jesse`
got := c.String()
if want != got {
t.Errorf("%s failed: want '%s', got '%s'", t.Name(), want, got)
}
}
func TestCondition_customKeyword(t *testing.T) {
var c Condition
c.Init() // always init
c.SetKeyword(testKeyword05)
c.SetOperator(Gt)
c.SetExpression(complex(2, 3))
if c.Keyword() != testKeyword05.String() {
t.Errorf("%s failed: want '%s', got '%s'", t.Name(), testKeyword05, c.Keyword())
}
want := `keyword_05 > (2+3i)`
if got := c.String(); got != want {
t.Errorf("%s failed: want '%s', got '%s'", t.Name(), want, got)
}
}
func TestComparisonOperator_String(t *testing.T) {
for _, cop := range []ComparisonOperator{
Eq, Ne, Lt, Gt, Le, Ge,
} {
if str := cop.String(); str == badOp {
t.Errorf("%s failed: got '%s' (unexpected)", t.Name(), str)
return
}
}
}
func TestCondition_customType(t *testing.T) {
cv := customTestValue{Type: `Color`, Value: `Red`}
var c Condition
c.Init() // always init
c.SetKeyword(testKeyword05)
c.SetOperator(Ne)
c.SetExpression(cv)
want := `keyword_05 != TYPE: Color; VALUE: Red`
if got := c.String(); got != want {
t.Errorf("%s failed: want '%s', got '%s'", t.Name(), want, got)
}
}
func TestCondition_002(t *testing.T) {
st := List().Paren().Push(
Cond(`person`, Eq, `Jesse`),
)
want := `( person = Jesse )`
if got := st.String(); want != got {
t.Errorf("%s failed: want '%s', got '%s'", t.Name(), want, got)
}
}
func TestCondition_IsParen(t *testing.T) {
cond := List().Paren().Push(
Cond(`person`, Eq, `Jesse`),
)
if got := cond.IsParen(); !got {
t.Errorf("%s failed: want 'true', got '%t'", t.Name(), got)
}
}
func TestCondition_NoNesting(t *testing.T) {
var c Condition = Cond(`myKeyword`, Eq, `temporary_value`)
c.NoNesting(true)
if c.CanNest() {
t.Errorf("%s failed: want '%t', got '%t'", t.Name(), false, true)
return
}
c.SetExpression(And().Push(`this`, `that`))
// value should NOT have been assigned.
if _, asserted := c.Expression().(string); !asserted {
t.Errorf("%s failed: want '%t', got '%t' [%T]", t.Name(), false, asserted, c.Expression())
}
}
func TestCondition_CanNest(t *testing.T) {
var c Condition
c.NoNesting(true)
if c.CanNest() {
t.Errorf("%s failed: want '%t', got '%t'", t.Name(), false, true)
}
}
func TestCondition_IsNesting(t *testing.T) {
var c Condition
c.Init() // always init
c.SetKeyword(`myKeyword`)
c.SetOperator(Eq)
c.SetExpression(And().Push(`this`, `that`))
if !c.IsNesting() {
t.Errorf("%s failed: want '%t', got '%t'", t.Name(), true, false)
}
}
//func TestCondition_IsPadded(t *testing.T) {
// cond := Cond(`person`, Eq, `Jesse`).Paren().Encap(`"`).NoPadding(false)
//
// if got := cond.IsPadded(); got {
// t.Errorf("%s failed: want 'false', got '%t'", t.Name(), got)
// }
//}
func TestCondition_IsEncap(t *testing.T) {
cond := Cond(`person`, Eq, `Jesse`).Paren().Encap(`"`).NoPadding()
if got := cond.IsEncap(); !got {
t.Errorf("%s failed: want 'true', got '%t'", t.Name(), got)
}
}
/*
This example demonstrates the act of a one-shot creation of an instance
of Condition using the Cond package-level function. All values must be
non-zero/non-nil. This is useful in cases where users have all of the
information they need and simply want to fashion a Condition quickly.
Note: line-breaks added for readability; no impact on functionality,
so long as dot sequence "connectors" (.) are honored where required.
*/
func ExampleCondition_oneShot() {
c := Cond(`person`, Eq, `Jesse`).
Paren().
Encap(`"`).
NoPadding()
fmt.Printf("%s", c)
// Output: (person="Jesse")
}
func ExampleCondition_String() {
c := Cond(`person`, Eq, `Jesse`).
Paren().
Encap(`"`).
NoPadding()
fmt.Printf("%s", c)
// Output: (person="Jesse")
}
func ExampleCondition_Valid() {
c := Cond(`person`, Eq, `Jesse`).
Paren().
Encap(`"`).
NoPadding()
fmt.Printf("Valid: %t", c.Valid() == nil)
// Output: Valid: true
}
/*
This example demonstrates the act of procedural assembly of an instance
of Condition. The variable c is defined and not initialized. Its values
are not set until "later" in the users code, and are set independently
of one another.
Note that with this technique a manual call of the Init method is always
required as the first action following variable declaration. When using
the "one-shot" technique by way of the Cond package-level function, the
process of initialization is handled automatically for the user.
*/
func ExampleCondition_procedural() {
var c Condition
c.Init() // always init
c.Paren()
c.SetKeyword(`myKeyword`)
c.SetOperator(Eq)
c.SetExpression(`value123`)
fmt.Printf("%s", c)
// Output: ( myKeyword = value123 )
}
/*
This example demonstrates use of the Addr method to obtain the string
representation of the memory address for the underlying embedded receiver
instance.
NOTE: Since the address will usually be something different each runtime,
we can't reliably test this in literal fashion, so we do a simple prefix
check as an alternative.
*/
func ExampleCondition_Addr() {
var c Condition
c.Init()
fmt.Printf("Address prefix valid: %t", c.Addr()[:2] == `0x`)
// Address prefix valid: true
}
func ExampleCondition_SetExpression() {
var c Condition
c.Init()
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.SetExpression(1.456)
fmt.Printf("Expr type: %T", c.Expression())
// Output: Expr type: float64
}
func ExampleCondition_Operator() {
var c Condition
c.Init()
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.SetExpression(1.456)
fmt.Printf("Operator: %s", c.Operator())
// Output: Operator: >=
}
func ExampleCondition_SetOperator() {
var c Condition
c.Init()
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.SetExpression(1.456)
fmt.Printf("Operator: %s", c.Operator())
// Output: Operator: >=
}
func ExampleCondition_Paren() {
var c Condition
c.Init()
c.Paren() // toggle to true from false default
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.SetExpression(1.456)
fmt.Printf("%s", c)
// Output: ( keyword >= 1.456000 )
}
func ExampleCondition_IsParen() {
var c Condition
c.Init()
c.Paren() // toggle to true from false default
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.SetExpression(1.456)
fmt.Printf("Is parenthetical: %t", c.IsParen())
// Output: Is parenthetical: true
}
func ExampleCondition_IsZero() {
var c Condition
fmt.Printf("Zero: %t", c.IsZero())
// Output: Zero: true
}
func ExampleCondition_SetKeyword() {
var c Condition
c.Init()
c.SetKeyword(`my_keyword`)
fmt.Printf("Keyword: %s", c.Keyword())
// Output: Keyword: my_keyword
}
func ExampleCondition_Keyword() {
var c Condition
c.Init()
c.SetKeyword(`my_keyword`)
fmt.Printf("Keyword: %s", c.Keyword())
// Output: Keyword: my_keyword
}
func ExampleCondition_NoNesting() {
var c Condition
c.Init()
c.Paren() // toggle to true from false default
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.NoNesting(true)
c.SetExpression(
And().Push(`this`, `won't`, `work`),
)
fmt.Printf("%v", c.Expression())
// Output: <nil>
}
func ExampleCondition_NoPadding() {
var c Condition
c.Init()
c.NoPadding(true)
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
c.SetExpression(`expression`)
fmt.Printf("%s", c)
// Output: keyword>=expression
}
func ExampleCondition_Len() {
var c Condition
c.Init()
c.Paren() // toggle to true from false default
c.SetKeyword(`keyword`)
c.SetOperator(Ge)
noLen := c.Len()
c.SetExpression(`just_a_string`)
strLen := c.Len()
// Overwrite the above string
// with a stack containing
// three (3) strings.
S := And().Push(`this`, `won't`, `work`)
c.SetExpression(S)
stkLen := c.Len()
fmt.Printf("length with nothing: %d\nlength with string: %d\nlength with %T: %d", noLen, strLen, S, stkLen)
// Output:
// length with nothing: 0
// length with string: 1
// length with stackage.Stack: 3
}
func ExampleCondition_SetID_random() {
var c Condition = Cond(`keyword`, Ne, `bogus`)
// can't predict what ID will
// be, so we'll check length
// which should always be 24.
c.SetID(`_random`)
fmt.Printf("Random ID len: %d", len(c.ID()))
// Output: Random ID len: 24
}
func ExampleCondition_SetID_pointerAddress() {
var c Condition = Cond(`keyword`, Ne, `bogus`)
// can't predict what ID will be,
// so we'll check the prefix to
// be certain it begins with '0x'.
c.SetID(`_addr`)
fmt.Printf("Address ID has '0x' prefix: %t", c.ID()[:2] == `0x`)
// Output: Address ID has '0x' prefix: true
}
/*
This example offers a naïve demonstration of a user-authored
type alias for the Condition type.
In a practical scenario, a user would likely want to write
custom methods to perform new tasks and/or wrap any existing
Condition methods desired in order to avoid the frequent need
to cast a custom type to the native stackage.Condition type.
As this is an example, we'll perform a simple cast merely to
demonstrate the type was cast successfully.
*/
func ExampleCondition_typeAlias() {
type customCondition Condition
var c Condition = Cond(`keyword`, Ne, `Value`)
fmt.Printf("%s (%T)",
Condition(customCondition(c)),
customCondition(c),
)
// Output: keyword != Value (stackage.customCondition)
}
func TestCondition_codecov(t *testing.T) {
var c Condition
// panic checks
c.Len()
c.IsZero()
c.IsInit()
c.Expression()
c.Operator()
c.Keyword()
c.Valid()
c.SetAuxiliary(nil)
c.Init()
c.Paren()
c.Paren(true)
c.Paren(false)
c.SetKeyword(`valid_keyword`)
c.Valid()
c.SetOperator(Ne)
c.SetAuxiliary(nil)
c.Valid()
c.SetExpression(rune(1438))
_ = c.String()
c.SetExpression(true)
_ = c.String()
c.SetExpression(float32(3.6663))
_ = c.String()
c.SetExpression(1438)
_ = c.String()
c.SetExpression(uint8(10))
_ = c.String()
c.SetExpression(`string`)
_ = c.String()
c.SetOperator(ComparisonOperator(77))
c.Encap()
c.Encap(`<<`, `>>`)
c.Encap(``, ``)
c.Encap(`<<`, `<<`)
c.Encap(`"`)
c.Valid()
type customCondition Condition
var cx Condition = Cond(`keyword`, Ne, `Value`)
if Cx, ok := conditionTypeAliasConverter(customCondition(cx)); !ok {
t.Errorf("%s failed: %T->%T conversion failure", t.Name(), cx, Cx)
}
}