diff options
| author | Abhi <[email protected]> | 2025-07-25 21:56:49 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-26 01:56:49 +0000 |
| commit | ca5dd28ab60d78f42150460cbe9d4ed58d40afe4 (patch) | |
| tree | 6f3b3b373133a6c0bf8bb9cee8a10cc06ac83c9a /packages/cli/src/ui/utils/textUtils.test.ts | |
| parent | ad2ef080aae2e21bf04ad8e922719ceaa81f1e5f (diff) | |
refactor(core): Centralize shell logic into ShellExecutionService (#4823)
Diffstat (limited to 'packages/cli/src/ui/utils/textUtils.test.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/textUtils.test.ts | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/packages/cli/src/ui/utils/textUtils.test.ts b/packages/cli/src/ui/utils/textUtils.test.ts deleted file mode 100644 index 5dd08875..00000000 --- a/packages/cli/src/ui/utils/textUtils.test.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -import { isBinary } from './textUtils'; - -describe('textUtils', () => { - describe('isBinary', () => { - it('should return true for a buffer containing a null byte', () => { - const buffer = Buffer.from([ - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x1a, 0x0a, 0x00, - ]); - expect(isBinary(buffer)).toBe(true); - }); - - it('should return false for a buffer containing only text', () => { - const buffer = Buffer.from('This is a test string.'); - expect(isBinary(buffer)).toBe(false); - }); - - it('should return false for an empty buffer', () => { - const buffer = Buffer.from([]); - expect(isBinary(buffer)).toBe(false); - }); - - it('should return false for a null or undefined buffer', () => { - expect(isBinary(null)).toBe(false); - expect(isBinary(undefined)).toBe(false); - }); - - it('should only check the sample size', () => { - const longBufferWithNullByteAtEnd = Buffer.concat([ - Buffer.from('a'.repeat(1024)), - Buffer.from([0x00]), - ]); - expect(isBinary(longBufferWithNullByteAtEnd, 512)).toBe(false); - }); - }); -}); |
