<commit_before>package mssql

import (
	"testing"
)

func TestParseParams(t *testing.T) {
	values := []struct {
		s string
		d string
		n int
	}{
		{"select ?", "select @p1", 1},
		{"select ?, ?", "select @p1, @p2", 2},
		{"select ? -- ?", "select @p1 -- ?", 1},
		{"select ? - ?", "select @p1 - @p2", 2},
		{"select ? /* ? */, ?", "select @p1 /* ? */, @p2", 2},
		{"select ? /* ? * ? */, ?", "select @p1 /* ? * ? */, @p2", 2},
		{"select \"foo?\", [foo?], 'foo?', ?", "select \"foo?\", [foo?], 'foo?', @p1", 1},
		{"select \"x\"\"y\", [x]]y], 'x''y', ?", "select \"x\"\"y\", [x]]y], 'x''y', @p1", 1},
	}

	for _, v := range values {
		d, n := parseParams(v.s)
		if d != v.d {
			t.Error("Parse params don't match ", d, v.d)
		}
		if n != v.n {
			t.Error("Parse number of params don't match", n, v.n)
		}
	}
}
<commit_msg>parseParams tests<commit_after>package mssql

import (
	"testing"
)

func TestParseParams(t *testing.T) {
	values := []struct {
		s string
		d string
		n int
	}{
		{"select ?", "select @p1", 1},
		{"select ?, ?", "select @p1, @p2", 2},
		{"select ? -- ?", "select @p1 -- ?", 1},
		{"select ? -- ?\n, ?", "select @p1 -- ?\n, @p2", 2},
		{"select ? - ?", "select @p1 - @p2", 2},
		{"select ? /* ? */, ?", "select @p1 /* ? */, @p2", 2},
		{"select ? /* ? * ? */, ?", "select @p1 /* ? * ? */, @p2", 2},
		{"select \"foo?\", [foo?], 'foo?', ?", "select \"foo?\", [foo?], 'foo?', @p1", 1},
		{"select \"x\"\"y\", [x]]y], 'x''y', ?", "select \"x\"\"y\", [x]]y], 'x''y', @p1", 1},
		{"select \"foo?\", ?", "select \"foo?\", @p1", 1},
		{"select 'foo?', ?", "select 'foo?', @p1", 1},
		{"select [foo?], ?", "select [foo?], @p1", 1},
	}

	for _, v := range values {
		d, n := parseParams(v.s)
		if d != v.d {
			t.Error("Parse params don't match ", d, v.d)
		}
		if n != v.n {
			t.Error("Parse number of params don't match", n, v.n)
		}
	}
}

{'fraction_non_alphanumeric': 0.3254310344827586, 'fraction_numerical': 0.026400862068965518, 'mean_word_length': 2.699203187250996, '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': '5781413', 'n_tokens_mistral': 887, 'n_tokens_neox': 816, 'n_words': 206}