Esempio n. 1
0
        public void NoFoldToReal()
        {
            var builderPair  = GetSimpleAndConstantFoldingBuilder();
            var sfb          = builderPair.Item1;
            var cfb          = builderPair.Item2;
            var v0           = GetVarAndIdExpr("x", BasicType.Int).Item2;
            var foldedResult = cfb.ArithmeticCoercion(ArithmeticCoercion.CoercionType.ToReal, v0);
            var simpleResult = sfb.ArithmeticCoercion(ArithmeticCoercion.CoercionType.ToReal, v0);

            CheckIsReal(foldedResult);
            CheckIsReal(simpleResult);
            Assert.AreEqual(simpleResult, foldedResult);
            Assert.IsNotNull(ExprUtil.AsArithmeticCoercion(foldedResult));
        }