1package c_test 2 3import ( 4 "testing" 5 6 "github.com/alecthomas/assert" 7 8 "github.com/alecthomas/chroma" 9 "github.com/alecthomas/chroma/lexers/c" 10) 11 12func TestIssue290(t *testing.T) { 13 input := `// 64-bit floats have 53 digits of precision, including the whole-number-part. 14double a = 0011111110111001100110011001100110011001100110011001100110011010; // imperfect representation of 0.1 15double b = 0011111111001001100110011001100110011001100110011001100110011010; // imperfect representation of 0.2 16double c = 0011111111010011001100110011001100110011001100110011001100110011; // imperfect representation of 0.3 17double a + b = 0011111111010011001100110011001100110011001100110011001100110100; // Note that this is not quite equal to the "canonical" 0.3!a 18` 19 it, err := c.CPP.Tokenise(nil, input) 20 assert.NoError(t, err) 21 for { 22 token := it() 23 if token == chroma.EOF { 24 break 25 } 26 } 27} 28