Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for TestNumbers (0.25 sec)

  1. src/go/constant/value_test.go

    		if !Compare(x, token.EQL, y) {
    			t.Errorf("%s: %s != %s", test, x, y)
    		}
    	}
    }
    
    // TestNumbers verifies that differently written literals
    // representing the same number do have the same value.
    func TestNumbers(t *testing.T) {
    	testNumbers(t, token.INT, intTests)
    	testNumbers(t, token.FLOAT, floatTests)
    	testNumbers(t, token.IMAG, imagTests)
    }
    
    var opTests = []string{
    	// unary operations
    	`+ 0 = 0`,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 15.6K bytes
    - Viewed (0)
  2. src/html/template/template_test.go

    	}
    	if _, err := c.root.AddParseTree("t1", c.root.Tree); err == nil || !strings.Contains(err.Error(), "Execute") {
    		t.Errorf("AddParseTree: %v\nwanted error about already having Executed", err)
    	}
    }
    
    func TestNumbers(t *testing.T) {
    	c := newTestCase(t)
    	c.mustParse(c.root, `{{print 1_2.3_4}} {{print 0x0_1.e_0p+02}}`)
    	c.mustExecute(c.root, nil, "12.34 7.5")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:48:16 UTC 2022
    - 6.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/syntax/scanner_test.go

    		}
    		if got.text != want.text {
    			t.Errorf("%q: got %q; want %q", test.src, got.text, want.text)
    		}
    	}
    }
    
    func TestNumbers(t *testing.T) {
    	for _, test := range []struct {
    		kind             LitKind
    		src, tokens, err string
    	}{
    		// binaries
    		{IntLit, "0b0", "0b0", ""},
    		{IntLit, "0b1010", "0b1010", ""},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 14 16:11:21 UTC 2022
    - 21.9K bytes
    - Viewed (0)
  4. src/text/scanner/scanner_test.go

    		const want = `"`
    		if got != want {
    			t.Errorf("got %q; want %q", got, want)
    		}
    	}
    	for r := s.Scan(); r != EOF; r = s.Scan() {
    	}
    }
    
    func TestNumbers(t *testing.T) {
    	for _, test := range []struct {
    		tok              rune
    		src, tokens, err string
    	}{
    		// binaries
    		{Int, "0b0", "0b0", ""},
    		{Int, "0b1010", "0b1010", ""},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 17 03:41:50 UTC 2022
    - 25.3K bytes
    - Viewed (0)
  5. src/go/scanner/scanner_test.go

    				s.Init(file, src, nil, ScanComments)
    				for {
    					_, tok, _ := s.Scan()
    					if tok == token.EOF {
    						break
    					}
    				}
    			}
    		})
    	}
    }
    
    func TestNumbers(t *testing.T) {
    	for _, test := range []struct {
    		tok              token.Token
    		src, tokens, err string
    	}{
    		// binaries
    		{token.INT, "0b0", "0b0", ""},
    		{token.INT, "0b1010", "0b1010", ""},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 15:38:31 UTC 2023
    - 34.6K bytes
    - Viewed (0)
Back to top