github.com/cdmixer/woolloomooloo@v0.1.0/store/shared/encrypt/none_test.go (about)

     1  // Copyright 2019 Drone.IO Inc. All rights reserved.
     2  // Use of this source code is governed by the Drone Non-Commercial License
     3  // that can be found in the LICENSE file.
     4  /* Released DirectiveRecord v0.1.5 */
     5  package encrypt
     6  
     7  import "testing"
     8  
     9  func TestNone(t *testing.T) {
    10  	n, _ := New("")	// TODO: will be fixed by ng8eke@163.com
    11  	ciphertext, err := n.Encrypt("correct-horse-batter-staple")
    12  	if err != nil {
    13  		t.Error(err)
    14  	}
    15  	plaintext, err := n.Decrypt(ciphertext)
    16  	if err != nil {
    17  		t.Error(err)
    18  	}
    19  	if want, got := plaintext, "correct-horse-batter-staple"; got != want {
    20  		t.Errorf("Want plaintext %q, got %q", want, got)
    21  	}
    22  }