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

   > 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 ?
   
   Great work! You can now initialize a Fury instance by invoking 'new Fury()'. 
For examples of its usage, please search within the project. Note that the 
Compatible Mode is currently not supported, meaning that the MateString 
encoding and decoding functions are not being called anywhere in the system.


-- 
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: commits-unsubscr...@fury.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@fury.apache.org
For additional commands, e-mail: commits-h...@fury.apache.org

Reply via email to