Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit e201912

Browse files
authored
Remove constraints package (#98)
1 parent 93b455c commit e201912

File tree

4 files changed

+17
-26
lines changed

4 files changed

+17
-26
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ All notable changes to this library are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased](https://github.com/fluentassert/verify/compare/v1.0.0-rc.2...HEAD)
8+
## [Unreleased](https://github.com/fluentassert/verify/compare/v1.0.0-rc.3...HEAD)
9+
10+
<!-- markdownlint-disable-next-line line-length -->
11+
## [1.0.0-rc.3](https://github.com/fluentassert/verify/releases/tag/v1.0.0-rc.3) - 2023-03-09
12+
13+
### Removed
14+
15+
- Remove `constraints` package.
916

1017
<!-- markdownlint-disable-next-line line-length -->
1118
## [1.0.0-rc.2](https://github.com/fluentassert/verify/releases/tag/v1.0.0-rc.2) - 2023-02-24

constraints/constraints.go

-14
This file was deleted.

number.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ package verify
33
import (
44
"fmt"
55
"math"
6-
7-
"github.com/fluentassert/verify/constraints"
86
)
97

10-
// FluentNumber encapsulates assertions for numbers.
11-
type FluentNumber[T constraints.Number] struct {
8+
// FluentNumber encapsulates assertions for numbers
9+
// that supports the operators < <= >= > + - * /.
10+
type FluentNumber[T ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64] struct {
1211
FluentOrdered[T]
1312
}
1413

15-
// Number is used for testing numbers.
16-
func Number[T constraints.Number](got T) FluentNumber[T] {
14+
// Number is used for testing numbers
15+
// that supports the operators < <= >= > + - * /.
16+
func Number[T ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64](got T) FluentNumber[T] {
1717
return FluentNumber[T]{FluentOrdered[T]{FluentObj[T]{FluentAny[T]{got}}}}
1818
}
1919

ordered.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@ package verify
22

33
import (
44
"fmt"
5-
6-
"github.com/fluentassert/verify/constraints"
75
)
86

97
// FluentOrdered encapsulates assertions for ordered object
10-
// // that supports the operators < <= >= >.
11-
type FluentOrdered[T constraints.Ordered] struct {
8+
// that supports the operators < <= >= >.
9+
type FluentOrdered[T ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string] struct {
1210
FluentObj[T]
1311
}
1412

1513
// Ordered is used for testing a ordered object
1614
// that supports the operators < <= >= >.
17-
func Ordered[T constraints.Ordered](got T) FluentOrdered[T] {
15+
func Ordered[T ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string](got T) FluentOrdered[T] {
1816
return FluentOrdered[T]{FluentObj[T]{FluentAny[T]{got}}}
1917
}
2018

0 commit comments

Comments
 (0)