fbeline
After working with Elixir for a few months, I’ve noticed extra efforts by me and my colleagues when writing tests involving lists.
Usually those issues was related to ordering. Sometimes even producing flaky behavior.
With that in mind, I wrote a small library that provides a way to assert lists in an idiomatic way and does not make me feel “weird” about it.
https://github.com/fbeline/copeiro
Please, feel free to share your thoughts around the subject ![]()
Trending in Announcing
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub.
Docs are at OpenaiEx User Gu...
New
WebAuthnLiveComponent WebAuthnComponents
See this post about renaming the package.
Passwordless authentication for Phoenix LiveView app...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Castle is a package I put together to assist with building Elixir releases capable of being live-upgraded via the ‘official’ release hand...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hey everyone! :waving_hand:
I’m excited to share a new library with you all: Magic Auth! It’s an authentication library for Phoenix proj...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Other Trending Topics
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
What IDE or editor are you using for Elixir development?
Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
eksperimental
Just one comment. You don’ t need to require a module if you are importing it.
eksperimental
Personally I wouldn’t use
insince it is an operator that behaves in a different way. I would usehasandhas not, but you will have to flip the arguments. Or name it something else.al2o3cr
I’ve seen this, but it’s generally been a symptom of code that was relying on Postgres returning rows in insertion order in tests when not using an
order_byclause.IMO the flakiness there indicates a bug, so hiding it by making comparisons order-insensitive wouldn’t be ideal.
fbeline
Yes, that is exactly the point. In several tests the order does not matter and the insertion order is not the expected one for some runs.
It’s not necessarily a bug in your code. In my experience it’s usually related to a missing “order_by” (in test) as you said.
Also, you should not use a function that checks if it’s a “subset” or ignore order if order is something important to your business rules.