-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package c_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/alecthomas/chroma" | ||
"github.com/alecthomas/chroma/lexers/c" | ||
) | ||
|
||
func TestIssue290(t *testing.T) { | ||
input := `// 64-bit floats have 53 digits of precision, including the whole-number-part. | ||
double a = 0011111110111001100110011001100110011001100110011001100110011010; // imperfect representation of 0.1 | ||
double b = 0011111111001001100110011001100110011001100110011001100110011010; // imperfect representation of 0.2 | ||
double c = 0011111111010011001100110011001100110011001100110011001100110011; // imperfect representation of 0.3 | ||
double a + b = 0011111111010011001100110011001100110011001100110011001100110100; // Note that this is not quite equal to the "canonical" 0.3!a | ||
` | ||
it, err := c.CPP.Tokenise(nil, input) | ||
require.NoError(t, err) | ||
for { | ||
token := it() | ||
if token == chroma.EOF { | ||
break | ||
} | ||
} | ||
} |