<commit_before>package hyper

import (
	"github.com/bmizerany/assert"
	"testing"
)

func TestExpand(t *testing.T) {
	link := Link("https://api.github.com/users/{user}")
	url, _ := link.Expand(M{"user": "jingweno"})
	assert.Equal(t, "https://api.github.com/users/jingweno", url)
}
<commit_msg>Add test case for Link#Expand() with nil or empty M<commit_after>package hyper

import (
	"github.com/bmizerany/assert"
	"testing"
)

func TestLink_Expand(t *testing.T) {
	link := Link("https://api.github.com/users/{user}")
	url, _ := link.Expand(M{"user": "jingweno"})
	assert.Equal(t, "https://api.github.com/users/jingweno", url)

	link = Link("https://api.github.com/user")
	url, _ = link.Expand(nil)
	assert.Equal(t, "https://api.github.com/user", url)

	url, _ = link.Expand(M{})
	assert.Equal(t, "https://api.github.com/user", url)
}

{'fraction_non_alphanumeric': 0.2064825930372149, 'fraction_numerical': 0.0, 'mean_word_length': 4.597315436241611, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, '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': '4288794', 'n_tokens_mistral': 336, 'n_tokens_neox': 326, 'n_words': 53}