Get the latest tech news

Just Write a Test for It


This is a short appreciation post about Rust continuously guiding me towards doing The Right Thing™.

One of the most popular projects seems to be bors, a from-scratch implementation of a merge queue bot that we aim to use to manage pull requests in the main Rust compiler repository. It looked innocent enough at a first glance, until I realized that adding a NOT NULL column to an already populated table without providing some DEFAULT value for the existing rows is not a good idea. I didn’t even read the documentation apart from copying one line of code that bootstrapped the parsing process; I built the test simply by examining and following autocompletion hints.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of test

test

Related news:

News photo

Papua New Guinea shuts down Facebook in test to stop 'pornography, misinformation, hate speech'

News photo

Google claims news is worthless to its ad business after test involving 1% of search results in eight EU markets

News photo

Tesla drives into Wile E. Coyote fake road wall in camera vs. Lidar test