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

Base32 Module Integration for KCL Standard Library #1883

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gitatractivo
Copy link

@gitatractivo gitatractivo commented Mar 8, 2025

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

fix #1860

2. What is the scope of this PR (e.g. component or file name):

kclvm/runtime/src/base32/mod.rs
kclvm/sema/src/builtin/system_module.rs
kclvm/tests/test_units/runtime/base32/test_base32.py

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

Added unit tests in kclvm/tests/test_units/runtime/base32/test_base32.py that verify encoding and decoding functionality using RFC 4648 test vectors. The tests follow the same pattern as the existing Base64 tests.

@zong-zhe
Copy link
Contributor

Hi @gitatractivo 😄

Good work! 👍👍👍 Now you need to tidy up your commits, squash them into one commit, and use git commit -s to make DCO checks pass.

@zong-zhe
Copy link
Contributor

LGTM, and cc @He1pa

@zong-zhe
Copy link
Contributor

Hi @gitatractivo 😄

A test case failed, cc@He1pa, could you provide some more details to help him fix the test 😄

@He1pa
Copy link
Contributor

He1pa commented Mar 12, 2025

update the ut
image

- Added BASE32 constant to STANDARD_SYSTEM_MODULES list
- Implemented base32 encoding and decoding functions
- Updated test files to use the correct Base32 encoding/decoding
- Fixed imports in test files
- Updated completion test to include base32 module
- Ensured all tests pass with the new module

Fixes kcl-lang#1860

Signed-off-by: Gitanshu Talwar <[email protected]>
@gitatractivo
Copy link
Author

gitatractivo commented Mar 12, 2025

Hi,
I’ve squashed and committed the changes—please let me know if everything looks good!

@He1pa
Copy link
Contributor

He1pa commented Mar 12, 2025

run failed ut locally and update snapshot by cargo insta review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base32 encoder/decoder in stdlib
3 participants