<commit_before>package cryptdo

import (
	"bytes"
	"testing"
	"testing/quick"

	"code.xoeb.us/cryptdo"
)

func TestRoundtrip(t *testing.T) {
	roundtrip := func(plaintext []byte, passphrase string) bool {
		ciphertext, err := cryptdo.Encrypt(plaintext, passphrase)
		if err != nil {
			return false
		}

		plain, err := cryptdo.Decrypt(ciphertext, passphrase)
		if err != nil {
			return false
		}

		return bytes.Equal(plaintext, plain)
	}

	if err := quick.Check(roundtrip, nil); err != nil {
		t.Error(err)
	}
}
<commit_msg>do not run roundtrip test if in short testing mode<commit_after>package cryptdo

import (
	"bytes"
	"testing"
	"testing/quick"

	"code.xoeb.us/cryptdo"
)

func TestRoundtrip(t *testing.T) {
	if testing.Short() {
		t.Skip("skipping roundtrip test in short mode")
	}

	roundtrip := func(plaintext []byte, passphrase string) bool {
		ciphertext, err := cryptdo.Encrypt(plaintext, passphrase)
		if err != nil {
			return false
		}

		plain, err := cryptdo.Decrypt(ciphertext, passphrase)
		if err != nil {
			return false
		}

		return bytes.Equal(plaintext, plain)
	}

	if err := quick.Check(roundtrip, nil); err != nil {
		t.Error(err)
	}
}

{'fraction_non_alphanumeric': 0.13218884120171673, 'fraction_numerical': 0.0, 'mean_word_length': 3.759183673469388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6566505', 'n_tokens_mistral': 469, 'n_tokens_neox': 420, 'n_words': 105}