@@ -40,66 +40,6 @@ describe('Circuit String', () => {
4040 } ) ;
4141 } ) ;
4242
43- /* describe('#contains', () => {
44- test('returns true when str contains other str', () => {
45- const str = CircuitString.fromString(
46- 'Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth'
47- );
48- const contained_str = CircuitString.fromString(
49- 'Everything we hear is an opinion, not a fact.'
50- );
51- expect(str.contains(contained_str)).toEqual(new Bool(true));
52-
53- await Provable.runAndCheck(() => {
54- const str = CircuitString.fromString(
55- 'Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth'
56- );
57- const contained_str = CircuitString.fromString(
58- 'Everything we hear is an opinion, not a fact.'
59- );
60- expect(str.contains(contained_str)).toEqual(new Bool(true));
61- });
62- });
63-
64- test('returns false when str does not contain other str', () => {
65- const str = CircuitString.fromString('abcdefghijklmnop');
66- const not_contained_str = CircuitString.fromString('defhij');
67- expect(str.contains(not_contained_str)).toEqual(new Bool(false));
68-
69- await Provable.runAndCheck(() => {
70- const str = CircuitString.fromString('abcdefghijklmnop');
71- const not_contained_str = CircuitString.fromString('defhij');
72- expect(str.contains(not_contained_str)).toEqual(new Bool(false));
73- });
74- });
75-
76- describe('compatibility with implementing classes', () => {
77- test('string8 may contain string', () => {
78- const str = CircuitString8.fromString('abcd');
79- const contained_str = CircuitString.fromString('ab');
80- expect(str.contains(contained_str)).toEqual(new Bool(true));
81-
82- await Provable.runAndCheck(() => {
83- const str = CircuitString8.fromString('abcd');
84- const contained_str = CircuitString.fromString('ab');
85- expect(str.contains(contained_str)).toEqual(new Bool(true));
86- });
87- });
88-
89- test('string may contain string8', () => {
90- const str = CircuitString.fromString('abcd');
91- const contained_str = CircuitString8.fromString('ab');
92- expect(str.contains(contained_str)).toEqual(new Bool(true));
93-
94- await Provable.runAndCheck(() => {
95- const str = CircuitString.fromString('abcd');
96- const contained_str = CircuitString8.fromString('ab');
97- expect(str.contains(contained_str)).toEqual(new Bool(true));
98- });
99- });
100- });
101- }); */
102-
10343 describe ( '#toString' , ( ) => {
10444 test ( 'serializes to string' , async ( ) => {
10545 const js_str =
@@ -158,23 +98,11 @@ describe('Circuit String', () => {
15898 } ) ;
15999 } ) ;
160100
161- /* describe('CircuitString8', async () => {
162- test('cannot create more than 8 chars', () => {
163- expect(() => {
164- await Provable.runAndCheck(() => {
165- Provable.witness(CircuitString8, () => {
166- return CircuitString8.fromString('More than eight chars');
167- });
168- });
169- }).toThrow();
170- });
171- }); */
172-
173101 describe . skip ( 'with invalid input' , ( ) => {
174102 test ( 'cannot use a character out of range' , ( ) => {
175103 expect ( ( ) => {
176104 Provable . runAndCheck ( ( ) => {
177- const str = Provable . witness ( CircuitString , ( ) => {
105+ Provable . witness ( CircuitString , ( ) => {
178106 return CircuitString . fromCharacters ( [
179107 new Character ( Field ( 100 ) ) ,
180108 new Character ( Field ( 10000 ) ) ,
0 commit comments