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

Produce valid Cadence string literals when formatting strings #1023

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

turbolent
Copy link
Member

Description

A Cadence developer might want to generate a valid Cadence string literal from a Go string.

Improve the string value formatting function format.String to do so.

Ref: https://axiomzen.slack.com/archives/CTGAW0TM2/p1624060674096500


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Comment on lines +49 to +51
case r > utf8.MaxRune:
r = 0xFFFD
fallthrough
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure if we need this

@codecov-commenter
Copy link

Codecov Report

Merging #1023 (17114f6) into master (29f4ae1) will increase coverage by 0.01%.
The diff coverage is 89.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1023      +/-   ##
==========================================
+ Coverage   75.55%   75.56%   +0.01%     
==========================================
  Files         267      267              
  Lines       32968    32995      +27     
==========================================
+ Hits        24908    24932      +24     
- Misses       6937     6940       +3     
  Partials     1123     1123              
Flag Coverage Δ
unittests 75.56% <89.28%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
runtime/format/string.go 89.28% <89.28%> (-10.72%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29f4ae1...17114f6. Read the comment docs.

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

Successfully merging this pull request may close these issues.

3 participants