[text] Fix invalid TextPoint creation past end in Ime

Previously, if a client tried to create a TextPoint with an offset that
put the point beyond the end of the text field, the character index
would be incorrectly set to char_to_byte.len() instead of
char_to_byte.len()-1, which resulted in a panic.

This change both adds a breaking test to TextFieldTestSuite so that
other implementations can test for similar bugs, as well as actually
fixes the bug itself.

Change-Id: Ia14ed43cacfc56fb5efa35f528c80afe8bdf1304
3 files changed
tree: b6eac3984ebae89d535ceba70de12f45f7f27803
  1. boards/
  2. build/
  3. buildtools/
  4. bundles/
  5. docs/
  6. examples/
  7. garnet/
  8. peridot/
  9. products/
  10. scripts/
  11. sdk/
  12. src/
  13. third_party/
  14. tools/
  15. zircon/
  16. .clang-format
  17. .dir-locals.el
  18. .gitattributes
  19. .gitignore
  20. .gn
  21. AUTHORS
  22. BUILD.gn
  23. CODE_OF_CONDUCT.md
  24. CONTRIBUTING.md
  25. LICENSE
  26. OWNERS
  27. PATENTS
  28. README.md
  29. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See the documentation.