@@ -996,46 +996,6 @@ func TestScalarMarshalingRoundTrip(t *testing.T) {
996996 }
997997}
998998
999- func TestScalarNoPanic (t * testing.T ) {
1000- assert .NotPanics (t , func () { _ = Default (42 ) })
1001- assert .NotPanics (t , func () { _ = Default ("hello" ) })
1002- assert .NotPanics (t , func () { _ = Default (3.14 ) })
1003- assert .NotPanics (t , func () { _ = None [int ]() })
1004- assert .NotPanics (t , func () { _ = None [string ]() })
1005- assert .NotPanics (t , func () { _ = None [float64 ]() })
1006- assert .NotPanics (t , func () { _ = Some (42 ) })
1007- assert .NotPanics (t , func () { _ = Some ("hello" ) })
1008- assert .NotPanics (t , func () { _ = Some (3.14 ) })
1009-
1010- intDefault := Default (42 )
1011- assert .False (t , intDefault .HasValue ())
1012- assert .Nil (t , intDefault .Get ())
1013-
1014- strDefault := Default ("hello" )
1015- assert .False (t , strDefault .HasValue ())
1016- assert .Nil (t , strDefault .Get ())
1017-
1018- floatDefault := Default (3.14 )
1019- assert .False (t , floatDefault .HasValue ())
1020- assert .Nil (t , floatDefault .Get ())
1021-
1022- intNone := None [int ]()
1023- assert .False (t , intNone .HasValue ())
1024- assert .Nil (t , intNone .Get ())
1025-
1026- intSome := Some (42 )
1027- assert .True (t , intSome .HasValue ())
1028- assert .Equal (t , ptr (42 ), intSome .Get ())
1029-
1030- strSome := Some ("hello" )
1031- assert .True (t , strSome .HasValue ())
1032- assert .Equal (t , ptr ("hello" ), strSome .Get ())
1033-
1034- floatSome := Some (3.14 )
1035- assert .True (t , floatSome .HasValue ())
1036- assert .Equal (t , ptr (3.14 ), floatSome .Get ())
1037- }
1038-
1039999// TestUnmarshalFromYAML verifies unmarshal behavior using real YAML input loaded
10401000// from a testdata file. Each test case selects a sub-key from the file via
10411001// (*confmap.Conf).Sub and confirms that YAML representations (null, empty map,
0 commit comments