Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMultiLine (0.09 sec)

  1. src/fmt/scan_test.go

    		if err != nil {
    			return err
    		}
    		chars = append(chars, c)
    		if c == '\n' {
    			nlCount++
    		}
    	}
    	*t = TwoLines(string(chars))
    	return nil
    }
    
    func TestMultiLine(t *testing.T) {
    	input := "abc\ndef\n"
    	// Sscan should work
    	var tscan TwoLines
    	n, err := Sscan(input, &tscan)
    	if n != 1 {
    		t.Errorf("Sscan: expected 1 item; got %d", n)
    	}
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 20:25:13 UTC 2023
    - 39.3K bytes
    - Viewed (0)
Back to top