Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for TestEncode (0.13 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/cbor/cbor_test.go

    func (p anyObject) MarshalCBOR() ([]byte, error) {
    	return modes.Encode.Marshal(p.Value)
    }
    
    func (p *anyObject) UnmarshalCBOR(in []byte) error {
    	return modes.Decode.Unmarshal(in, &p.Value)
    }
    
    func TestEncode(t *testing.T) {
    	for _, tc := range []struct {
    		name           string
    		in             runtime.Object
    		assertOnWriter func() (io.Writer, func(*testing.T))
    		assertOnError  func(*testing.T, error)
    	}{
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 13 14:57:12 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  7. src/encoding/base32/base32_test.go

    }
    
    func testEqual(t *testing.T, msg string, args ...any) bool {
    	t.Helper()
    	if args[len(args)-2] != args[len(args)-1] {
    		t.Errorf(msg, args...)
    		return false
    	}
    	return true
    }
    
    func TestEncode(t *testing.T) {
    	for _, p := range pairs {
    		got := StdEncoding.EncodeToString([]byte(p.decoded))
    		testEqual(t, "Encode(%q) = %q, want %q", p.decoded, got, p.encoded)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 16:25:54 UTC 2024
    - 26K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/json/json_test.go

    func (testEncodableMap[K]) GetObjectKind() schema.ObjectKind {
    	panic("unimplemented")
    }
    
    func (testEncodableMap[K]) DeepCopyObject() runtime.Object {
    	panic("unimplemented")
    }
    
    func TestEncode(t *testing.T) {
    	for _, tc := range []struct {
    		name string
    		in   runtime.Object
    		want []byte
    	}{
    		// The Go visibility rules for struct fields are amended for JSON when deciding
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 04 15:55:02 UTC 2024
    - 40K bytes
    - Viewed (0)
Back to top