summaryrefslogtreecommitdiff
path: root/src/pkg/fmt/scan_test.go
AgeCommit message (Collapse)AuthorFilesLines
2011-09-13Imported Upstream version 60upstream/60Ondřej Surý1-0/+923
2011-09-13Imported Upstream version 60Ondřej Surý1-921/+0
2011-08-03Imported Upstream version 59upstream/59Ondřej Surý1-2/+2
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý1-0/+62
2011-04-28Imported Upstream version 2011.04.27upstream/2011.04.27Ondřej Surý1-5/+7
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý1-12/+15
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý1-29/+208
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-1/+17
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý1-15/+9
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-147/+275
2010-06-24fmt.Scan: fix handling of EOFs.Rob Pike1-0/+42
Fixes issue 876. R=rsc CC=golang-dev http://codereview.appspot.com/1675048
2010-06-18fmt.Scanf: improve error message when input does not match formatRob Pike1-0/+1
R=rsc CC=golang-dev http://codereview.appspot.com/1693043 Committer: Rob Pike <r@golang.org>
2010-06-15fmt.Scan: fix %c in the case where the input does not implement ReadRune itself.Rob Pike1-14/+62
While we're at it, clean up and test the code to guarantee we see every byte when the text is erroneous UTF-8. Fixes issue 866. R=rsc CC=golang-dev http://codereview.appspot.com/1712042
2010-06-14fmt.Print*: reimplement to switch on type first.Rob Pike1-24/+1
This shortens, simplifies and regularizes the code significantly. (Improvements to reflect could make another step.) Passes all.bash. One semantic change occurs: The String() method changes behavior. It used to run only for string formats such as %s and %q. Instead, it now runs whenever the item has the method and the result is then processed by the format as a string. Besides the regularization, this has three effects: 1) width is honored for String() items 2) %x works for String() items 3) implementations of String that merely recur will recur forever Regarding point 3, example from the updated documentation: type X int func (x X) String() string { return Sprintf("%d", x) } should cast the value before recurring: func (x X) String() string { return Sprintf("%d", int(x)) } R=rsc CC=golang-dev http://codereview.appspot.com/1613045
2010-06-03fmt.Scan: %cRob Pike1-4/+7
R=rsc CC=golang-dev http://codereview.appspot.com/1518042
2010-06-03fmt.Scan: field widthsRob Pike1-38/+111
Also fix an interface bug: white-space-delimited doesn't work well for cases like "%d, %d" on "23, 23") R=rsc CC=golang-dev http://codereview.appspot.com/1502041
2010-06-02fmt.Scan: scan []byte argumentsRob Pike1-0/+12
R=rsc CC=golang-dev http://codereview.appspot.com/1486041
2010-06-02fmt.Scanf: implement formats, provide Sscanf (strings)Rob Pike1-10/+35
- provide convenience functions for scanning strings - enable Scanf etc. - update doc comments R=rsc CC=golang-dev http://codereview.appspot.com/1451044
2010-06-01fmt.Scan: renamings, strings, errorsRob Pike1-43/+80
- implement scanning for all renamed types (compiler bug stops complex from being renamable, so it can't be tested but the code is there) - %q %x for strings - error handling now done with panic/recover R=rsc CC=golang-dev http://codereview.appspot.com/1458041
2010-05-31fmt.Scan: refactor the implementation so format-driven and normal scanning ↵Rob Pike1-3/+3
use the same function. simplifies the code significantly. Still TODO: - proper format handling - strings R=rsc CC=golang-dev http://codereview.appspot.com/1432041
2010-05-31fmt.Scan:Rob Pike1-18/+132
- reimplement integer scanning to handle renamed basic integer types - start implementation of Fscanf and Scanf; not yet ready for general use. This intermediate CL is a useful checkpoint. A similar change needs to be done for float and complex, but it seemed worth getting the approach reviewed before making those changes. R=rsc CC=golang-dev http://codereview.appspot.com/1418041
2010-05-28fmt.Scan: add Fscan and Fscanln and make Scan and ScanlnRob Pike1-7/+7
read from standard input. Add description of scanning to the package comment. R=rsc CC=golang-dev http://codereview.appspot.com/1390041
2010-05-26fmt.Scan: custom formattersRob Pike1-0/+22
R=rsc CC=golang-dev http://codereview.appspot.com/1315042
2010-05-26fmt: fix 386 build. error strings differ for overflow on 386.Rob Pike1-1/+3
R=gri CC=golang-dev http://codereview.appspot.com/1316042
2010-05-25fmt.Scan, fmt.Scanln: Start of a simple scanning API in the fmt package.Rob Pike1-0/+181
Still to do: - composite types - user-defined scanners - format-driven scanning The package comment will be updated when more of the functionality is in place. R=rsc CC=golang-dev http://codereview.appspot.com/1252045