Git Product home page Git Product logo

Comments (5)

liamnichols avatar liamnichols commented on May 27, 2024 1

Thanks again @paulgessinger, this is released in 0.1.1

from xcstrings-tool.

liamnichols avatar liamnichols commented on May 27, 2024

Thanks for raising this @paulgessinger!

I would guess this should actually result in a UInt argument?

I've never worked with %u before, but looking at some reference for printf, it seems that you are right: https://en.wikipedia.org/wiki/Printf#Type_field

I think that it would be fine to add a uint case to PlaceholderType and map to it from "u" 👍

If you feel up for a Pull Request, that would be great! If not, I'll take a look when I get a bit of free time 🙂

from xcstrings-tool.

liamnichols avatar liamnichols commented on May 27, 2024

In fact, it seems like "u", "x" and "o" should probably be UInt because sending a negative value using those placeholders results in the what I imagine is the wrong output:

let int: Int = -10

String(format: "%d", int) // -10
String(format: "%i", int) // -10
String(format: "%u", int) // 4294967286
String(format: "%x", int) // fffffff6
String(format: "%X", int) // FFFFFFF6
String(format: "%o", int) // 37777777766

let uint: UInt = 10

String(format: "%d", uint) // 10
String(format: "%i", uint) // 10
String(format: "%u", uint) // 10
String(format: "%x", uint) // a
String(format: "%X", uint) // A
String(format: "%o", uint) // 12

from xcstrings-tool.

paulgessinger avatar paulgessinger commented on May 27, 2024

Happy to try a PR!

I'm struggling a bit to get the generated swift file since the test generator puts it in a temporary directory that gets deleted right after the test run it seems.

I tried changing the target location to CWD temporarily but that seems to give an empty for somehow.

EDIT: I found the teardown block...

from xcstrings-tool.

liamnichols avatar liamnichols commented on May 27, 2024

Ah yes, I will have to try and remember how I implemented the testing infra 😅 I'll add a note to write some instructions for future contributors 🙏

from xcstrings-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.