Forchapeatl commented on PR #1675:
URL: https://github.com/apache/fury/pull/1675#issuecomment-2184995257

   Here is the test file MetaString.test.ts
   ```ts
   import {describe, expect, test} from '@jest/globals';
   import MetaString from './MetaString'; // Adjust the import path as necessary
   
   describe('MetaString', () => {
     test('should encode and decode a simple string', () => {
       const input = "helloWorld_123";
       const encoded = MetaString.encode(input);
       const decoded = MetaString.decode(encoded);
       expect(decoded).toEqual(input);
     });
   
     test('should encode and decode a string with emojis', () => {
       const input = "helloWorld_123 💯";
       const encoded = MetaString.encode(input);
       const decoded = MetaString.decode(encoded);
       expect(decoded).toEqual(input);
     });
   
     test('should throw error for encoding string with .', () => {
       const input = "hello.World_123";
       expect(() => {
         MetaString.encode(input);
       }).toThrow("Unsupported character for encoding: .");
     });
   
     test('should throw error for encoding string with $', () => {
       const input = "hello$World_123";
       expect(() => {
         MetaString.encode(input);
       }).toThrow("Unsupported character for encoding: $");
     });
   
     test('should throw error for decoding string with .', () => {
       const input = "helloWorld_123";
       const encoded = MetaString.encode(input);
       encoded[0] = 0x2E; // Add a `.` character code point in the encoded data
       expect(() => {
         MetaString.decode(encoded);
       }).toThrow("Unsupported character for decoding: .");
     });
   
     test('should throw error for decoding string with $', () => {
       const input = "helloWorld_123";
       const encoded = MetaString.encode(input);
       encoded[0] = 0x24; // Add a `$` character code point in the encoded data
       expect(() => {
         MetaString.decode(encoded);
       }).toThrow("Unsupported character for decoding: $");
     });
   
     test('should encode and decode a string with various unicode characters', 
() => {
       const input = "helloWorld_123 💯 你好 мир";
       const encoded = MetaString.encode(input);
       const decoded = MetaString.decode(encoded);
       expect(decoded).toEqual(input);
     });
   });
   
   ```
   
   Please how do I initialize fury ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to