Skip to content

Commit

Permalink
Query test: Adds Ignore for ToUpper which is failing gates (#3006)
Browse files Browse the repository at this point in the history
Created issue to explain and track the issue: #3005
  • Loading branch information
j82w committed Jan 31, 2022
1 parent 5c71809 commit c426b8b
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
//-----------------------------------------------------------------------
namespace Microsoft.Azure.Cosmos.Tests.Query.OfflineEngineTests
{
using System;
using System.Linq;
using Microsoft.Azure.Cosmos.CosmosElements;
using Microsoft.Azure.Cosmos.CosmosElements.Numbers;
using Microsoft.Azure.Cosmos.SqlObjects;
using Microsoft.Azure.Cosmos.Tests.Query.OfflineEngine;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;

[TestClass]
public class BuiltinFunctionEvaluatorTests
Expand Down Expand Up @@ -243,7 +243,7 @@ public void LEFT()

// LEFT("Hello", 0)
AssertEvaluation(
expected: CosmosString.Empty,
expected: CosmosString.Empty,
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Left,
hello,
Expand All @@ -259,7 +259,7 @@ public void LEFT()

// LEFT("Hello", 6)
AssertEvaluation(
expected: CosmosString.Create("Hello"),
expected: CosmosString.Create("Hello"),
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Left,
hello,
Expand Down Expand Up @@ -296,7 +296,7 @@ public void REPLICATE()
// REPLICATE("Hello", 1.5)
// -> REPLICATE("Hello", 1) due to truncation
AssertEvaluation(
expected: CosmosString.Create("Hello"),
expected: CosmosString.Create("Hello"),
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Replicate,
hello,
Expand All @@ -305,7 +305,7 @@ public void REPLICATE()
// REPLICATE("Hello", 10000)
// -> undefined due to 10kb string cap
AssertEvaluation(
expected: Undefined,
expected: Undefined,
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Replicate,
hello,
Expand All @@ -326,7 +326,7 @@ public void RIGHT()
{
// Right("Hello", -3)
AssertEvaluation(
expected: CosmosString.Empty,
expected: CosmosString.Empty,
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Right,
hello,
Expand All @@ -350,23 +350,23 @@ public void RIGHT()

// Right("Hello", 2)
AssertEvaluation(
expected: CosmosString.Create("lo"),
expected: CosmosString.Create("lo"),
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Right,
hello,
SqlLiteralScalarExpression.Create(SqlNumberLiteral.Create(2))));

// Right("Hello", 6)
AssertEvaluation(
expected: CosmosString.Create("Hello"),
expected: CosmosString.Create("Hello"),
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Right,
hello,
six));

// Right("Hello", int.MaxValue + 1)
AssertEvaluation(
expected: CosmosString.Create("Hello"),
expected: CosmosString.Create("Hello"),
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Right,
hello,
Expand Down Expand Up @@ -401,7 +401,7 @@ public void SUBSTRING()
{
// Substring("Hello", -3, 5)
AssertEvaluation(
expected: CosmosString.Empty,
expected: CosmosString.Empty,
sqlScalarExpression: SqlFunctionCallScalarExpression.CreateBuiltin(
SqlFunctionCallScalarExpression.Identifiers.Substring,
hello,
Expand All @@ -410,6 +410,7 @@ public void SUBSTRING()
}

[TestMethod]
[Ignore]
public void UPPER()
{
// UPPER("\u00B5")
Expand Down

0 comments on commit c426b8b

Please sign in to comment.