@@ -869,16 +869,6 @@ let ``test Type test with Date`` () =
869869 DateTime.Now |> box |> isDate |> equal true
870870 box 5 |> isDate |> equal false
871871
872- [<Fact>]
873- let ``test Type test with Long`` () =
874- let isLong ( x : obj ) =
875- match x with
876- | :? int64 -> true
877- | _ -> false
878-
879- box 5 L |> isLong |> equal true
880- //box 50 |> isLong |> equal false
881-
882872[<Fact>]
883873let ``test Type test with BigInt`` () =
884874 let isBigInd ( x : obj ) =
@@ -1559,3 +1549,113 @@ let ``test Choice with arity 3+ is represented correctly`` () = // See #2485
15591549let ``test Can call the base version of a mangled abstract method that was declared above in the hierarchy`` () =
15601550 let c = ConcreteClass1()
15611551 c.MyMethod( 4 ) |> equal 58
1552+
1553+ [<Fact>]
1554+ let ``test Type test uint8`` () =
1555+ let isUInt8 ( x : obj ) =
1556+ match x with
1557+ | :? byte -> true
1558+ | _ -> false
1559+
1560+ box 5 uy |> isUInt8 |> equal true
1561+ box 5 |> isUInt8 |> equal false
1562+
1563+ [<Fact>]
1564+ let ``test Type test int8`` () =
1565+ let isInt8 ( x : obj ) =
1566+ match x with
1567+ | :? sbyte -> true
1568+ | _ -> false
1569+
1570+ box 5 y |> isInt8 |> equal true
1571+ box 5 |> isInt8 |> equal false
1572+
1573+ [<Fact>]
1574+ let ``test Type test uint16`` () =
1575+ let isUInt16 ( x : obj ) =
1576+ match x with
1577+ | :? uint16 -> true
1578+ | _ -> false
1579+
1580+ box 5 us |> isUInt16 |> equal true
1581+ box 5 |> isUInt16 |> equal false
1582+
1583+ [<Fact>]
1584+ let ``test Type test int16`` () =
1585+ let isInt16 ( x : obj ) =
1586+ match x with
1587+ | :? int16 -> true
1588+ | _ -> false
1589+
1590+ box 5 s |> isInt16 |> equal true
1591+ box 5 |> isInt16 |> equal false
1592+
1593+ [<Fact>]
1594+ let ``test Type test uint32`` () =
1595+ let isUInt32 ( x : obj ) =
1596+ match x with
1597+ | :? uint32 -> true
1598+ | _ -> false
1599+
1600+ box 5 u |> isUInt32 |> equal true
1601+ box 5 |> isUInt32 |> equal false
1602+
1603+ [<Fact>]
1604+ let ``test Type test int32`` () =
1605+ let isInt32 ( x : obj ) =
1606+ match x with
1607+ | :? int32 -> true
1608+ | _ -> false
1609+
1610+ box 5 |> isInt32 |> equal true
1611+ box 5 L |> isInt32 |> equal false
1612+
1613+ [<Fact>]
1614+ let ``test Type test uint64`` () =
1615+ let isUInt64 ( x : obj ) =
1616+ match x with
1617+ | :? uint64 -> true
1618+ | _ -> false
1619+
1620+ box 5 UL |> isUInt64 |> equal true
1621+ box 5 |> isUInt64 |> equal false
1622+
1623+ [<Fact>]
1624+ let ``test Type test int64`` () =
1625+ let isInt64 ( x : obj ) =
1626+ match x with
1627+ | :? int64 -> true
1628+ | _ -> false
1629+
1630+ box 5 L |> isInt64 |> equal true
1631+ box 5 |> isInt64 |> equal false
1632+
1633+ [<Fact>]
1634+ let ``test Type test float32`` () =
1635+ let isFloat32 ( x : obj ) =
1636+ match x with
1637+ | :? float32 -> true
1638+ | _ -> false
1639+
1640+ box 5. f |> isFloat32 |> equal true
1641+ box 5. |> isFloat32 |> equal false
1642+
1643+ [<Fact>]
1644+ let ``test Type test float64`` () =
1645+ let isFloat64 ( x : obj ) =
1646+ match x with
1647+ | :? float -> true
1648+ | _ -> false
1649+
1650+ box 5. |> isFloat64 |> equal true
1651+ box 5. f |> isFloat64 |> equal false
1652+
1653+ [<Fact>]
1654+ let ``test Type test decimal`` () =
1655+ let isDecimal ( x : obj ) =
1656+ match x with
1657+ | :? decimal -> true
1658+ | _ -> false
1659+
1660+ box 5 M |> isDecimal |> equal true
1661+ box 5 |> isDecimal |> equal false
0 commit comments