github.com/consensys/gnark-crypto@v0.14.0/internal/generator/tower/template/fq12over6over2/tests/base.go.tmpl (about)

     1  {{define "base"}}
     2  
     3  {{ $TypeTitle := print "E" .TotalDegree}}
     4  {{ $CurveNameCaps := toUpper .Curve.Name}}
     5  
     6  func Test{{$TypeTitle}}Div(t *testing.T) {
     7  
     8      parameters := gopter.DefaultTestParameters()
     9      properties := gopter.NewProperties(parameters)
    10  
    11  	genA := Gen{{$TypeTitle}}()
    12      genB := Gen{{$TypeTitle}}()
    13  
    14      properties.Property("[{{ $CurveNameCaps}}] dividing then multiplying by the same element does nothing", prop.ForAll(
    15          func(a, b *{{$TypeTitle}}) bool {
    16              var c {{$TypeTitle}}
    17              c.Div(a, b)
    18              c.Mul(&c, b)
    19              return c.Equal(a)
    20          },
    21          genA,
    22          genB,
    23      ))
    24  
    25      properties.TestingRun(t, gopter.ConsoleReporter(false))
    26  }
    27  
    28  {{end}}