@@ -694,6 +694,43 @@ func TestUnitApplyFilters_numberTypes(t *testing.T) {
694694 filters .Remove (floatFilter )
695695}
696696
697+ // issue-routing-tag: terraform/default
698+ func TestUnitOrComparator (t * testing.T ) {
699+ type args struct {
700+ target interface {}
701+ filters []interface {}
702+ }
703+ type testFormat struct {
704+ name string
705+ args args
706+ output bool
707+ }
708+ float32Filter := "200.34567"
709+ float64Filter := "200.34567321453457"
710+ filters := []interface {}{}
711+ filters = append (filters , float32Filter )
712+ filters = append (filters , float64Filter )
713+ tests := []testFormat {
714+ {
715+ name : "Test valid string to float32 conversion" ,
716+ args : args {target : float32 (200.3456732145 ), filters : filters },
717+ output : true ,
718+ },
719+ {
720+ name : "Test valid string to float64 conversion" ,
721+ args : args {target : float64 (200.34567321453456788 ), filters : filters },
722+ output : true ,
723+ },
724+ }
725+
726+ for _ , test := range tests {
727+ t .Logf ("Running %s" , test .name )
728+ if res := orComparator (test .args .target , test .args .filters , nil ); res != test .output {
729+ t .Errorf ("Outputnot equal to expected" )
730+ }
731+ }
732+ }
733+
697734// issue-routing-tag: terraform/default
698735func TestUnitApplyFilters_multiProperty (t * testing.T ) {
699736 items := []map [string ]interface {}{
0 commit comments