Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for testEncodes (0.29 sec)

  1. android/guava-tests/test/com/google/common/io/BaseEncodingTest.java

      }
    
      public void testBase32LenientPadding() {
        testDecodes(base32(), "MZXW6", "foo");
        testDecodes(base32(), "MZXW6=", "foo");
        testDecodes(base32(), "MZXW6==", "foo");
        testDecodes(base32(), "MZXW6===", "foo"); // proper padding length
        testDecodes(base32(), "MZXW6====", "foo");
        testDecodes(base32(), "MZXW6=====", "foo");
      }
    
      public void testBase32AlternatePadding() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Apr 06 12:56:11 UTC 2023
    - 24.6K bytes
    - Viewed (0)
  2. src/encoding/ascii85/ascii85_test.go

    			t[w] = c
    			w++
    		}
    	}
    	return string(t[0:w])
    }
    
    func TestEncode(t *testing.T) {
    	for _, p := range pairs {
    		buf := make([]byte, MaxEncodedLen(len(p.decoded)))
    		n := Encode(buf, []byte(p.decoded))
    		buf = buf[0:n]
    		testEqual(t, "Encode(%q) = %q, want %q", p.decoded, strip85(string(buf)), strip85(p.encoded))
    	}
    }
    
    func TestEncoder(t *testing.T) {
    	for _, p := range pairs {
    		bb := &strings.Builder{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:46:20 UTC 2022
    - 5.8K bytes
    - Viewed (0)
  3. src/test/java/org/codelibs/core/net/URLUtilTest.java

    import java.net.URL;
    
    import junit.framework.TestCase;
    
    /**
     * @author taichi
     *
     */
    public class URLUtilTest extends TestCase {
    
        /**
         * @throws Exception
         */
        public void testEncode() throws Exception {
            assertEquals("Program+Files", URLUtil.encode("Program Files", "UTF-8"));
        }
    
        /**
         * @throws Exception
         */
        public void testDecode() throws Exception {
    Registered: Wed Jun 12 12:50:12 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/core/misc/Base64UtilTest.java

        private static final byte[] BINARY_DATA = ORIGINAL.getBytes();
    
        private static final String ENCODED_DATA = "aG93IG5vdyBicm93biBjb3cNCg==";
    
        /**
         * @throws Exception
         */
        public void testEncode() throws Exception {
            assertEquals("1", ENCODED_DATA, Base64Util.encode(BINARY_DATA));
            System.out.println(Base64Util.encode(new byte[] { 'a', 'b', 'c' }));
        }
    
        /**
         * @throws Exception
    Registered: Wed Jun 12 12:50:12 UTC 2024
    - Last Modified: Thu Mar 07 01:59:08 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/internal/modes/encode_test.go

    limitations under the License.
    */
    
    package modes_test
    
    import (
    	"fmt"
    	"testing"
    
    	"github.com/fxamacker/cbor/v2"
    	"github.com/google/go-cmp/cmp"
    )
    
    func TestEncode(t *testing.T) {
    	for _, tc := range []struct {
    		name          string
    		modes         []cbor.EncMode
    		in            interface{}
    		want          []byte
    		assertOnError func(t *testing.T, e error)
    	}{
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 04 15:55:02 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. src/encoding/base64/base64_test.go

    			testEqual(t, `AppendEncode("lead", %q) = %q, want %q`, p.decoded, string(dst), "lead"+tt.conv(p.encoded))
    		}
    	}
    }
    
    func TestEncoder(t *testing.T) {
    	for _, p := range pairs {
    		bb := &strings.Builder{}
    		encoder := NewEncoder(StdEncoding, bb)
    		encoder.Write([]byte(p.decoded))
    		encoder.Close()
    		testEqual(t, "Encode(%q) = %q, want %q", p.decoded, bb.String(), p.encoded)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Sep 03 18:57:29 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  7. src/unicode/utf16/utf16_test.go

    	{[]rune{'a', 'b', 0xd7ff, 0xd800, 0xdfff, 0xe000, 0x110000, -1},
    		[]uint16{'a', 'b', 0xd7ff, 0xfffd, 0xfffd, 0xe000, 0xfffd, 0xfffd}},
    }
    
    func TestEncode(t *testing.T) {
    	for _, tt := range encodeTests {
    		out := Encode(tt.in)
    		if !reflect.DeepEqual(out, tt.out) {
    			t.Errorf("Encode(%x) = %x; want %x", tt.in, out, tt.out)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 07 19:08:48 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  8. src/encoding/hex/hex_test.go

    	{"f0f1f2f3f4f5f6f7", []byte{0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7}},
    	{"f8f9fafbfcfdfeff", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}},
    	{"67", []byte{'g'}},
    	{"e3a1", []byte{0xe3, 0xa1}},
    }
    
    func TestEncode(t *testing.T) {
    	for i, test := range encDecTests {
    		dst := make([]byte, EncodedLen(len(test.dec)))
    		n := Encode(dst, test.dec)
    		if n != len(dst) {
    			t.Errorf("#%d: bad return value: got: %d want: %d", i, n, len(dst))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 19:30:23 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/test/runtime_serializer_protobuf_protobuf_test.go

    	}
    	for i, data := range recognizes {
    		if ok, _, err := s.RecognizesData(data); err != nil || !ok {
    			t.Errorf("%d: should recognize data: %v", i, err)
    		}
    	}
    }
    
    func TestEncode(t *testing.T) {
    	obj1 := &testMarshalable{testObject: testObject{}, data: []byte{}}
    	wire1 := []byte{
    		0x6b, 0x38, 0x73, 0x00, // prefix
    		0x0a, 0x04,
    		0x0a, 0x00, // apiversion
    		0x12, 0x00, // kind
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:16 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  10. src/encoding/base32/base32_test.go

    		testEqual(t, `AppendEncode("lead", %q) = %q, want %q`, p.decoded, string(dst), "lead"+p.encoded)
    	}
    }
    
    func TestEncoder(t *testing.T) {
    	for _, p := range pairs {
    		bb := &strings.Builder{}
    		encoder := NewEncoder(StdEncoding, bb)
    		encoder.Write([]byte(p.decoded))
    		encoder.Close()
    		testEqual(t, "Encode(%q) = %q, want %q", p.decoded, bb.String(), p.encoded)
    	}
    }
    
    func TestEncoderBuffering(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 16:25:54 UTC 2024
    - 26K bytes
    - Viewed (0)
Back to top