How to use New method of venom Package

Best Venom code snippet using venom.New

decode_test.go

Source:decode_test.go Github

copy

Full Screen

...63 expect *configStruct64 }{65 {66 tc: "should unmarshal with empty venom",67 v: New(),68 expect: &configStruct{},69 },70 {71 tc: "should ignore hyphen values",72 v: func() *Venom {73 ven := New()74 ven.SetDefault("ignored", 12)75 return ven76 }(),77 expect: &configStruct{},78 },79 {80 tc: "should unmarshal values",81 v: func() *Venom {82 ven := New()83 ven.SetDefault("delay", 12)84 ven.SetDefault("name", "foobar")85 ven.SetDefault("enabled", true)86 // int87 ven.SetDefault("int8", int8(8))88 ven.SetDefault("int16", int16(16))89 ven.SetDefault("int32", int32(32))90 ven.SetDefault("int64", int64(64))91 // uint92 ven.SetDefault("uint", uint(1))93 ven.SetDefault("uint8", uint8(8))94 ven.SetDefault("uint16", uint16(16))95 ven.SetDefault("uint32", uint32(32))96 ven.SetDefault("uint64", uint64(64))97 // floats98 ven.SetDefault("float32", float32(32.0))99 ven.SetDefault("float64", float64(64.0))100 return ven101 }(),102 expect: &configStruct{103 Delay: 12,104 Name: "foobar",105 Enabled: true,106 Int8: 8,107 Int16: 16,108 Int32: 32,109 Int64: 64,110 Uint: 1,111 Uint8: 8,112 Uint16: 16,113 Uint32: 32,114 Uint64: 64,115 Float32: 32.0,116 Float64: 64.0,117 },118 },119 {120 tc: "should use global venom",121 v: func() *Venom {122 v.Clear()123 v.SetDefault("delay", 12)124 v.SetDefault("name", "foobar")125 return nil126 }(),127 expect: &configStruct{128 Delay: 12,129 Name: "foobar",130 },131 },132 {133 tc: "should error coercing string from int",134 v: func() *Venom {135 ven := New()136 ven.SetDefault("name", 12)137 return ven138 }(),139 err: &CoerceErr{From: 12, To: "string"},140 expect: &configStruct{},141 },142 {143 tc: "should error coercing bool from string",144 v: func() *Venom {145 ven := New()146 ven.SetDefault("enabled", "foobar")147 return ven148 }(),149 err: &CoerceErr{From: "foobar", To: "bool"},150 expect: &configStruct{},151 },152 {153 tc: "should error coercing int from string",154 v: func() *Venom {155 ven := New()156 ven.SetDefault("delay", "foobar")157 return ven158 }(),159 err: &CoerceErr{From: "foobar", To: "int"},160 expect: &configStruct{},161 },162 {163 tc: "should error coercing int8 from string",164 v: func() *Venom {165 ven := New()166 ven.SetDefault("int8", "foobar")167 return ven168 }(),169 err: &CoerceErr{From: "foobar", To: "int8"},170 expect: &configStruct{},171 },172 {173 tc: "should error coercing int16 from string",174 v: func() *Venom {175 ven := New()176 ven.SetDefault("int16", "foobar")177 return ven178 }(),179 err: &CoerceErr{From: "foobar", To: "int16"},180 expect: &configStruct{},181 },182 {183 tc: "should error coercing int32 from string",184 v: func() *Venom {185 ven := New()186 ven.SetDefault("int32", "foobar")187 return ven188 }(),189 err: &CoerceErr{From: "foobar", To: "int32"},190 expect: &configStruct{},191 },192 {193 tc: "should error coercing int64 from string",194 v: func() *Venom {195 ven := New()196 ven.SetDefault("int64", "foobar")197 return ven198 }(),199 err: &CoerceErr{From: "foobar", To: "int64"},200 expect: &configStruct{},201 },202 {203 tc: "should error coercing uint from string",204 v: func() *Venom {205 ven := New()206 ven.SetDefault("uint", "foobar")207 return ven208 }(),209 err: &CoerceErr{From: "foobar", To: "uint"},210 expect: &configStruct{},211 },212 {213 tc: "should error coercing uint8 from string",214 v: func() *Venom {215 ven := New()216 ven.SetDefault("uint8", "foobar")217 return ven218 }(),219 err: &CoerceErr{From: "foobar", To: "uint8"},220 expect: &configStruct{},221 },222 {223 tc: "should error coercing uint16 from string",224 v: func() *Venom {225 ven := New()226 ven.SetDefault("uint16", "foobar")227 return ven228 }(),229 err: &CoerceErr{From: "foobar", To: "uint16"},230 expect: &configStruct{},231 },232 {233 tc: "should error coercing uint32 from string",234 v: func() *Venom {235 ven := New()236 ven.SetDefault("uint32", "foobar")237 return ven238 }(),239 err: &CoerceErr{From: "foobar", To: "uint32"},240 expect: &configStruct{},241 },242 {243 tc: "should error coercing uint64 from string",244 v: func() *Venom {245 ven := New()246 ven.SetDefault("uint64", "foobar")247 return ven248 }(),249 err: &CoerceErr{From: "foobar", To: "uint64"},250 expect: &configStruct{},251 },252 {253 tc: "should error coercing float32 from string",254 v: func() *Venom {255 ven := New()256 ven.SetDefault("float32", "foobar")257 return ven258 }(),259 err: &CoerceErr{From: "foobar", To: "float32"},260 expect: &configStruct{},261 },262 {263 tc: "should error coercing float64 from string",264 v: func() *Venom {265 ven := New()266 ven.SetDefault("float64", "foobar")267 return ven268 }(),269 err: &CoerceErr{From: "foobar", To: "float64"},270 expect: &configStruct{},271 },272 }273 for _, test := range testIO {274 t.Run(test.tc, func(t *testing.T) {275 var conf configStruct276 err := Unmarshal(test.v, &conf)277 assertEqualErrors(t, test.err, err)278 assert.Equal(t, test.expect, &conf)279 })280 }281}282func TestInvalidUnmarshalError(t *testing.T) {283 testIO := []struct {284 tc string285 v *Venom286 conf interface{}287 err error288 }{289 {290 tc: "should err due to nil config",291 v: New(),292 conf: nil,293 err: &InvalidUnmarshalError{reflect.TypeOf(nil)},294 },295 {296 tc: "should err due to nil config",297 v: New(),298 conf: configStruct{},299 err: &InvalidUnmarshalError{reflect.TypeOf(configStruct{})},300 },301 {302 tc: "should err due to nil config",303 v: New(),304 conf: func() interface{} {305 var c *configStruct306 return c307 }(),308 err: func() error {309 var c *configStruct310 return &InvalidUnmarshalError{reflect.TypeOf(c)}311 }(),312 },313 }314 for _, test := range testIO {315 t.Run(test.tc, func(t *testing.T) {316 err := Unmarshal(test.v, test.conf)317 assertEqualErrors(t, test.err, err)318 })319 }320}321func TestUnmarshalNested(t *testing.T) {322 testIO := []struct {323 tc string324 v *Venom325 err error326 expect *nestedConfig327 }{328 {329 tc: "should load nested",330 v: func() *Venom {331 ven := New()332 ven.SetDefault("something_special", "special")333 ven.SetDefault("basic.uint8", uint8(8))334 ven.SetDefault("basic2.uint16", uint16(16))335 return ven336 }(),337 expect: &nestedConfig{338 SomethingSpecial: "special",339 Basic: configStruct{340 Uint8: 8,341 },342 BasicPtr: &configStruct{343 Uint16: 16,344 },345 },346 },347 }348 for _, test := range testIO {349 t.Run(test.tc, func(t *testing.T) {350 conf := nestedConfig{351 BasicPtr: &configStruct{},352 }353 err := Unmarshal(test.v, &conf)354 assertEqualErrors(t, test.err, err)355 assert.Equal(t, test.expect, &conf)356 })357 }358}359func TestUnmarshalSlice(t *testing.T) {360 testIO := []struct {361 tc string362 v *Venom363 err error364 expect *sliceConfig365 }{366 {367 tc: "should unmarshal string slice",368 v: func() *Venom {369 ven := New()370 ven.SetDefault("strings", []string{"foo", "bar"})371 return ven372 }(),373 expect: &sliceConfig{374 Strings: []string{"foo", "bar"},375 },376 },377 {378 tc: "should unmarshal nil string slice",379 v: func() *Venom {380 ven := New()381 ven.SetDefault("strings", nil)382 return ven383 }(),384 expect: &sliceConfig{385 Strings: nil,386 },387 },388 {389 tc: "should unmarshal string interface{} slice",390 v: func() *Venom {391 ven := New()392 ven.SetDefault("strings", []interface{}{"foo", "bar"})393 return ven394 }(),395 expect: &sliceConfig{396 Strings: []string{"foo", "bar"},397 },398 },399 {400 tc: "should unmarshal bool slice",401 v: func() *Venom {402 ven := New()403 ven.SetDefault("bools", []bool{true, true, false})404 return ven405 }(),406 expect: &sliceConfig{407 Bools: []bool{true, true, false},408 },409 },410 {411 tc: "should unmarshal nil bool slice",412 v: func() *Venom {413 ven := New()414 ven.SetDefault("bools", nil)415 return ven416 }(),417 expect: &sliceConfig{418 Bools: nil,419 },420 },421 {422 tc: "should unmarshal bool interface{} slice",423 v: func() *Venom {424 ven := New()425 ven.SetDefault("bools", []interface{}{true, true, false})426 return ven427 }(),428 expect: &sliceConfig{429 Bools: []bool{true, true, false},430 },431 },432 {433 tc: "should unmarshal int slice",434 v: func() *Venom {435 ven := New()436 ven.SetDefault("ints", []int{0, 1})437 return ven438 }(),439 expect: &sliceConfig{440 Ints: []int{0, 1},441 },442 },443 {444 tc: "should unmarshal nil int slice",445 v: func() *Venom {446 ven := New()447 ven.SetDefault("ints", nil)448 return ven449 }(),450 expect: &sliceConfig{451 Ints: nil,452 },453 },454 {455 tc: "should unmarshal int interface{} slice",456 v: func() *Venom {457 ven := New()458 ven.SetDefault("ints", []interface{}{0, 1})459 return ven460 }(),461 expect: &sliceConfig{462 Ints: []int{0, 1},463 },464 },465 {466 tc: "should unmarshal int8 slice",467 v: func() *Venom {468 ven := New()469 ven.SetDefault("int8s", []int8{2, 3})470 return ven471 }(),472 expect: &sliceConfig{473 Int8s: []int8{2, 3},474 },475 },476 {477 tc: "should unmarshal nil int8 slice",478 v: func() *Venom {479 ven := New()480 ven.SetDefault("int8s", nil)481 return ven482 }(),483 expect: &sliceConfig{484 Int8s: nil,485 },486 },487 {488 tc: "should unmarshal int8 interface{} slice",489 v: func() *Venom {490 ven := New()491 ven.SetDefault("int8s", []interface{}{int8(2), int8(3)})492 return ven493 }(),494 expect: &sliceConfig{495 Int8s: []int8{2, 3},496 },497 },498 {499 tc: "should unmarshal int16 slice",500 v: func() *Venom {501 ven := New()502 ven.SetDefault("int16s", []int16{4, 5})503 return ven504 }(),505 expect: &sliceConfig{506 Int16s: []int16{4, 5},507 },508 },509 {510 tc: "should unmarshal nil int16 slice",511 v: func() *Venom {512 ven := New()513 ven.SetDefault("int16s", nil)514 return ven515 }(),516 expect: &sliceConfig{517 Int16s: nil,518 },519 },520 {521 tc: "should unmarshal int16 interface{} slice",522 v: func() *Venom {523 ven := New()524 ven.SetDefault("int16s", []interface{}{int16(2), int16(3)})525 return ven526 }(),527 expect: &sliceConfig{528 Int16s: []int16{2, 3},529 },530 },531 {532 tc: "should unmarshal int32 slice",533 v: func() *Venom {534 ven := New()535 ven.SetDefault("int32s", []int32{6, 7})536 return ven537 }(),538 expect: &sliceConfig{539 Int32s: []int32{6, 7},540 },541 },542 {543 tc: "should unmarshal nil int32 slice",544 v: func() *Venom {545 ven := New()546 ven.SetDefault("int32s", nil)547 return ven548 }(),549 expect: &sliceConfig{550 Int32s: nil,551 },552 },553 {554 tc: "should unmarshal int32 interface{} slice",555 v: func() *Venom {556 ven := New()557 ven.SetDefault("int32s", []interface{}{int32(2), int32(3)})558 return ven559 }(),560 expect: &sliceConfig{561 Int32s: []int32{2, 3},562 },563 },564 {565 tc: "should unmarshal int64 slice",566 v: func() *Venom {567 ven := New()568 ven.SetDefault("int64s", []int64{8, 9})569 return ven570 }(),571 expect: &sliceConfig{572 Int64s: []int64{8, 9},573 },574 },575 {576 tc: "should unmarshal nil int64 slice",577 v: func() *Venom {578 ven := New()579 ven.SetDefault("int64s", nil)580 return ven581 }(),582 expect: &sliceConfig{583 Int64s: nil,584 },585 },586 {587 tc: "should unmarshal int64 interface{} slice",588 v: func() *Venom {589 ven := New()590 ven.SetDefault("int64s", []interface{}{int64(2), int64(3)})591 return ven592 }(),593 expect: &sliceConfig{594 Int64s: []int64{2, 3},595 },596 },597 {598 tc: "should unmarshal uint slice",599 v: func() *Venom {600 ven := New()601 ven.SetDefault("uints", []uint{0, 1})602 return ven603 }(),604 expect: &sliceConfig{605 Uints: []uint{0, 1},606 },607 },608 {609 tc: "should unmarshal nil uint slice",610 v: func() *Venom {611 ven := New()612 ven.SetDefault("uints", nil)613 return ven614 }(),615 expect: &sliceConfig{616 Uints: nil,617 },618 },619 {620 tc: "should unmarshal uint interface{} slice",621 v: func() *Venom {622 ven := New()623 ven.SetDefault("uints", []interface{}{uint(2), uint(3)})624 return ven625 }(),626 expect: &sliceConfig{627 Uints: []uint{2, 3},628 },629 },630 {631 tc: "should unmarshal uint8 slice",632 v: func() *Venom {633 ven := New()634 ven.SetDefault("uint8s", []uint8{2, 3})635 return ven636 }(),637 expect: &sliceConfig{638 Uint8s: []uint8{2, 3},639 },640 },641 {642 tc: "should unmarshal nil uint8 slice",643 v: func() *Venom {644 ven := New()645 ven.SetDefault("uint8s", nil)646 return ven647 }(),648 expect: &sliceConfig{649 Uint8s: nil,650 },651 },652 {653 tc: "should unmarshal uint8 interface{} slice",654 v: func() *Venom {655 ven := New()656 ven.SetDefault("uint8s", []interface{}{uint8(2), uint8(3)})657 return ven658 }(),659 expect: &sliceConfig{660 Uint8s: []uint8{2, 3},661 },662 },663 {664 tc: "should unmarshal uint16 slice",665 v: func() *Venom {666 ven := New()667 ven.SetDefault("uint16s", []uint16{4, 5})668 return ven669 }(),670 expect: &sliceConfig{671 Uint16s: []uint16{4, 5},672 },673 },674 {675 tc: "should unmarshal nil uint16 slice",676 v: func() *Venom {677 ven := New()678 ven.SetDefault("uint16s", nil)679 return ven680 }(),681 expect: &sliceConfig{682 Uint16s: nil,683 },684 },685 {686 tc: "should unmarshal uint16 interface{} slice",687 v: func() *Venom {688 ven := New()689 ven.SetDefault("uint16s", []interface{}{uint16(2), uint16(3)})690 return ven691 }(),692 expect: &sliceConfig{693 Uint16s: []uint16{2, 3},694 },695 },696 {697 tc: "should unmarshal uint32 slice",698 v: func() *Venom {699 ven := New()700 ven.SetDefault("uint32s", []uint32{6, 7})701 return ven702 }(),703 expect: &sliceConfig{704 Uint32s: []uint32{6, 7},705 },706 },707 {708 tc: "should unmarshal nil uint32 slice",709 v: func() *Venom {710 ven := New()711 ven.SetDefault("uint32s", nil)712 return ven713 }(),714 expect: &sliceConfig{715 Uint32s: nil,716 },717 },718 {719 tc: "should unmarshal uint32 interface{} slice",720 v: func() *Venom {721 ven := New()722 ven.SetDefault("uint32s", []interface{}{uint32(2), uint32(3)})723 return ven724 }(),725 expect: &sliceConfig{726 Uint32s: []uint32{2, 3},727 },728 },729 {730 tc: "should unmarshal uint64 slice",731 v: func() *Venom {732 ven := New()733 ven.SetDefault("uint64s", []uint64{8, 9})734 return ven735 }(),736 expect: &sliceConfig{737 Uint64s: []uint64{8, 9},738 },739 },740 {741 tc: "should unmarshal nil uint64 slice",742 v: func() *Venom {743 ven := New()744 ven.SetDefault("uint64s", nil)745 return ven746 }(),747 expect: &sliceConfig{748 Uint64s: nil,749 },750 },751 {752 tc: "should unmarshal uint64 interface{} slice",753 v: func() *Venom {754 ven := New()755 ven.SetDefault("uint64s", []interface{}{uint64(2), uint64(3)})756 return ven757 }(),758 expect: &sliceConfig{759 Uint64s: []uint64{2, 3},760 },761 },762 {763 tc: "should unmarshal float32 slice",764 v: func() *Venom {765 ven := New()766 ven.SetDefault("float32s", []float32{0.0, 8675.309})767 return ven768 }(),769 expect: &sliceConfig{770 Float32s: []float32{0.0, 8675.309},771 },772 },773 {774 tc: "should unmarshal nil float32 slice",775 v: func() *Venom {776 ven := New()777 ven.SetDefault("float32s", nil)778 return ven779 }(),780 expect: &sliceConfig{781 Float32s: nil,782 },783 },784 {785 tc: "should unmarshal float32 interface{} slice",786 v: func() *Venom {787 ven := New()788 ven.SetDefault("float32s", []interface{}{float32(0.0), float32(8675.309)})789 return ven790 }(),791 expect: &sliceConfig{792 Float32s: []float32{0.0, 8675.309},793 },794 },795 {796 tc: "should unmarshal float64 slice",797 v: func() *Venom {798 ven := New()799 ven.SetDefault("float64s", []float64{0.0, 8675.309})800 return ven801 }(),802 expect: &sliceConfig{803 Float64s: []float64{0.0, 8675.309},804 },805 },806 {807 tc: "should unmarshal nil float64 slice",808 v: func() *Venom {809 ven := New()810 ven.SetDefault("float64s", nil)811 return ven812 }(),813 expect: &sliceConfig{814 Float64s: nil,815 },816 },817 {818 tc: "should unmarshal float64 interface{} slice",819 v: func() *Venom {820 ven := New()821 ven.SetDefault("float64s", []interface{}{float64(0.0), float64(8675.309)})822 return ven823 }(),824 expect: &sliceConfig{825 Float64s: []float64{0.0, 8675.309},826 },827 },828 {829 tc: "should unmarshal 2d slice",830 v: func() *Venom {831 ven := New()832 ven.SetDefault("int2d", [][]int{833 {0, 1, 2, 3, 4, 5},834 {6, 7, 8, 9, 10, 11},835 {12, 13, 14, 15, 16, 17},836 })837 return ven838 }(),839 expect: &sliceConfig{840 Int2D: [][]int{841 {0, 1, 2, 3, 4, 5},842 {6, 7, 8, 9, 10, 11},843 {12, 13, 14, 15, 16, 17},844 },845 },846 },847 {848 tc: "should unmarshal 3d slice",849 v: func() *Venom {850 ven := New()851 ven.SetDefault("int3d", [][][]int{852 {853 {0, 1, 2, 3, 4, 5},854 {6, 7, 8, 9, 10, 11},855 {12, 13, 14, 15, 16, 17},856 },857 {858 {18, 19, 20, 21, 22, 23},859 {24, 25, 26, 27, 28, 29},860 {30, 31, 32, 33, 34, 35},861 },862 })863 return ven864 }(),865 expect: &sliceConfig{866 Int3D: [][][]int{867 {868 {0, 1, 2, 3, 4, 5},869 {6, 7, 8, 9, 10, 11},870 {12, 13, 14, 15, 16, 17},871 },872 {873 {18, 19, 20, 21, 22, 23},874 {24, 25, 26, 27, 28, 29},875 {30, 31, 32, 33, 34, 35},876 },877 },878 },879 },880 {881 tc: "should error coercing string to slice of strings",882 v: func() *Venom {883 ven := New()884 ven.SetDefault("strings", "foobar")885 return ven886 }(),887 expect: new(sliceConfig),888 err: &CoerceErr{From: "foobar", To: "[]string"},889 },890 {891 tc: "should error coercing interface{} slice with invalid values to slice of strings",892 v: func() *Venom {893 ven := New()894 ven.SetDefault("strings", []interface{}{"foo", true})895 return ven896 }(),897 expect: new(sliceConfig),898 err: &CoerceErr{899 From: []interface{}{"foo", true},900 To: "[]string",901 Err: &CoerceErr{902 From: true,903 To: "string",904 },905 },906 },907 {908 tc: "should error coercing string to slice of bools",909 v: func() *Venom {910 ven := New()911 ven.SetDefault("bools", "foobar")912 return ven913 }(),914 expect: new(sliceConfig),915 err: &CoerceErr{From: "foobar", To: "[]bool"},916 },917 {918 tc: "should error coercing interface{} slice with invalid values to slice of bools",919 v: func() *Venom {920 ven := New()921 ven.SetDefault("bools", []interface{}{true, "false"})922 return ven923 }(),924 expect: new(sliceConfig),925 err: &CoerceErr{926 From: []interface{}{true, "false"},927 To: "[]bool",928 Err: &CoerceErr{929 From: "false",930 To: "bool",931 },932 },933 },934 {935 tc: "should error coercing string to slice of ints",936 v: func() *Venom {937 ven := New()938 ven.SetDefault("ints", "foobar")939 return ven940 }(),941 expect: new(sliceConfig),942 err: &CoerceErr{From: "foobar", To: "[]int"},943 },944 {945 tc: "should error coercing interface{} slice with invalid values to slice of ints",946 v: func() *Venom {947 ven := New()948 ven.SetDefault("ints", []interface{}{0, "foobar"})949 return ven950 }(),951 expect: new(sliceConfig),952 err: &CoerceErr{953 From: []interface{}{0, "foobar"},954 To: "[]int",955 Err: &CoerceErr{956 From: "foobar",957 To: "int",958 },959 },960 },961 {962 tc: "should error coercing string to slice of int8s",963 v: func() *Venom {964 ven := New()965 ven.SetDefault("int8s", "foobar")966 return ven967 }(),968 expect: new(sliceConfig),969 err: &CoerceErr{From: "foobar", To: "[]int8"},970 },971 {972 tc: "should error coercing interface{} slice with invalid values to slice of int8s",973 v: func() *Venom {974 ven := New()975 ven.SetDefault("int8s", []interface{}{int8(0), "foobar"})976 return ven977 }(),978 expect: new(sliceConfig),979 err: &CoerceErr{980 From: []interface{}{int8(0), "foobar"},981 To: "[]int8",982 Err: &CoerceErr{983 From: "foobar",984 To: "int8",985 },986 },987 },988 {989 tc: "should error coercing string to slice of int16s",990 v: func() *Venom {991 ven := New()992 ven.SetDefault("int16s", "foobar")993 return ven994 }(),995 expect: new(sliceConfig),996 err: &CoerceErr{From: "foobar", To: "[]int16"},997 },998 {999 tc: "should error coercing interface{} slice with invalid values to slice of int16s",1000 v: func() *Venom {1001 ven := New()1002 ven.SetDefault("int16s", []interface{}{int16(0), "foobar"})1003 return ven1004 }(),1005 expect: new(sliceConfig),1006 err: &CoerceErr{1007 From: []interface{}{int16(0), "foobar"},1008 To: "[]int16",1009 Err: &CoerceErr{1010 From: "foobar",1011 To: "int16",1012 },1013 },1014 },1015 {1016 tc: "should error coercing string to slice of int32s",1017 v: func() *Venom {1018 ven := New()1019 ven.SetDefault("int32s", "foobar")1020 return ven1021 }(),1022 expect: new(sliceConfig),1023 err: &CoerceErr{From: "foobar", To: "[]int32"},1024 },1025 {1026 tc: "should error coercing interface{} slice with invalid values to slice of int32s",1027 v: func() *Venom {1028 ven := New()1029 ven.SetDefault("int32s", []interface{}{int32(0), "foobar"})1030 return ven1031 }(),1032 expect: new(sliceConfig),1033 err: &CoerceErr{1034 From: []interface{}{int32(0), "foobar"},1035 To: "[]int32",1036 Err: &CoerceErr{1037 From: "foobar",1038 To: "int32",1039 },1040 },1041 },1042 {1043 tc: "should error coercing string to slice of int64s",1044 v: func() *Venom {1045 ven := New()1046 ven.SetDefault("int64s", "foobar")1047 return ven1048 }(),1049 expect: new(sliceConfig),1050 err: &CoerceErr{From: "foobar", To: "[]int64"},1051 },1052 {1053 tc: "should error coercing interface{} slice with invalid values to slice of int64s",1054 v: func() *Venom {1055 ven := New()1056 ven.SetDefault("int64s", []interface{}{int64(0), "foobar"})1057 return ven1058 }(),1059 expect: new(sliceConfig),1060 err: &CoerceErr{1061 From: []interface{}{int64(0), "foobar"},1062 To: "[]int64",1063 Err: &CoerceErr{1064 From: "foobar",1065 To: "int64",1066 },1067 },1068 },1069 {1070 tc: "should error coercing string to slice of uints",1071 v: func() *Venom {1072 ven := New()1073 ven.SetDefault("uints", "foobar")1074 return ven1075 }(),1076 expect: new(sliceConfig),1077 err: &CoerceErr{From: "foobar", To: "[]uint"},1078 },1079 {1080 tc: "should error coercing interface{} slice with invalid values to slice of uints",1081 v: func() *Venom {1082 ven := New()1083 ven.SetDefault("uints", []interface{}{uint(0), "foobar"})1084 return ven1085 }(),1086 expect: new(sliceConfig),1087 err: &CoerceErr{1088 From: []interface{}{uint(0), "foobar"},1089 To: "[]uint",1090 Err: &CoerceErr{1091 From: "foobar",1092 To: "uint",1093 },1094 },1095 },1096 {1097 tc: "should error coercing string to slice of uint8s",1098 v: func() *Venom {1099 ven := New()1100 ven.SetDefault("uint8s", "foobar")1101 return ven1102 }(),1103 expect: new(sliceConfig),1104 err: &CoerceErr{From: "foobar", To: "[]uint8"},1105 },1106 {1107 tc: "should error coercing interface{} slice with invalid values to slice of uint8s",1108 v: func() *Venom {1109 ven := New()1110 ven.SetDefault("uint8s", []interface{}{uint8(0), "foobar"})1111 return ven1112 }(),1113 expect: new(sliceConfig),1114 err: &CoerceErr{1115 From: []interface{}{uint8(0), "foobar"},1116 To: "[]uint8",1117 Err: &CoerceErr{1118 From: "foobar",1119 To: "uint8",1120 },1121 },1122 },1123 {1124 tc: "should error coercing string to slice of uint16s",1125 v: func() *Venom {1126 ven := New()1127 ven.SetDefault("uint16s", "foobar")1128 return ven1129 }(),1130 expect: new(sliceConfig),1131 err: &CoerceErr{From: "foobar", To: "[]uint16"},1132 },1133 {1134 tc: "should error coercing interface{} slice with invalid values to slice of uint16s",1135 v: func() *Venom {1136 ven := New()1137 ven.SetDefault("uint16s", []interface{}{uint16(0), "foobar"})1138 return ven1139 }(),1140 expect: new(sliceConfig),1141 err: &CoerceErr{1142 From: []interface{}{uint16(0), "foobar"},1143 To: "[]uint16",1144 Err: &CoerceErr{1145 From: "foobar",1146 To: "uint16",1147 },1148 },1149 },1150 {1151 tc: "should error coercing string to slice of uint32s",1152 v: func() *Venom {1153 ven := New()1154 ven.SetDefault("uint32s", "foobar")1155 return ven1156 }(),1157 expect: new(sliceConfig),1158 err: &CoerceErr{From: "foobar", To: "[]uint32"},1159 },1160 {1161 tc: "should error coercing interface{} slice with invalid values to slice of uint32s",1162 v: func() *Venom {1163 ven := New()1164 ven.SetDefault("uint32s", []interface{}{uint32(0), "foobar"})1165 return ven1166 }(),1167 expect: new(sliceConfig),1168 err: &CoerceErr{1169 From: []interface{}{uint32(0), "foobar"},1170 To: "[]uint32",1171 Err: &CoerceErr{1172 From: "foobar",1173 To: "uint32",1174 },1175 },1176 },1177 {1178 tc: "should error coercing string to slice of uint64s",1179 v: func() *Venom {1180 ven := New()1181 ven.SetDefault("uint64s", "foobar")1182 return ven1183 }(),1184 expect: new(sliceConfig),1185 err: &CoerceErr{From: "foobar", To: "[]uint64"},1186 },1187 {1188 tc: "should error coercing interface{} slice with invalid values to slice of uint64s",1189 v: func() *Venom {1190 ven := New()1191 ven.SetDefault("uint64s", []interface{}{uint64(0), "foobar"})1192 return ven1193 }(),1194 expect: new(sliceConfig),1195 err: &CoerceErr{1196 From: []interface{}{uint64(0), "foobar"},1197 To: "[]uint64",1198 Err: &CoerceErr{1199 From: "foobar",1200 To: "uint64",1201 },1202 },1203 },1204 {1205 tc: "should error coercing string to slice of float32s",1206 v: func() *Venom {1207 ven := New()1208 ven.SetDefault("float32s", "foobar")1209 return ven1210 }(),1211 expect: new(sliceConfig),1212 err: &CoerceErr{From: "foobar", To: "[]float32"},1213 },1214 {1215 tc: "should error coercing interface{} slice with invalid values to slice of float32s",1216 v: func() *Venom {1217 ven := New()1218 ven.SetDefault("float32s", []interface{}{float32(0), "foobar"})1219 return ven1220 }(),1221 expect: new(sliceConfig),1222 err: &CoerceErr{1223 From: []interface{}{float32(0), "foobar"},1224 To: "[]float32",1225 Err: &CoerceErr{1226 From: "foobar",1227 To: "float32",1228 },1229 },1230 },1231 {1232 tc: "should error coercing string to slice of float64s",1233 v: func() *Venom {1234 ven := New()1235 ven.SetDefault("float64s", "foobar")1236 return ven1237 }(),1238 expect: new(sliceConfig),1239 err: &CoerceErr{From: "foobar", To: "[]float64"},1240 },1241 {1242 tc: "should error coercing interface{} slice with invalid values to slice of float64s",1243 v: func() *Venom {1244 ven := New()1245 ven.SetDefault("float64s", []interface{}{float64(0), "foobar"})1246 return ven1247 }(),1248 expect: new(sliceConfig),1249 err: &CoerceErr{1250 From: []interface{}{float64(0), "foobar"},1251 To: "[]float64",1252 Err: &CoerceErr{1253 From: "foobar",1254 To: "float64",1255 },1256 },1257 },1258 {1259 tc: "should error coercing non-matching slices",1260 v: func() *Venom {1261 ven := New()1262 ven.SetDefault("strings", []float64{0.0})1263 return ven1264 }(),1265 expect: new(sliceConfig),1266 err: &CoerceErr{From: []float64{0}, To: "[]string"},1267 },1268 }1269 for _, test := range testIO {1270 t.Run(test.tc, func(t *testing.T) {1271 conf := new(sliceConfig)1272 err := Unmarshal(test.v, conf)1273 assertEqualErrors(t, test.err, err)1274 assert.Equal(t, test.expect, conf)1275 })1276 }1277}1278type Config struct {1279 Ports []int1280 Storage StorageConfig1281 Dir string `venom:"dir"`1282}1283type StorageConfig struct {1284 Driver string1285 DriverOpts map[string]string `venom:"driver_opts"`1286}1287func TestUnmarshal_Hyper(t *testing.T) {1288 inp := Config{1289 Ports: []int{8443},1290 Storage: StorageConfig{1291 DriverOpts: make(map[string]string),1292 },1293 }1294 dir, err := ioutil.TempDir("", "tmp_test_data")1295 assert.Nil(t, err)1296 defer os.RemoveAll(dir)1297 content := `{1298 "dir": "/some/path",1299 "ports": [443],1300 "storage": {1301 "driver": "bolt",1302 "driver_opts": {1303 "path": "/some/path"1304 }1305 }1306}`1307 tmpfile := filepath.Join(dir, "test.json")1308 err = ioutil.WriteFile(filepath.Join(dir, "test.json"), []byte(content), 0644)1309 assert.Nil(t, err)1310 v := New()1311 assert.Nil(t, v.LoadFile(tmpfile))1312 err = Unmarshal(v, &inp)1313 assert.Nil(t, err)1314 assert.Equal(t, []int{443}, inp.Ports)1315 assert.Equal(t, "/some/path", inp.Dir)1316}1317func TestUnmarshal_KeyWithHyphens(t *testing.T) {1318 type S3Config struct {1319 AccessKeyID string `venom:"access-key-id"`1320 }1321 type Config struct {1322 S3 S3Config `venom:"s3"`1323 }1324 v := New()1325 v.RegisterResolver(EnvironmentLevel, &EnvironmentVariableResolver{1326 Translator: func(b byte) byte {1327 switch b {1328 case '-':1329 return '_'1330 default:1331 return DefaultEnvironmentVariableKeyTranslator(b)1332 }1333 },1334 })1335 _ = os.Setenv("S3_ACCESS_KEY_ID", "FOOBAR")1336 var config Config1337 err := Unmarshal(v, &config)1338 assert.Nil(t, err, "unmarshal failed with error: %s", err)...

Full Screen

Full Screen

venom.go

Source:venom.go Github

copy

Full Screen

...70// arbitrary configuration keys and values.71type Venom struct {72 Store ConfigStore73}74// New returns a newly initialized Venom instance.75//76// The internal config map is created empty, only allocating space for a given77// config level once a value is set to that level.78func New() *Venom {79 return NewWithStore(NewDefaultConfigStore())80}81// NewSafe returns a newly initialized Venom instance that is safe to read and82// write from multiple goroutines.83//84// The internal config map is created empty, only allocating space for a given85// config level once a value is set to that level.86func NewSafe() *Venom {87 return NewWithStore(NewSafeConfigStore())88}89// NewLoggable takes a Logger and returns a newly initialized Venom90// instance that will log to a Logger interface upon reads and writes.91func NewLoggableWith(l Logger) *Venom {92 lcs := NewLoggableConfigStoreWith(l)93 return NewWithStore(lcs)94}95// NewLoggable returns a Venom instance with a default log set to standard out.96func NewLoggable() *Venom {97 return NewWithStore(NewLoggableConfigStore())98}99// NewWithStore returns a newly initialized Venom instance that wraps the100// provided ConfigStore.101func NewWithStore(s ConfigStore) *Venom {102 return &Venom{103 Store: s,104 }105}106// Default returns a new venom instance with some default resolver107// configuration applied to it.108func Default() *Venom {109 ven := New()110 ven.RegisterResolver(EnvironmentLevel, defaultEnvResolver)111 return ven112}113// Default returns a new goroutine-safe venom instance with some default114// resolver configuration applied to it.115func DefaultSafe() *Venom {116 ven := NewSafe()117 ven.RegisterResolver(EnvironmentLevel, defaultEnvResolver)118 return ven119}120// RegisterResolver registers a custom config resolver for the specified121// ConfigLevel.122//123// Additionally, if the provided level is not already in the current collection124// of active config levels, it will be added automatically125func (v *Venom) RegisterResolver(level ConfigLevel, r Resolver) {126 v.Store.RegisterResolver(level, r)127}128// Alias registers an alias for a given key. This allows consumers to access129// the same config via a different key, increasing the backwards130// compatibility of an application....

Full Screen

Full Screen

store_test.go

Source:store_test.go Github

copy

Full Screen

2import "testing"3func TestConfigStoreSetAndFind(t *testing.T) {4 t.Parallel()5 t.Run("DefaultConfigStore", func(t *testing.T) {6 testVenom(t, NewDefaultConfigStore())7 })8 t.Run("SafeConfigStore", func(t *testing.T) {9 testVenom(t, NewSafeConfigStore())10 })11 t.Run("LoggableConfigStore", func(t *testing.T) {12 testVenom(t, NewLoggableWith(&TestLogger{}))13 })14 t.Run("Venom", func(t *testing.T) {15 testVenom(t, New())16 })17 t.Run("DefaultVenom", func(t *testing.T) {18 testVenom(t, Default())19 })20 t.Run("SafeVenom", func(t *testing.T) {21 testVenom(t, NewSafe())22 })23 t.Run("SafeDefaultVenom", func(t *testing.T) {24 testVenom(t, DefaultSafe())25 })26 t.Run("SubscriptionStore", func(t *testing.T) {27 store, clear := NewSubscriptionStore(NewDefaultConfigStore())28 defer clear()29 testVenom(t, store)30 })31}32func TestConfigStoreDebug(t *testing.T) {33 t.Parallel()34 t.Run("DefaultConfigStore", func(t *testing.T) {35 testDebug(t, NewDefaultConfigStore())36 })37 t.Run("SafeConfigStore", func(t *testing.T) {38 testDebug(t, NewSafeConfigStore())39 })40 t.Run("LoggableConfigStore", func(t *testing.T) {41 testDebug(t, NewLoggableConfigStore())42 })43 t.Run("Venom", func(t *testing.T) {44 testDebug(t, New())45 })46 t.Run("DefaultVenom", func(t *testing.T) {47 testDebug(t, Default())48 })49 t.Run("SafeVenom", func(t *testing.T) {50 testDebug(t, NewSafe())51 })52 t.Run("SafeDefaultVenom", func(t *testing.T) {53 testDebug(t, DefaultSafe())54 })55 t.Run("SubscriptionStore", func(t *testing.T) {56 store, clear := NewSubscriptionStore(NewDefaultConfigStore())57 defer clear()58 testDebug(t, store)59 })60}61func TestConfigStoreAlias(t *testing.T) {62 t.Parallel()63 t.Run("DefaultConfigStore", func(t *testing.T) {64 testAlias(t, NewDefaultConfigStore())65 })66 t.Run("SafeConfigStore", func(t *testing.T) {67 testAlias(t, NewSafeConfigStore())68 })69 t.Run("LoggableConfigStore", func(t *testing.T) {70 testAlias(t, NewLoggableWith(&TestLogger{}))71 })72 t.Run("Venom", func(t *testing.T) {73 testAlias(t, New())74 })75 t.Run("DefaultVenom", func(t *testing.T) {76 testAlias(t, Default())77 })78 t.Run("SafeVenom", func(t *testing.T) {79 testAlias(t, NewSafe())80 })81 t.Run("SafeDefaultVenom", func(t *testing.T) {82 testAlias(t, DefaultSafe())83 })84 t.Run("SubscriptionStore", func(t *testing.T) {85 store, clear := NewSubscriptionStore(NewDefaultConfigStore())86 defer clear()87 testAlias(t, store)88 })89}90func TestConfigStoreEdgeCases(t *testing.T) {91 t.Parallel()92 t.Run("DefaultConfigStore", func(t *testing.T) {93 testEdgeCases(t, NewDefaultConfigStore())94 })95 t.Run("SafeConfigStore", func(t *testing.T) {96 testEdgeCases(t, NewSafeConfigStore())97 })98 t.Run("LoggableConfigStore", func(t *testing.T) {99 testEdgeCases(t, NewLoggableWith(&TestLogger{}))100 })101 t.Run("Venom", func(t *testing.T) {102 testEdgeCases(t, New())103 })104 t.Run("DefaultVenom", func(t *testing.T) {105 testEdgeCases(t, Default())106 })107 t.Run("SafeVenom", func(t *testing.T) {108 testEdgeCases(t, NewSafe())109 })110 t.Run("SafeDefaultVenom", func(t *testing.T) {111 testEdgeCases(t, DefaultSafe())112 })113 t.Run("SubscriptionStore", func(t *testing.T) {114 store, clear := NewSubscriptionStore(NewDefaultConfigStore())115 defer clear()116 testEdgeCases(t, store)117 })118}...

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import "fmt"2type venom struct {3}4func (v *venom) New(name string) {5}6func main() {7 v := &venom{}8 v.New("Venom")9 fmt.Println(v.name)10}11import "fmt"12type venom struct {13}14func (v *venom) New(name string) {15}16func main() {17 v := &venom{}18 v.New("Venom")19 fmt.Println(v.name)20}21import "fmt"22type venom struct {23}24func (v *venom) New(name string) {25}26func main() {27 v := &venom{}28 v.New("Venom")29 fmt.Println(v.name)30}31import "fmt"32type venom struct {33}34func (v *venom) New(name string) {35}36func main() {37 v := &venom{}38 v.New("Venom")39 fmt.Println(v.name)40}41import "fmt"42type venom struct {43}44func (v *venom) New(name string) {45}46func main() {47 v := &venom{}48 v.New("Venom")49 fmt.Println(v.name)50}51import "fmt"52type venom struct {53}54func (v *venom) New(name string) {55}56func main() {57 v := &venom{}58 v.New("Venom")59 fmt.Println(v.name)60}61import "fmt"62type venom struct {63}64func (v *venom) New(name string) {65}66func main() {67 v := &venom{}68 v.New("Venom")69 fmt.Println(v.name)70}

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 venom := venom.New()4 fmt.Println(venom)5}6import (7func main() {8 venom := venom.New()9 fmt.Println(venom)10}11import (12func main() {13 venom := venom.New()14 fmt.Println(venom)15}16import (17func main() {18 venom := venom.New()19 fmt.Println(venom)20}21import (22func main() {23 venom := venom.New()24 fmt.Println(venom)25}26import (27func main() {28 venom := venom.New()29 fmt.Println(venom)30}31import (32func main() {33 venom := venom.New()34 fmt.Println(venom)35}36import (37func main() {38 venom := venom.New()39 fmt.Println(venom)40}41import (42func main() {43 venom := venom.New()44 fmt.Println(venom)45}46import (47func main() {48 venom := venom.New()49 fmt.Println(venom)50}51import (

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import "fmt"2func main() {3 fmt.Println("Hello World!")4 venom := New()5 fmt.Println(venom)6}7import "fmt"8func main() {9 fmt.Println("Hello World!")10 venom := New()11 fmt.Println(venom)12}13import "fmt"14func main() {15 fmt.Println("Hello World!")16 venom := New()17 fmt.Println(venom)18}19import "fmt"20func main() {21 fmt.Println("Hello World!")22 venom := New()23 fmt.Println(venom)24}25import "fmt"26func main() {27 fmt.Println("Hello World!")28 venom := New()29 fmt.Println(venom)30}31import "fmt"32func main() {33 fmt.Println("Hello World!")34 venom := New()35 fmt.Println(venom)36}37import "fmt"38func main() {39 fmt.Println("Hello World!")40 venom := New()41 fmt.Println(venom)42}43import "fmt"44func main() {45 fmt.Println("Hello World!")46 venom := New()47 fmt.Println(venom)48}49import "fmt"50func main() {51 fmt.Println("Hello World!")52 venom := New()53 fmt.Println(venom)54}55import "fmt"56func main() {57 fmt.Println("Hello World!")58 venom := New()59 fmt.Println(venom)60}61import "fmt"62func main() {63 fmt.Println("Hello World!")

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import (2type venom struct {3}4func New() *venom {5 return &venom{6 }7}8func main() {9 v := New()10 fmt.Println(v.color)11}12import (13type venom struct {14}15func New(color string) *venom {16 return &venom{17 }18}19func main() {20 v := New("blue")21 fmt.Println(v.color)22}23import (24type venom struct {25}26func New(color string) *venom {27 return &venom{28 }29}30func main() {31 v := New("blue")32 fmt.Println(v.color)33}34import (35type venom struct {36}37func New(color string) *venom {38 return &venom{39 }40}41func main() {42 v := New("blue")43 fmt.Println(v.color)44}45import (46type venom struct {47}48func New(color string) *venom {49 return &venom{50 }51}52func main() {53 v := New("blue")54 fmt.Println(v.color)55}

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import "fmt"2type venom struct {3}4func main() {5 venom1 := venom{6 }7 fmt.Println(venom1)8}9{poison green}10import "fmt"11type venom struct {12}13func (v *venom) New(venomtype, venomcolor string) {14}15func main() {16 v := &venom{}17 v.New("poison", "green")18 fmt.Println(v)19}20&{poison green}21import "fmt"22type venom struct {23}24func (v *venom) New(venomtype, venomcolor string) *venom {25}26func main() {27 v := &venom{}28 v.New("poison", "green")29 fmt.Println(v)30}31&{poison green}32import "fmt"33type venom struct {34}35func New(venomtype, venomcolor string) *venom {36 return &venom{37 }38}39func main() {40 v := New("poison", "green")41 fmt.Println(v)42}43&{poison green}44import "fmt"45type venom struct {

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 v := venom.New()4 fmt.Println(v)5}6import (7func main() {8 v := venom.New()9 fmt.Println(v)10}11import (12func main() {13 v := venom.New()14 fmt.Println(v)15}16import (17func main() {18 v := venom.New()19 fmt.Println(v)20}21import (22func main() {23 v := venom.New()24 fmt.Println(v)25}26import (27func main() {28 v := venom.New()29 fmt.Println(v)30}31import (32func main() {33 v := venom.New()34 fmt.Println(v)35}36import (37func main() {38 v := venom.New()39 fmt.Println(v)40}41import (

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import (2func main() {3 v := venom.New("Pooja", 23)4 fmt.Println(v)5}6import (7func main() {8 v := venom.New("Pooja", 23)9 fmt.Println(v)10}11import (12type Venom struct {13}14func New(name string, age int) *Venom {15 return &Venom{16 }17}18func (v *Venom) String() string {19 return fmt.Sprintf("Name: %s, Age: %d", v.name, v.age)20}21import (22type Venom struct {23}24func New(name string, age int) *Venom {25 return &Venom{26 }27}28func (v *Venom) String() string {29 return fmt.Sprintf("Name: %s, Age: %d", v.name, v.age)30}31import (32type Venom struct {33}34func New(name string, age int) *Venom {35 return &Venom{36 }37}38func (v *Venom) String() string {39 return fmt.Sprintf("Name: %s, Age: %d", v.name, v.age)40}

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import (2type venom struct {3}4func main() {5 v := venom{6 }7 fmt.Println(v)8}9import (10type venom struct {11}12func (v venom) New(venomType string, venomColor string) venom {13 return venom{14 }15}16func main() {17 v := venom{}18 v = v.New("poison", "black")19 fmt.Println(v)20}21import (22type venom struct {23}24func New(venomType string, venomColor string) venom {25 return venom{26 }27}28func main() {29 v := New("poison", "black")30 fmt.Println(v)31}32import (33type venom struct {34}35func New(venomType string, venomColor string) *venom {36 return &venom{37 }38}39func main() {40 v := New("poison", "black")41 fmt.Println(v)42}43import (44type venom struct {45}46func New(venomType string, venomColor string) *venom {47 return &venom{48 }49}

Full Screen

Full Screen

New

Using AI Code Generation

copy

Full Screen

1import "fmt"2type venom struct {3}4func main() {5 v1 := venom{1, "Vikrant", 25}6 fmt.Println(v1)7}8import "fmt"9type venom struct {10}11func main() {12 v1 := venom{1, "Vikrant", 25}13 fmt.Println(v1)14 v2 := venom{name: "Vikrant", age: 25}15 fmt.Println(v2)16}17import "fmt"18type venom struct {19}20func main() {21 v1 := venom{1, "Vikrant", 25}22 fmt.Println(v1)23 v2 := venom{name: "Vikrant", age: 25}24 fmt.Println(v2)25 v3 := venom{name: "Vikrant"}26 fmt.Println(v3)27}28import "fmt"29type venom struct {30}31func main() {32 v1 := venom{1, "Vikrant", 25}33 fmt.Println(v1)34 v2 := venom{name: "Vikrant", age: 25}35 fmt.Println(v2)36 v3 := venom{name: "Vikrant"}37 fmt.Println(v3)38 v4 := venom{id: 1, name: "Vikrant"}39 fmt.Println(v4)40}41import "fmt"

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Venom automation tests on LambdaTest cloud grid

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

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful