rustkas

rustkas

Property-Based Testing with PropEr, Erlang, and Elixir: generator utf8() is absent (page 452)

Appendix 4
Generator Reference
(page 452)

The table has description about utf8() generator:

Generates to utf8-encoded text as a binary data structure.

Unfortunately, PropEr API do not has this generator. Link to documentation of PropEr API - link.

Link to unit() generator documentation - link. Link to vector() generator documentation - link. There are the closest places where documentation of utf8() generator could be.

Check if any generator is present in PropEr API, like integer() or tuple() via console:

lists:keyfind(integer, 1, element(2, lists:keyfind(exports, 1, proper_types:module_info()))).
{integer,2}
lists:keyfind(tuple, 1, element(2, lists:keyfind(exports, 1, proper_types:module_info()))).
{tuple,1}

Check if generator utf8() is missing in PropEr API via console:

lists:keyfind(utf8, 1, element(2, lists:keyfind(exports, 1, proper_types:module_info()))).
false

Note that, the console should be lounched in pbt project folder, which was created in the Chapter 1.

proper_types src.

Marked As Solved

rustkas

rustkas

I get it! Now (after gaining experience with the PropEr framework) I understand that utf8() generator exists. :partying_face:
It is in its (special) part of the framework - module proper_unicode.

It would be nice if this function at its location would have some kind of footnote.

Popular Prag Prog topics Top

Travis
Dockerfile: FROM ruby:2.6 RUN apt-get update -yqq RUN apt-get install -yqq --no-install-recommends nodejs COPY . /usr/src/app/ WORKDI...
New
jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New

Other popular topics Top

dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Latest in PragProg

View all threads ❯