aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/typeterm_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-08-04 15:18:37 -0700
committerRobert Griesemer <gri@golang.org>2021-08-06 20:34:43 +0000
commit5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a (patch)
treec058cc9c80087967f248f1e126664cb8ea08307b /src/cmd/compile/internal/types2/typeterm_test.go
parent110343e4a2a953a581e34e91e51cef08856b0b0a (diff)
downloadgo-5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a.tar.gz
go-5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a.zip
[dev.typeparams] cmd/compile/internal/types2: better names for things (cleanup)
- use the symbol 𝓀 (as in 𝓀niverse) instead of ⊀ to denote the set of all types (for better readabilty, ⊀ is hard to distinguish from T in some fonts) - use isAll instead of isTop to test for the set of all types - use allTermlist instead of topTermlist to denote the termlist representing all types Change-Id: Idcb0b3398782b38653338e65173c0dbb935e430a Reviewed-on: https://go-review.googlesource.com/c/go/+/339891 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typeterm_test.go')
-rw-r--r--src/cmd/compile/internal/types2/typeterm_test.go42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/cmd/compile/internal/types2/typeterm_test.go b/src/cmd/compile/internal/types2/typeterm_test.go
index cc4e30d989..a8cc362f56 100644
--- a/src/cmd/compile/internal/types2/typeterm_test.go
+++ b/src/cmd/compile/internal/types2/typeterm_test.go
@@ -11,7 +11,7 @@ import (
var testTerms = map[string]*term{
"βˆ…": nil,
- "⊀": {},
+ "𝓀": {},
"int": {false, Typ[Int]},
"~int": {true, Typ[Int]},
"string": {false, Typ[String]},
@@ -46,14 +46,14 @@ func testTerm(name string) *term {
func TestTermEqual(t *testing.T) {
for _, test := range []string{
"βˆ… βˆ… T",
- "⊀ ⊀ T",
+ "𝓀 𝓀 T",
"int int T",
"~int ~int T",
- "βˆ… ⊀ F",
+ "βˆ… 𝓀 F",
"βˆ… int F",
"βˆ… ~int F",
- "⊀ int F",
- "⊀ ~int F",
+ "𝓀 int F",
+ "𝓀 ~int F",
"int ~int F",
} {
args := split(test, 3)
@@ -74,12 +74,12 @@ func TestTermEqual(t *testing.T) {
func TestTermUnion(t *testing.T) {
for _, test := range []string{
"βˆ… βˆ… βˆ… βˆ…",
- "βˆ… ⊀ ⊀ βˆ…",
+ "βˆ… 𝓀 𝓀 βˆ…",
"βˆ… int int βˆ…",
"βˆ… ~int ~int βˆ…",
- "⊀ ⊀ ⊀ βˆ…",
- "⊀ int ⊀ βˆ…",
- "⊀ ~int ⊀ βˆ…",
+ "𝓀 𝓀 𝓀 βˆ…",
+ "𝓀 int 𝓀 βˆ…",
+ "𝓀 ~int 𝓀 βˆ…",
"int int int βˆ…",
"int ~int ~int βˆ…",
"int string int string",
@@ -87,11 +87,11 @@ func TestTermUnion(t *testing.T) {
"~int ~string ~int ~string",
// union is symmetric, but the result order isn't - repeat symmetric cases explictly
- "⊀ βˆ… ⊀ βˆ…",
+ "𝓀 βˆ… 𝓀 βˆ…",
"int βˆ… int βˆ…",
"~int βˆ… ~int βˆ…",
- "int ⊀ ⊀ βˆ…",
- "~int ⊀ ⊀ βˆ…",
+ "int 𝓀 𝓀 βˆ…",
+ "~int 𝓀 𝓀 βˆ…",
"~int int ~int βˆ…",
"string int string int",
"~string int ~string int",
@@ -111,12 +111,12 @@ func TestTermUnion(t *testing.T) {
func TestTermIntersection(t *testing.T) {
for _, test := range []string{
"βˆ… βˆ… βˆ…",
- "βˆ… ⊀ βˆ…",
+ "βˆ… 𝓀 βˆ…",
"βˆ… int βˆ…",
"βˆ… ~int βˆ…",
- "⊀ ⊀ ⊀",
- "⊀ int int",
- "⊀ ~int ~int",
+ "𝓀 𝓀 𝓀",
+ "𝓀 int int",
+ "𝓀 ~int ~int",
"int int int",
"int ~int int",
"int string βˆ…",
@@ -141,7 +141,7 @@ func TestTermIntersection(t *testing.T) {
func TestTermIncludes(t *testing.T) {
for _, test := range []string{
"βˆ… int F",
- "⊀ int T",
+ "𝓀 int T",
"int int T",
"~int int T",
"string int F",
@@ -160,14 +160,14 @@ func TestTermIncludes(t *testing.T) {
func TestTermSubsetOf(t *testing.T) {
for _, test := range []string{
"βˆ… βˆ… T",
- "⊀ ⊀ T",
+ "𝓀 𝓀 T",
"int int T",
"~int ~int T",
- "βˆ… ⊀ T",
+ "βˆ… 𝓀 T",
"βˆ… int T",
"βˆ… ~int T",
- "⊀ int F",
- "⊀ ~int F",
+ "𝓀 int F",
+ "𝓀 ~int F",
"int ~int T",
} {
args := split(test, 3)