| 10 | ) |
| 11 | |
| 12 | func TestMin(t *testing.T) { |
| 13 | t.Run("go", func(t *testing.T) { |
| 14 | if x := Min(1, 2); x != 1 { |
| 15 | t.Fatalf("expect = %d, got = %d", 1, x) |
| 16 | } |
| 17 | if x := Min(2, 1); x != 1 { |
| 18 | t.Fatalf("expect = %d, got = %d", 1, x) |
| 19 | } |
| 20 | }) |
| 21 | t.Run("asm", func(t *testing.T) { |
| 22 | if x := AsmMin(1, 2); x != 1 { |
| 23 | t.Fatalf("expect = %d, got = %d", 1, x) |
| 24 | } |
| 25 | if x := AsmMin(2, 1); x != 1 { |
| 26 | t.Fatalf("expect = %d, got = %d", 1, x) |
| 27 | } |
| 28 | }) |
| 29 | } |
| 30 | func TestMax(t *testing.T) { |
| 31 | t.Run("go", func(t *testing.T) { |
| 32 | if x := Max(1, 2); x != 2 { |