github.com/alkemics/goflow@v0.2.1/wrappers/mockingjay/graph/main.go (about)

     1  // Code generated by lib-go/goflow DO NOT EDIT.
     2  
     3  //go:build !codeanalysis
     4  // +build !codeanalysis
     5  
     6  package main
     7  
     8  import (
     9  	"fmt"
    10  
    11  	"context"
    12  
    13  	"github.com/alkemics/goflow/wrappers/mockingjay"
    14  )
    15  
    16  func assert(b bool) {
    17  	if !b {
    18  		panic("assertion failed")
    19  	}
    20  }
    21  
    22  func main() {
    23  	var g Mockingjay
    24  
    25  	g = NewMockingjay()
    26  
    27  	ctx := mockingjay.WithMock(context.Background(), "add", 1)
    28  	sum := g.Run(ctx, 10, 20)
    29  	if sum != 1 {
    30  		panic(fmt.Sprintf("expected 1 got %v\n", sum))
    31  	}
    32  
    33  	fmt.Println("Test done.")
    34  
    35  	fmt.Println("All tests done.")
    36  }