Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to fix test-all workflow #8828

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename unit test
  • Loading branch information
milaGGL committed Feb 20, 2025
commit 9653bdc4345339fb41014a444377d5ccc484952c
7 changes: 4 additions & 3 deletions packages/firestore/src/util/misc.ts
Original file line number Diff line number Diff line change
@@ -89,16 +89,17 @@ export function compareUtf8Strings(left: string, right: string): number {
// Lazy instantiate TextEncoder
const encoder = newTextEncoder();

// Substring and do UTF-8 encoded byte comparison
const leftBytes = encoder.encode(getUtf8SafeSubstring(left, i));
const rightBytes = encoder.encode(getUtf8SafeSubstring(right, i));
for (
let j = 0;
j < Math.min(leftBytes.length, rightBytes.length);
j++
) {
const comparison = primitiveComparator(leftBytes[j], rightBytes[j]);
if (comparison !== 0) {
return comparison;
const comp = primitiveComparator(leftBytes[j], rightBytes[j]);
if (comp !== 0) {
return comp;
}
}
}
2 changes: 1 addition & 1 deletion packages/firestore/test/unit/util/misc.test.ts
Original file line number Diff line number Diff line change
@@ -267,7 +267,7 @@ class StringBuilder {
}

describe('CompareUtf8Strings', () => {
it('testCompareUtf8Strings', () => {
it('compareUtf8Strings should return correct results', () => {
const errors = [];
const seed = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
let passCount = 0;
Loading
Oops, something went wrong.